Skip to content
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
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include requirements.txt
include requirements.txt
include requirements/core.txt
include requirements/plotly.txt
include requirements/dev.txt
20 changes: 1 addition & 19 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
# required for running tidy3d (note xarray)
xarray
scipy
h5py>=3.0.0
rich
nlopt
matplotlib
shapely==1.7.1
descartes
pydantic>=1.9.0
PyYAML
boto3
requests
plotly==5.5.0
dash
jupyter_dash

# required to get xarray to not complain
dask
-r requirements/core.txt
15 changes: 15 additions & 0 deletions requirements/core.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# just core (no plotly, no tests)

xarray
scipy
h5py>=3.0.0
rich
nlopt
matplotlib
shapely==1.7.1
descartes
pydantic>=1.9.0
PyYAML
boto3
requests
dask
5 changes: 5 additions & 0 deletions tests/requirements.txt → requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# core, plotly and tests

-r core.txt
-r plotly.txt

# required for development
click==8.0.3
black==22.1.0
Expand Down
6 changes: 6 additions & 0 deletions requirements/plotly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# core + plotly plotting, no tests
-r core.txt

plotly==5.5.0
dash
jupyter_dash
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

with open("requirements.txt") as f:
required = f.read().splitlines()
with open("requirements/core.txt") as f:
core_required = f.read().splitlines()

with open("requirements/plotly.txt") as f:
plotly_required = f.read().splitlines()
plotly_required = [req for req in plotly_required if "-r" not in req]

setuptools.setup(
name=PIP_NAME,
Expand All @@ -36,9 +40,8 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
# package_dir={"": ""},
# packages=[PACKAGE_NAME],
packages=setuptools.find_packages(),
python_requires=">=3.6",
install_requires=required,
install_requires=core_required,
extras_require={"plotly": plotly_required},
)
4 changes: 4 additions & 0 deletions tidy3d/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class DataError(Tidy3dError):
"""Error accessing data."""


class Tidy3dImportError(Tidy3dError):
"""Error importing a package needed for tidy3d."""


""" Logging functions """


Expand Down
2 changes: 0 additions & 2 deletions tidy3d/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
from .mode.mode_solver import ModeSolver, ModeSolverData
from .near2far.near2far import Near2Far, Near2FarSurface
from .smatrix.smatrix import ComponentModeler, Port
from .webplots.app import SimulationDataApp
from .webplots.simulation import SimulationPlotly
19 changes: 19 additions & 0 deletions tidy3d/plugins/webplots/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Import post run visualization app and Simulation plotting through plotly."""

from ...log import Tidy3dImportError

# try to get the plotly packages, otherwise print a helpful error message.
try:
from jupyter_dash import JupyterDash
from dash import Dash
import plotly.graph_objects as go
except ImportError as e:
raise Tidy3dImportError(
"Could not import plotly requirements. "
"Ensure that tidy3d is installed with [plotly] requirements specified. "
'``pip install "tidy3d-beta[plotly]" or `pip install -e ".[plotly]". '
"Or, install the dependencies directly with `pip install -r requirements/plotly.txt`"
) from e

from .app import SimulationDataApp
from .simulation import SimulationPlotly
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ python =

[testenv]
deps =
-rrequirements.txt
-rtests/requirements.txt
-rrequirements/core.txt
-rrequirements/plotly.txt
-rrequirements/dev.txt
commands =
pip install requests
black --check --diff . --line-length 100
Expand Down