Skip to content

try to fix tests by changing plotly urls #2315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/python/chart-studio/chart_studio/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __str__(self):
"column to Plotly before you can assign it to '{reference}'.\n"
"To upload, try `plotly.plotly.grid_objs.upload` or "
"`plotly.plotly.grid_objs.append_column`.\n"
"Questions? chris@plot.ly"
"Questions? chris@plotly.com"
)

NON_UNIQUE_COLUMN_MESSAGE = (
Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(self):
">>> import plotly.tools as tls\n"
">>> tls.set_credentials_file(username='username', "
"api_key='api-key')\n\n"
"For more help, see https://plot.ly/python.\n"
"For more help, see https://plotly.com/python.\n"
)
super(PlotlyLocalCredentialsError, self).__init__(message)

Expand Down
6 changes: 3 additions & 3 deletions packages/python/chart-studio/chart_studio/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"stream_ids": [],
},
CONFIG_FILE: {
"plotly_domain": "https://plot.ly",
"plotly_streaming_domain": "stream.plot.ly",
"plotly_api_domain": "https://api.plot.ly",
"plotly_domain": "https://plotly.com",
"plotly_streaming_domain": "stream.plotly.com",
"plotly_api_domain": "https://api.plotly.com",
"plotly_ssl_verification": True,
"plotly_proxy_authorization": False,
"world_readable": True,
Expand Down
28 changes: 14 additions & 14 deletions packages/python/chart-studio/chart_studio/plotly/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def get_figure(file_owner_or_url, file_id=None, raw=False):
pass a valid plotly url as the first argument.

Examples:
fig = get_figure('https://plot.ly/~chris/1638')
fig = get_figure('https://plotly.com/~chris/1638')
fig = get_figure('chris', 1638)

Note, if you're using a file_owner string as the first argument, you MUST
Expand Down Expand Up @@ -574,7 +574,7 @@ class Stream:
Every viewer of the graph sees the same data at the same time.

View examples and tutorials here:
https://plot.ly/python/streaming/
https://plotly.com/python/streaming/

Stream example:
# Initialize a streaming graph
Expand Down Expand Up @@ -602,7 +602,7 @@ def __init__(self, stream_id):

For more help, see: `help(plotly.plotly.Stream)`
or see examples and tutorials here:
https://plot.ly/python/streaming/
https://plotly.com/python/streaming/

"""
self.stream_id = stream_id
Expand Down Expand Up @@ -664,7 +664,7 @@ def open(self):

For more help, see: `help(plotly.plotly.Stream)`
or see examples and tutorials here:
https://plot.ly/python/streaming/
https://plotly.com/python/streaming/

"""
streaming_specs = self.get_streaming_specs()
Expand Down Expand Up @@ -746,7 +746,7 @@ def close(self):

For more help, see: `help(plotly.plotly.Stream)`
or see examples and tutorials here:
https://plot.ly/python/streaming/
https://plotly.com/python/streaming/

"""
try:
Expand All @@ -771,7 +771,7 @@ def get(figure_or_data, format="png", width=None, height=None, scale=None):
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py.iplot`,
see https://plot.ly/python for examples
see https://plotly.com/python for examples
- format: 'png', 'svg', 'jpeg', 'pdf', 'emf'
- width: output width
- height: output height
Expand All @@ -798,7 +798,7 @@ def get(figure_or_data, format="png", width=None, height=None, scale=None):
"package currently only supports png, svg, jpeg, and pdf. "
"Learn more about image exporting, and the currently "
"supported file types here: "
"https://plot.ly/python/static-image-export/"
"https://plotly.com/python/static-image-export/"
)
if scale is not None:
try:
Expand Down Expand Up @@ -839,7 +839,7 @@ def ishow(cls, figure_or_data, format="png", width=None, height=None, scale=None
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py.iplot`,
see https://plot.ly/python for examples
see https://plotly.com/python for examples
- format: 'png', 'svg', 'jpeg', 'pdf'
- width: output width
- height: output height
Expand Down Expand Up @@ -883,7 +883,7 @@ def save_as(
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py.iplot`,
see https://plot.ly/python for examples
see https://plotly.com/python for examples
- filename: The filepath to save the image to
- format: 'png', 'svg', 'jpeg', 'pdf', 'emf'
- width: output width
Expand Down Expand Up @@ -1135,7 +1135,7 @@ def append_columns(cls, columns, grid=None, grid_url=None):
from plotly.grid_objs import Grid, Column
import plotly.plotly as py

grid_url = 'https://plot.ly/~chris/3143'
grid_url = 'https://plotly.com/~chris/3143'
column_1 = Column([1, 2, 3], 'time')
py.grid_ops.append_columns([column_1], grid_url=grid_url)
```
Expand Down Expand Up @@ -1204,7 +1204,7 @@ def append_rows(cls, rows, grid=None, grid_url=None):
from plotly.grid_objs import Grid
import plotly.plotly as py

grid_url = 'https://plot.ly/~chris/3143'
grid_url = 'https://plotly.com/~chris/3143'

row = [1, 5]
py.grid_ops.append_rows([row], grid=grid_url)
Expand Down Expand Up @@ -1276,7 +1276,7 @@ def delete(cls, grid=None, grid_url=None):
```
import plotly.plotly as py

grid_url = 'https://plot.ly/~chris/3'
grid_url = 'https://plotly.com/~chris/3'
py.grid_ops.delete(grid_url=grid_url)
```

Expand Down Expand Up @@ -1334,7 +1334,7 @@ def upload(cls, meta, grid=None, grid_url=None):
```
import plotly.plotly as py

grid_url = 'https://plot.ly/~chris/3143'
grid_url = 'https://plotly.com/~chris/3143'

meta = {'experment': 'GaAs'}

Expand Down Expand Up @@ -1371,7 +1371,7 @@ def parse_grid_id_args(grid, grid_url):
"grid: a plotly.graph_objs.Grid object that has already\n"
" been uploaded to Plotly.\n\n"
"grid_url: the url where the grid can be accessed on\n"
" Plotly, e.g. 'https://plot.ly/~chris/3043'\n\n"
" Plotly, e.g. 'https://plotly.com/~chris/3043'\n\n"
)
elif len(supplied_arg_names) > 1:
raise exceptions.InputError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class Presentation(dict):
Default = True.

For examples see the documentation:\n
https://plot.ly/python/presentations-api/
https://plotly.com/python/presentations-api/
"""

def __init__(self, markdown_string=None, style="moods", imgStretch=True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def test_reset_config_file(self):

tools.reset_config_file()
config = tools.get_config_file()
self.assertEqual(config["plotly_domain"], "https://plot.ly")
self.assertEqual(config["plotly_streaming_domain"], "stream.plot.ly")
self.assertEqual(config["plotly_domain"], "https://plotly.com")
self.assertEqual(config["plotly_streaming_domain"], "stream.plotly.com")

def test_get_credentials_file(self):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@


def test_get_valid_embed():
url = "https://plot.ly/~PlotBot/82/"
url = "https://plotly.com/~PlotBot/82/"
tls.get_embed(url)


def test_get_invalid_embed():
url = "https://plot.ly/~PlotBot/a/"
url = "https://plotly.com/~PlotBot/a/"
with pytest.raises(PlotlyError):
tls.get_embed(url)

Expand All @@ -25,7 +25,7 @@ def test_get_embed_url_with_share_key(self):
# Check the embed url for url with share_key included

get_embed_return = tls.get_embed(
"https://plot.ly/~neda/6572" + "?share_key=AH4MyPlyDyDWYA2cM2kj2m"
"https://plotly.com/~neda/6572" + "?share_key=AH4MyPlyDyDWYA2cM2kj2m"
)
expected_get_embed = (
'<iframe id="igraph" scrolling="no" '
Expand All @@ -37,7 +37,7 @@ def test_get_embed_url_with_share_key(self):
'width="{iframe_width}">'
"</iframe>"
).format(
plotly_rest_url="https://" + "plot.ly",
plotly_rest_url="https://" + "plotly.com",
file_owner="neda",
file_id="6572",
share_key="AH4MyPlyDyDWYA2" + "cM2kj2m",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@pytest.mark.matplotlib
class PlotMPLTest(TestCase):
def setUp(self):
py.sign_in("PlotlyImageTest", "786r5mecv0", plotly_domain="https://plot.ly")
py.sign_in("PlotlyImageTest", "786r5mecv0", plotly_domain="https://plotly.com")

def test_update_type_error(self):
fig, ax = plt.subplots()
Expand All @@ -45,7 +45,7 @@ def test_update(self):
title = "new title"
update = {"layout": {"title": title}}
url = py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
un = url.replace("https://plot.ly/~", "").split("/")[0]
fid = url.replace("https://plot.ly/~", "").split("/")[1]
un = url.replace("https://plotly.com/~", "").split("/")[0]
fid = url.replace("https://plotly.com/~", "").split("/")[1]
pfig = py.get_figure(un, fid)
assert pfig["layout"]["title"]["text"] == title
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ def test_get_figure(self):
def test_get_figure_with_url(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/13183/"
url = "https://plotly.com/~PlotlyImageTest/13183/"
py.sign_in(un, ak)
py.get_figure(url)

def test_get_figure_invalid_1(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/a/"
url = "https://plotly.com/~PlotlyImageTest/a/"
py.sign_in(un, ak)
with self.assertRaises(exceptions.PlotlyError):
py.get_figure(url)

def test_get_figure_invalid_2(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/-1/"
url = "https://plotly.com/~PlotlyImageTest/-1/"
py.sign_in(un, ak)
with self.assertRaises(exceptions.PlotlyError):
py.get_figure(url)
Expand All @@ -71,15 +71,15 @@ def test_get_figure_invalid_2(self):
def test_get_figure_invalid_3(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/2/"
url = "https://plotly.com/~PlotlyImageTest/2/"
py.sign_in(un, ak)
with self.assertRaises(ValueError):
py.get_figure(url)

def test_get_figure_does_not_exist(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/1000000000/"
url = "https://plotly.com/~PlotlyImageTest/1000000000/"
py.sign_in(un, ak)
with self.assertRaises(_plotly_utils.exceptions.PlotlyError):
py.get_figure(url)
Expand All @@ -97,6 +97,6 @@ class TestBytesVStrings(PlotlyTestCase):
def test_proper_escaping(self):
un = "PlotlyImageTest"
ak = "786r5mecv0"
url = "https://plot.ly/~PlotlyImageTest/13185/"
url = "https://plotly.com/~PlotlyImageTest/13185/"
py.sign_in(un, ak)
py.get_figure(url)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"plotly-platform": "pythonz",
}

server = "https://plot.ly"
server = "https://plotly.com"


class GetRequestsTest(PlotlyTestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GridTest(PlotlyTestCase):
_grid_id = "chris:3043"
_grid = Grid([])
_grid.id = _grid_id
_grid_url = "https://plot.ly/~chris/3043/my-grid"
_grid_url = "https://plotly.com/~chris/3043/my-grid"

def setUp(self):
super(GridTest, self).setUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ def test_upload_meta_with_grid(self):
+ "https://github.com/plotly/python-api/issues/263"
)
def test_metadata_to_nonexistent_grid(self):
non_exist_meta_url = "https://local.plot.ly/~GridTest/999999999"
non_exist_meta_url = "https://local.plotly.com/~GridTest/999999999"
with self.assertRaises(PlotlyRequestError):
py.meta_ops.upload(self._meta, grid_url=non_exist_meta_url)
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_invalid_code_language(self):
)

def test_expected_pres(self):
markdown_string = "# title\n---\ntransition: zoom, fade, fade\n# Colors\nColors are everywhere around us.\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nImage(https://raw.githubusercontent.com/jackparmer/gradient-backgrounds/master/moods1.png)\n```python\nx=1\n```\n---\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\nPlotly(https://plot.ly/~AdamKulidjian/3564/)\n---\n"
markdown_string = "# title\n---\ntransition: zoom, fade, fade\n# Colors\nColors are everywhere around us.\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nImage(https://raw.githubusercontent.com/jackparmer/gradient-backgrounds/master/moods1.png)\n```python\nx=1\n```\n---\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\nPlotly(https://plotly.com/~AdamKulidjian/3564/)\n---\n"

my_pres = pres.Presentation(markdown_string, style="moods", imgStretch=True)

Expand Down Expand Up @@ -255,7 +255,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 280.0,
"left": 0.0,
Expand Down Expand Up @@ -322,7 +322,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -339,7 +339,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -356,7 +356,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -373,7 +373,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -390,7 +390,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -407,7 +407,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand All @@ -424,7 +424,7 @@ def test_expected_pres(self):
"props": {
"frameBorder": 0,
"scrolling": "no",
"src": "https://plot.ly/~AdamKulidjian/3564/.embed?link=false",
"src": "https://plotly.com/~AdamKulidjian/3564/.embed?link=false",
"style": {
"height": 96.57142857142857,
"left": 400.0,
Expand Down
Loading