plotly-extend-wrapper 1.1.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. plotly_extend_wrapper-1.2.0/.devcontainer/devcontainer.json +29 -0
  2. plotly_extend_wrapper-1.2.0/.github/dependabot.yml +12 -0
  3. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/.github/workflows/deploy_pages.yaml +5 -15
  4. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/.github/workflows/pypi_release.yml +8 -4
  5. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/.github/workflows/unittest.yml +2 -0
  6. plotly_extend_wrapper-1.2.0/.vscode/settings.json +10 -0
  7. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/PKG-INFO +8 -21
  8. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/README.md +2 -17
  9. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/conf.py +3 -2
  10. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/plotly_extend_wrapper/wrapper.py +24 -13
  11. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/pyproject.toml +6 -6
  12. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/requirements-dev.lock +29 -9
  13. plotly_extend_wrapper-1.2.0/requirements.lock +63 -0
  14. plotly_extend_wrapper-1.2.0/test/test_common.py +25 -0
  15. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/test/test_wrapper.py +5 -4
  16. plotly_extend_wrapper-1.1.0/.devcontainer/Dockerfile +0 -43
  17. plotly_extend_wrapper-1.1.0/.devcontainer/devcontainer.json +0 -32
  18. plotly_extend_wrapper-1.1.0/requirements.lock +0 -38
  19. plotly_extend_wrapper-1.1.0/test/test_common.py +0 -15
  20. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/.gitignore +0 -0
  21. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/.python-version +0 -0
  22. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/LICENSE +0 -0
  23. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/codecov.yaml +0 -0
  24. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/Makefile +0 -0
  25. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/index.rst +0 -0
  26. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/make.bat +0 -0
  27. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/source/introduction.md +0 -0
  28. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/docs/source/wrapper.md +0 -0
  29. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/plotly_extend_wrapper/__init__.py +0 -0
  30. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/plotly_extend_wrapper/common.py +0 -0
  31. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/plotly_extend_wrapper/updater.py +0 -0
  32. {plotly_extend_wrapper-1.1.0 → plotly_extend_wrapper-1.2.0}/test/test_updater.py +0 -0
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "Python 3",
3
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
4
+ "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
5
+ "features": {
6
+ "ghcr.io/e-gineering/devcontainer-features/rye:1": {}
7
+ },
8
+ "customizations": {
9
+ "vscode": {
10
+ "extensions": [
11
+ "ms-python.python",
12
+ "njpwerner.autodocstring",
13
+ "charliermarsh.ruff",
14
+ "github.vscode-github-actions",
15
+ "IBM.output-colorizer"
16
+ ]
17
+ }
18
+ },
19
+ // Features to add to the dev container. More info: https://containers.dev/features.
20
+ // "features": {},
21
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
22
+ // "forwardPorts": [],
23
+ // Use 'postCreateCommand' to run commands after the container is created.
24
+ "postCreateCommand": "rye sync",
25
+ // Configure tool-specific properties.
26
+ // "customizations": {},
27
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
28
+ // "remoteUser": "root"
29
+ }
@@ -0,0 +1,12 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for more information:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+ # https://containers.dev/guide/dependabot
6
+
7
+ version: 2
8
+ updates:
9
+ - package-ecosystem: "devcontainers"
10
+ directory: "/"
11
+ schedule:
12
+ interval: weekly
@@ -2,15 +2,18 @@ name: Deploy Sphinx documentation to Pages
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [main, rye] # branch to trigger deployment
5
+ branches: [main] # branch to trigger deployment
6
6
 
7
7
  concurrency:
8
8
  group: "pages"
9
9
  cancel-in-progress: false
10
10
 
11
11
  jobs:
12
- build:
12
+ deploy:
13
13
  runs-on: ubuntu-latest
14
+ permissions:
15
+ pages: write
16
+ id-token: write
14
17
  steps:
15
18
  - name: Checkout
16
19
  uses: actions/checkout@v4
@@ -22,19 +25,6 @@ jobs:
22
25
  run: rye sync
23
26
  - name: Build Sphinx
24
27
  run: rye run sphinx-build docs/ docs/_build
25
-
26
- deploy:
27
- needs: build
28
- runs-on: ubuntu-latest
29
- permissions:
30
- pages: write
31
- id-token: write
32
- environment:
33
- name: github-pages
34
- url: ${{ steps.deployment.outputs.page_url }}
35
- steps:
36
- # - name: Setup Pages
37
- # uses: actions/configure-pages
38
28
  - name: Upload artifact
39
29
  uses: actions/upload-pages-artifact@v3
40
30
  with:
@@ -4,9 +4,16 @@ on:
4
4
  release:
5
5
  types: [created]
6
6
 
7
+
7
8
  jobs:
8
9
  deploy:
10
+ name: Upload release to PyPI
9
11
  runs-on: ubuntu-latest
12
+ environment:
13
+ name: pypi
14
+ url: https://pypi.org/p/plotly-extend-wrapper
15
+ permissions:
16
+ id-token: write
10
17
  steps:
11
18
  - uses: actions/checkout@v4
12
19
  - name: Install a specific version
@@ -19,7 +26,4 @@ jobs:
19
26
  run: rye build
20
27
  - name: Publish a Python distribution to PyPI
21
28
  if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
22
- uses: pypa/gh-action-pypi-publish@release/v1.8
23
- with:
24
- user: __token__
25
- password: ${{ secrets.PYPI_API_TOKEN }}
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -3,6 +3,8 @@ name: Unit test
3
3
  on:
4
4
  push:
5
5
  branches: [main]
6
+ pull_request:
7
+ branches: [main]
6
8
 
7
9
  jobs:
8
10
  Unit-test:
@@ -0,0 +1,10 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "-s",
4
+ "-v",
5
+ "--cov-report=xml",
6
+ "--cov=plotly_extend_wrapper"
7
+ ],
8
+ "python.testing.unittestEnabled": false,
9
+ "python.testing.pytestEnabled": true
10
+ }
@@ -1,14 +1,16 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: plotly-extend-wrapper
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Author-email: Laplusdestiny <prayonshootingstars@gmail.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.9
7
7
  Requires-Dist: kaleido==0.2.1
8
+ Requires-Dist: nbformat>=4.2.0
9
+ Requires-Dist: numpy>=1.24.0
8
10
  Requires-Dist: pandas>=2.0.0
9
- Requires-Dist: plotly>=5.15.0
11
+ Requires-Dist: plotly>=5.12.0
10
12
  Requires-Dist: pyarrow>=10.0.0
11
- Requires-Dist: scipy>=1.12.0
13
+ Requires-Dist: scipy>=1.8.0
12
14
  Description-Content-Type: text/markdown
13
15
 
14
16
  # plotly_extend_wrapper
@@ -29,6 +31,7 @@ You can make plot simply
29
31
  - Plotly >= 5.0.0
30
32
  - kaleido = 0.2.1
31
33
  - pandas >= 2.2.0
34
+ - scipy >= 1.12.0
32
35
 
33
36
  ## Graph
34
37
 
@@ -37,23 +40,7 @@ You can make plot simply
37
40
  - Bubble (`wrapper.Plot_bubble_chart`)
38
41
  - Line with secondary y-axis (`wrapper.Plot_line`)
39
42
  - Bubble with linear line (`wrapper.Plot_bubble_with_line`)
40
-
41
- ## Common function
42
-
43
- - updater
44
- - Add options
45
- - Available options
46
- - x-axis title
47
- - y-axis title
48
- - secondary_y-axis title
49
- - show legend
50
- - height
51
- - width
52
- - marker size
53
- - common
54
- - check_directory
55
- - Check directory with pathlib
56
- - Make directory if parent directory doesn't exist
43
+ - Surface (`wrapper.Plot_surface`)
57
44
 
58
45
 
59
46
  ## Issue
@@ -16,6 +16,7 @@ You can make plot simply
16
16
  - Plotly >= 5.0.0
17
17
  - kaleido = 0.2.1
18
18
  - pandas >= 2.2.0
19
+ - scipy >= 1.12.0
19
20
 
20
21
  ## Graph
21
22
 
@@ -24,23 +25,7 @@ You can make plot simply
24
25
  - Bubble (`wrapper.Plot_bubble_chart`)
25
26
  - Line with secondary y-axis (`wrapper.Plot_line`)
26
27
  - Bubble with linear line (`wrapper.Plot_bubble_with_line`)
27
-
28
- ## Common function
29
-
30
- - updater
31
- - Add options
32
- - Available options
33
- - x-axis title
34
- - y-axis title
35
- - secondary_y-axis title
36
- - show legend
37
- - height
38
- - width
39
- - marker size
40
- - common
41
- - check_directory
42
- - Check directory with pathlib
43
- - Make directory if parent directory doesn't exist
28
+ - Surface (`wrapper.Plot_surface`)
44
29
 
45
30
 
46
31
  ## Issue
@@ -9,6 +9,7 @@
9
9
  project = 'plotly-extend-wrapper'
10
10
  copyright = '2024, Laplusdestiny'
11
11
  author = 'Laplusdestiny'
12
+ version = "1.1.0"
12
13
 
13
14
  # -- General configuration ---------------------------------------------------
14
15
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -16,7 +17,7 @@ author = 'Laplusdestiny'
16
17
  extensions = ['myst_parser', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon']
17
18
 
18
19
  templates_path = ['_templates']
19
- exclude_patterns = []
20
+ # exclude_patterns = []
20
21
  source_suffix = {
21
22
  '.rst': 'restructuredtext',
22
23
  '.txt': 'markdown',
@@ -27,4 +28,4 @@ source_suffix = {
27
28
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
28
29
 
29
30
  html_theme = 'furo'
30
- html_static_path = ['_static']
31
+ # html_static_path = ['_static']
@@ -5,6 +5,7 @@ from plotly_extend_wrapper.common import check_directory
5
5
  from plotly import graph_objects as go
6
6
  from scipy.interpolate import griddata
7
7
  import numpy as np
8
+ from copy import deepcopy
8
9
 
9
10
 
10
11
  def Plot_pie(data: pd.DataFrame, target: str, **kwargs):
@@ -112,7 +113,8 @@ class Plot_bubble_chart:
112
113
  if len(grouper) == 0:
113
114
  return vc
114
115
  else:
115
- max_probs = vc.groupby(grouper)["count"].max().reset_index(name="max")
116
+ max_probs = vc.groupby(
117
+ grouper)["count"].max().reset_index(name="max")
116
118
  max_value = max_probs["max"].max()
117
119
  max_probs["ratio"] = max_value / max_probs["max"]
118
120
  smooth_dict = max_probs.set_index(grouper)["ratio"].to_dict()
@@ -125,7 +127,8 @@ class Plot_bubble_chart:
125
127
 
126
128
  def _value_counts(self):
127
129
  cols = [self.x, self.y]
128
- grouper = list(filter(None, [self.color, self.facet_col, self.facet_row]))
130
+ grouper = list(
131
+ filter(None, [self.color, self.facet_col, self.facet_row]))
129
132
  if len(grouper) == 0:
130
133
  vc = self.df.value_counts(
131
134
  subset=cols, normalize=self.normalize
@@ -156,13 +159,15 @@ class Plot_bubble_chart:
156
159
  )
157
160
 
158
161
  for col, decimal in zip(self.rounded, self.decimals):
159
- df.loc[:, f"{col}_rounded"] = df.loc[:, col].round(decimals=decimal)
162
+ df.loc[:, f"{col}_rounded"] = df.loc[:,
163
+ col].round(decimals=decimal)
160
164
  if self.x == col:
161
165
  self.x = f"{col}_rounded"
162
166
  elif self.y == col:
163
167
  self.y = f"{col}_rounded"
164
168
  else:
165
- raise ValueError(f"{col} is not indicated. Check parameters")
169
+ raise ValueError(
170
+ f"{col} is not indicated. Check parameters")
166
171
 
167
172
  return df
168
173
 
@@ -249,7 +254,8 @@ def Plot_line(
249
254
 
250
255
  plot_all_cols = pd.Series(y + secondary_y)
251
256
  if (~plot_all_cols.isin(df.columns)).any():
252
- not_include_cols = plot_all_cols[~plot_all_cols.isin(df.columns)].tolist()
257
+ not_include_cols = plot_all_cols[~plot_all_cols.isin(
258
+ df.columns)].tolist()
253
259
  raise ValueError(f"{not_include_cols} columns are not in dataframe")
254
260
 
255
261
  y = [c for c in y if c not in secondary_y]
@@ -262,7 +268,8 @@ def Plot_line(
262
268
 
263
269
  subfig = make_subplots(specs=[[{"secondary_y": True}]])
264
270
  fig = px.line(df, x=x, y=y, **px_kwargs)
265
- fig2 = px.line(df, x=x, y=secondary_y, line_dash_sequence=["dash"], **px_kwargs)
271
+ fig2 = px.line(df, x=x, y=secondary_y,
272
+ line_dash_sequence=["dash"], **px_kwargs)
266
273
  fig2.update_traces(yaxis="y2")
267
274
 
268
275
  subfig.add_traces(fig.data + fig2.data)
@@ -367,10 +374,14 @@ def Plot_bubble_chart_with_line(
367
374
  )
368
375
 
369
376
  subfig = make_subplots()
370
- subfig.add_traces(bubble_plot.data + line_plot.data)
371
- subfig.layout.xaxis.title = xtitle
372
- subfig.layout.yaxis.title = ytitle
373
- subfig.update_layout(**kwargs)
377
+ for trace in bubble_plot.data + line_plot.data:
378
+ subfig.add_trace(trace)
379
+ if xtitle is not None:
380
+ subfig.layout.xaxis.title = xtitle
381
+ if ytitle is not None:
382
+ subfig.layout.yaxis.title = ytitle
383
+ original_layout = deepcopy(bubble_plot.layout)
384
+ subfig.update_layout(original_layout, **kwargs)
374
385
  return subfig
375
386
 
376
387
 
@@ -391,7 +402,7 @@ def Plot_surface(
391
402
  xi = np.linspace(x.min(), x.max(), num)
392
403
  yi = np.linspace(y.min(), y.max(), num)
393
404
  xi, yi = np.meshgrid(xi, yi)
394
- zi = griddata((x,y), z, (xi.ravel(), yi.ravel()), method="cubic")
405
+ zi = griddata((x, y), z, (xi.ravel(), yi.ravel()), method="cubic")
395
406
  zi = zi.reshape(xi.shape)
396
407
  zi = np.nan_to_num(zi)
397
408
  return xi, yi, zi
@@ -402,13 +413,13 @@ def Plot_surface(
402
413
  Z = df[z].values
403
414
  X, Y, Z = smooth_df(X, Y, Z, smooth_point_num)
404
415
  else:
405
- pivot_df = pd.pivot_table(df, index=x, columns=y, values=z, fill_value=fill_value)
416
+ pivot_df = pd.pivot_table(
417
+ df, index=x, columns=y, values=z, fill_value=fill_value)
406
418
 
407
419
  X = pivot_df.columns.values
408
420
  Y = pivot_df.index.values
409
421
  Z = pivot_df.values
410
422
 
411
-
412
423
  data = [go.Surface(x=X, y=Y, z=Z)]
413
424
  layout = go.Layout(
414
425
  title=title,
@@ -1,15 +1,15 @@
1
1
  [project]
2
2
  name = "plotly-extend-wrapper"
3
- version = "1.1.0"
4
- authors = [
5
- { name = "Laplusdestiny", email = "prayonshootingstars@gmail.com" }
6
- ]
3
+ version = "1.2.0"
4
+ authors = [{ name = "Laplusdestiny", email = "prayonshootingstars@gmail.com" }]
7
5
  dependencies = [
8
- "plotly>=5.15.0",
6
+ "plotly>=5.12.0",
9
7
  "kaleido==0.2.1",
10
8
  "pyarrow>=10.0.0",
11
9
  "pandas>=2.0.0",
12
- "scipy>=1.12.0",
10
+ "scipy>=1.8.0",
11
+ "numpy>=1.24.0",
12
+ "nbformat>=4.2.0",
13
13
  ]
14
14
  readme = "README.md"
15
15
  requires-python = ">= 3.9"
@@ -14,6 +14,9 @@ alabaster==0.7.16
14
14
  # via sphinx
15
15
  asttokens==2.4.1
16
16
  # via stack-data
17
+ attrs==24.3.0
18
+ # via jsonschema
19
+ # via referencing
17
20
  babel==2.15.0
18
21
  # via sphinx
19
22
  backports-tarfile==1.2.0
@@ -46,6 +49,8 @@ exceptiongroup==1.2.2
46
49
  # via pytest
47
50
  executing==2.0.1
48
51
  # via stack-data
52
+ fastjsonschema==2.21.1
53
+ # via nbformat
49
54
  furo==2024.5.6
50
55
  idna==3.7
51
56
  # via requests
@@ -78,11 +83,16 @@ jinja2==3.1.4
78
83
  # via sphinx
79
84
  joblib==1.4.2
80
85
  # via scikit-learn
86
+ jsonschema==4.23.0
87
+ # via nbformat
88
+ jsonschema-specifications==2024.10.1
89
+ # via jsonschema
81
90
  jupyter-client==8.6.2
82
91
  # via ipykernel
83
92
  jupyter-core==5.7.2
84
93
  # via ipykernel
85
94
  # via jupyter-client
95
+ # via nbformat
86
96
  kaleido==0.2.1
87
97
  # via plotly-extend-wrapper
88
98
  keyring==25.2.1
@@ -104,22 +114,24 @@ more-itertools==10.3.0
104
114
  # via jaraco-classes
105
115
  # via jaraco-functools
106
116
  myst-parser==3.0.1
117
+ nbformat==5.10.4
118
+ # via plotly-extend-wrapper
107
119
  nest-asyncio==1.6.0
108
120
  # via ipykernel
109
121
  nh3==0.2.18
110
122
  # via readme-renderer
111
- numpy==2.0.0
123
+ numpy==1.24.0
112
124
  # via pandas
125
+ # via plotly-extend-wrapper
113
126
  # via pyarrow
114
127
  # via scikit-learn
115
128
  # via scipy
116
129
  packaging==24.1
117
130
  # via build
118
131
  # via ipykernel
119
- # via plotly
120
132
  # via pytest
121
133
  # via sphinx
122
- pandas==2.2.2
134
+ pandas==2.0.0
123
135
  # via plotly-extend-wrapper
124
136
  parso==0.8.4
125
137
  # via jedi
@@ -127,9 +139,9 @@ pexpect==4.9.0
127
139
  # via ipython
128
140
  pkginfo==1.10.0
129
141
  # via twine
130
- platformdirs==4.2.2
142
+ platformdirs==4.3.6
131
143
  # via jupyter-core
132
- plotly==5.22.0
144
+ plotly==5.12.0
133
145
  # via plotly-extend-wrapper
134
146
  pluggy==1.5.0
135
147
  # via pytest
@@ -141,7 +153,7 @@ ptyprocess==0.7.0
141
153
  # via pexpect
142
154
  pure-eval==0.2.2
143
155
  # via stack-data
144
- pyarrow==16.1.0
156
+ pyarrow==10.0.0
145
157
  # via plotly-extend-wrapper
146
158
  pycparser==2.22
147
159
  # via cffi
@@ -168,6 +180,9 @@ pyzmq==26.0.3
168
180
  # via jupyter-client
169
181
  readme-renderer==44.0
170
182
  # via twine
183
+ referencing==0.36.1
184
+ # via jsonschema
185
+ # via jsonschema-specifications
171
186
  requests==2.32.3
172
187
  # via requests-toolbelt
173
188
  # via sphinx
@@ -178,9 +193,12 @@ rfc3986==2.0.0
178
193
  # via twine
179
194
  rich==13.7.1
180
195
  # via twine
196
+ rpds-py==0.22.3
197
+ # via jsonschema
198
+ # via referencing
181
199
  ruff==0.5.1
182
200
  scikit-learn==1.5.1
183
- scipy==1.13.1
201
+ scipy==1.8.0
184
202
  # via plotly-extend-wrapper
185
203
  # via scikit-learn
186
204
  secretstorage==3.3.3
@@ -212,7 +230,7 @@ sphinxcontrib-serializinghtml==1.1.10
212
230
  # via sphinx
213
231
  stack-data==0.6.3
214
232
  # via ipython
215
- tenacity==8.5.0
233
+ tenacity==9.0.0
216
234
  # via plotly
217
235
  threadpoolctl==3.5.0
218
236
  # via scikit-learn
@@ -231,10 +249,12 @@ traitlets==5.14.3
231
249
  # via jupyter-client
232
250
  # via jupyter-core
233
251
  # via matplotlib-inline
252
+ # via nbformat
234
253
  twine==5.1.1
235
254
  typing-extensions==4.12.2
236
255
  # via ipython
237
- tzdata==2024.1
256
+ # via referencing
257
+ tzdata==2024.2
238
258
  # via pandas
239
259
  urllib3==2.2.2
240
260
  # via requests
@@ -0,0 +1,63 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ attrs==24.3.0
14
+ # via jsonschema
15
+ # via referencing
16
+ fastjsonschema==2.21.1
17
+ # via nbformat
18
+ jsonschema==4.23.0
19
+ # via nbformat
20
+ jsonschema-specifications==2024.10.1
21
+ # via jsonschema
22
+ jupyter-core==5.7.2
23
+ # via nbformat
24
+ kaleido==0.2.1
25
+ # via plotly-extend-wrapper
26
+ nbformat==5.10.4
27
+ # via plotly-extend-wrapper
28
+ numpy==1.24.0
29
+ # via pandas
30
+ # via plotly-extend-wrapper
31
+ # via pyarrow
32
+ # via scipy
33
+ pandas==2.0.0
34
+ # via plotly-extend-wrapper
35
+ platformdirs==4.3.6
36
+ # via jupyter-core
37
+ plotly==5.12.0
38
+ # via plotly-extend-wrapper
39
+ pyarrow==10.0.0
40
+ # via plotly-extend-wrapper
41
+ python-dateutil==2.9.0.post0
42
+ # via pandas
43
+ pytz==2024.1
44
+ # via pandas
45
+ referencing==0.36.1
46
+ # via jsonschema
47
+ # via jsonschema-specifications
48
+ rpds-py==0.22.3
49
+ # via jsonschema
50
+ # via referencing
51
+ scipy==1.8.0
52
+ # via plotly-extend-wrapper
53
+ six==1.16.0
54
+ # via python-dateutil
55
+ tenacity==9.0.0
56
+ # via plotly
57
+ traitlets==5.14.3
58
+ # via jupyter-core
59
+ # via nbformat
60
+ typing-extensions==4.12.2
61
+ # via referencing
62
+ tzdata==2024.2
63
+ # via pandas
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ from plotly_extend_wrapper.common import check_directory
4
+
5
+
6
+ def test_create_directory(tmp_path):
7
+ test_path = tmp_path / "test_dir/test_file.txt"
8
+ result = check_directory(test_path)
9
+ assert (tmp_path / "test_dir").is_dir()
10
+ assert result == test_path.resolve()
11
+
12
+
13
+ def test_existing_directory(tmp_path):
14
+ test_path = tmp_path / "existing_dir/test_file.txt"
15
+ (tmp_path / "existing_dir").mkdir(parents=True, exist_ok=True)
16
+ result = check_directory(test_path)
17
+ assert (tmp_path / "existing_dir").is_dir()
18
+ assert result == test_path.resolve()
19
+
20
+
21
+ def test_directory_path(tmp_path):
22
+ test_path = tmp_path / "new_dir"
23
+ result = check_directory(test_path)
24
+ assert test_path.is_dir()
25
+ assert result == test_path.resolve()
@@ -203,7 +203,8 @@ def test_Bubble_group():
203
203
  def test_Bubble_simple():
204
204
  data = MakeScattterData()
205
205
 
206
- bubble = Plot_bubble_chart(data, x="x", y="y", smoothing=True, normalize=True)
206
+ bubble = Plot_bubble_chart(
207
+ data, x="x", y="y", smoothing=True, normalize=True)
207
208
  new_plot = bubble()
208
209
 
209
210
  assert isinstance(new_plot, go.Figure)
@@ -296,7 +297,7 @@ def test_PlotSurface():
296
297
  x="sepal length (cm)",
297
298
  y="petal length (cm)",
298
299
  z="petal width (cm)"
299
- )
300
+ )
300
301
 
301
302
  assert isinstance(surface, go.Figure)
302
303
 
@@ -310,6 +311,6 @@ def test_PlotSurface_with_smoothing():
310
311
  y="petal length (cm)",
311
312
  z="petal width (cm)",
312
313
  smoothing=True
313
- )
314
+ )
314
315
 
315
- assert isinstance(surface, go.Figure)
316
+ assert isinstance(surface, go.Figure)
@@ -1,43 +0,0 @@
1
- FROM mcr.microsoft.com/devcontainers/base:jammy
2
-
3
- ARG DEBIAN_FRONTEND=noninteractive
4
- ARG USER=vscode
5
-
6
- RUN DEBIAN_FRONTEND=noninteractive \
7
- && apt-get update \
8
- && apt-get install -y build-essential --no-install-recommends make \
9
- ca-certificates \
10
- git \
11
- libssl-dev \
12
- zlib1g-dev \
13
- libbz2-dev \
14
- libreadline-dev \
15
- libsqlite3-dev \
16
- wget \
17
- curl \
18
- llvm \
19
- libncurses5-dev \
20
- xz-utils \
21
- tk-dev \
22
- libxml2-dev \
23
- libxmlsec1-dev \
24
- libffi-dev \
25
- liblzma-dev
26
-
27
- # Python and poetry installation
28
- USER $USER
29
- ARG HOME="/home/$USER"
30
- ARG PYTHON_VERSION=3.10
31
-
32
- ENV PYENV_ROOT="${HOME}/.pyenv"
33
- ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
34
-
35
- RUN echo "Installing pyenv" \
36
- && curl https://pyenv.run | bash \
37
- && echo "Installing Python" \
38
- && pyenv install ${PYTHON_VERSION} \
39
- && echo "Setting Python version" \
40
- && pyenv global ${PYTHON_VERSION} \
41
- && echo "Installing poetry" \
42
- && curl -sSL https://install.python-poetry.org | python3 - \
43
- && poetry config virtualenvs.in-project true
@@ -1,32 +0,0 @@
1
- {
2
- "name": "poetry3-poetry-pyenv",
3
- "build": {
4
- "dockerfile": "Dockerfile"
5
- },
6
-
7
- // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
8
- // "features": {},
9
-
10
- // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
11
- // "forwardPorts": [],
12
-
13
- // 👇 Use 'postCreateCommand' to run commands after the container is created.
14
- // "postCreateCommand": "",
15
-
16
- // 👇 Configure tool-specific properties.
17
- "customizations": {
18
- "vscode": {
19
- "extensions":[
20
- "ms-python.python",
21
- "njpwerner.autodocstring",
22
- "charliermarsh.ruff",
23
- ]
24
- }
25
- },
26
- "features": {
27
- "ghcr.io/devcontainers-contrib/features/live-server:1": {}
28
- }
29
-
30
- // 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31
- // "remoteUser": "root"
32
- }
@@ -1,38 +0,0 @@
1
- # generated by rye
2
- # use `rye lock` or `rye sync` to update this lockfile
3
- #
4
- # last locked with the following flags:
5
- # pre: false
6
- # features: []
7
- # all-features: false
8
- # with-sources: false
9
- # generate-hashes: false
10
- # universal: false
11
-
12
- -e file:.
13
- kaleido==0.2.1
14
- # via plotly-extend-wrapper
15
- numpy==2.0.0
16
- # via pandas
17
- # via pyarrow
18
- # via scipy
19
- packaging==24.1
20
- # via plotly
21
- pandas==2.2.2
22
- # via plotly-extend-wrapper
23
- plotly==5.22.0
24
- # via plotly-extend-wrapper
25
- pyarrow==16.1.0
26
- # via plotly-extend-wrapper
27
- python-dateutil==2.9.0.post0
28
- # via pandas
29
- pytz==2024.1
30
- # via pandas
31
- scipy==1.13.1
32
- # via plotly-extend-wrapper
33
- six==1.16.0
34
- # via python-dateutil
35
- tenacity==8.5.0
36
- # via plotly
37
- tzdata==2024.1
38
- # via pandas
@@ -1,15 +0,0 @@
1
- # encoding: utf-8
2
-
3
- from plotly_extend_wrapper import common
4
- import pytest
5
- from pathlib import Path
6
-
7
-
8
- @pytest.mark.parametrize("path", ["./test_dir/test.png", "./test_dir_only"])
9
- def testCheckDirectory(path):
10
- checked_path = common.check_directory(path)
11
-
12
- if checked_path.suffix == "":
13
- assert isinstance(checked_path, Path) and checked_path.is_dir()
14
- else:
15
- assert isinstance(checked_path, Path) and checked_path.parent.is_dir()