Using the Development Flow#
Developing tidy3d
with poetry
#
poetry is an incredibly powerful tool for reproducible package development environments and dependency management.
If you are developing tidy3d
, we recommend you work within the configured poetry
environment defined by poetry.lock
. The way to install this environment is simple:
cd tidy3d/
poetry install -E dev
This function will install the package with all the development dependencies automatically. This means you should be able to run any functionality that is possible with tidy3d
reproducibly.
It is important to note the function above is equivalent to pip install tidy3d[dev]
, but by using poetry
there is a guarantee of using the reproducible locked environment.
poetry
with an external virtual environment#
It is recommended to use poetry
for package development. However, there are some cases where you might need to use an external virtual environment for some operations. There are a few workarounds where you can leverage the reproducibility of the poetry
managed environment with the freedom of a standard virtual environment. There are a few more instructions and explanations in the poetry env docs . F See the following example:
mamba create -n tidy3denv python==3.10 # create venv with mamba
mamba activate tidy3denv # activate the venv
poetry env use python # using the mamba venv python now
poetry env info # verify the venvs used by poetry and mamba
cd anywhere
# you can use the python activated venv anywhere.
There are also other methodologies of implementing common dependencies management.
Common Utilities#
There are a range of handy development functions that you might want to use to streamline your development experience.
Description |
Caveats |
Command |
---|---|---|
Benchmark timing import of |
Verify the available timing tests by running the command without any arguments. |
|
Build documentation on reproducible environment |
|
|
Build documentation with latest remote notebooks |
It is defaulted to the |
|
Complete notebooks + base testing of the |
Make sure you have the notebooks downloaded. |
|
Dual snapshot between the |
Make sure you are on the correct git branches you wish to commit to on both repositories, and all non-git-ignored files will be added to the commit. |
|
Interactively convert all markdown files to rst (replacement for m2r2) |
|
|
Running |
Make sure you have already installed |
|
Run |
|
|
Standard testing of the |
Make sure you have already installed |
|
Using |
Make sure you have already installed |
|
Update lockfile after updating a dependency in |
Remember to install after this command. |
|
Update and replace all the docstrings in the codebase between versions |
|