Skip to content

Commit

Permalink
FEAT: Improvements throughout ✏️
Browse files Browse the repository at this point in the history
  • Loading branch information
daquinteroflex committed Jan 2, 2024
1 parent a535435 commit 26751d9
Show file tree
Hide file tree
Showing 83 changed files with 4,513 additions and 821 deletions.
1 change: 0 additions & 1 deletion .github/workflows/sync-to-readthedocs-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- main
- latest
- 'pre/*'
- dario/quick_patches_pre/2.6
workflow_dispatch:
inputs:
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pip-log.txt

# Sphinx documentation
_docs
_autosummary

# Spyder project settings
.spyderproject
Expand Down
10 changes: 1 addition & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@ repos:
rev: "v0.1.5"
hooks:
- id: ruff
args: [ --fix ]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [ --exclude-file=poetry.lock ]
additional_dependencies:
- tomli
args: [ --fix ]
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,12 @@ which fields are to be projected is now determined automatically based on the me
### Added

- New `grid_spec` Field in `Simulation` that allows more flexibility in defining the mesh.
- `GridSpec1d` class defining how the meshing along each dimension should be done, with sublcasses `UniformGrid` and `CustomGrid` that cover the functionality
- `GridSpec1d` class defining how the meshing along each dimension should be done, with subclasses `UniformGrid` and `CustomGrid` that cover the functionality
previously offered by supplying a float or a list of floats to `Simulation.grid_size`. New functionality offered by `AutoGrid` subclass, with the
mesh automatically generated based on the minimum required steps per wavelength.
- New `PointDipole` source.
- Opacity kwargs for monitor and source in `sim.plot`.
- Separated `plotly`-based requirements from core requrements file, can be added with `"pip install tidy3d-beta[plotly]"`.
- Separated `plotly`-based requirements from core requirements file, can be added with `"pip install tidy3d-beta[plotly]"`.

### Changed
- `Simulation.grid_spec` uses the default `GridSpec`, which has `AutoGrid(min_steps_per_wvl=10)` in each direction. To initialize a `Simulation` then it is no
Expand Down Expand Up @@ -945,7 +945,7 @@ which fields are to be projected is now determined automatically based on the me
- PML parameters and padding Grid with pml pixels by [@momchil-flex](https://github.com/momchil-flex) in #64
- Documentation by [@tylerflex](https://github.com/tylerflex) in #63
- Gds import from [@tylerflex](https://github.com/tylerflex) in #69
- Loggin by [@tylerflex](https://github.com/tylerflex) in #70
- Login, by [@tylerflex](https://github.com/tylerflex) in #70
- Multi-pole Drude medium by [@weiliangjin2021](https://github.com/weiliangjin2021) in #73
- Mode Solver: from [@tylerflex](https://github.com/tylerflex) in #74
- Near2Far from [@tylerflex](https://github.com/tylerflex) in #77
Expand Down
6 changes: 6 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ iframe {width: 100%;border: unset}

.toctree-wrapper li[class^=toctree-l1]>a {font-size: 1.4em; text-decoration: none}
.toctree-wrapper li[class^=toctree-l2]>a {font-size: 1em; text-decoration: none}
.toctree-wrapper li[class^=toctree-l3]>a {font-size: 0.9em; text-decoration: none}
.toctree-wrapper li[class^=toctree-l4]>a {font-size: 0.9em; text-decoration: none}

html[data-theme="light"] {
--pst-color-primary: #b5445b;
Expand Down Expand Up @@ -79,6 +81,10 @@ img {
background-color: var(--sd-color-info-bg);
}

html[data-theme=dark] .dataframe {
background-color: var(--pst-color-primary);
}

/* TODO make sure this is only for the API tables */
/*table {*/
/* border: solid;*/
Expand Down
6 changes: 3 additions & 3 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
***
API
***
***************
API |:computer:|
***************

.. toctree::
:hidden:
Expand Down
7 changes: 4 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Changelog
=========
********************
Changelog |:rewind:|
********************

.. mdinclude:: ../../CHANGELOG.md
.. mdinclude:: ../CHANGELOG.md
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",
"nbsphinx", # Integrate Jupyter Notebooks and Sphinx
"m2r2",
# "sphinxcontrib.divparams", # TODO FIX
"sphinx.ext.autodoc", # Core Sphinx library for auto html doc generation from docstrings
"sphinx.ext.autosummary", # Create neat summary tables for modules/classes/methods etc
Expand Down
6 changes: 3 additions & 3 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*****************
Development Guide
*****************
********************************************************************
Development Guide |:hammer_and_wrench:|
********************************************************************

Welecome to the ``tidy3d`` developers guide! These are just some recommendations I've compiled, but we can change anything as we think might help the development cycle more.

Expand Down
2 changes: 1 addition & 1 deletion docs/development/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If you rather install ``poetry``, ``pipx`` and ``pandoc`` yourself, you can run
The Detailed Lane
^^^^^^^^^^^^^^^^^

If you do not have any of the above tools already installed and want to install them manually, let's go through the process of setting things up from scatch:
If you do not have any of the above tools already installed and want to install them manually, let's go through the process of setting things up from scratch:


Environment Requirements
Expand Down
4 changes: 4 additions & 0 deletions docs/development/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ There are a range of handy development functions that you might want to use to s
* - Dual snapshot between the ``tidy3d`` and ``notebooks`` source and submodule repository.
- 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.
- ``tidy3d develop commit <your message>``
* - Interactively convert all markdown files to rst (replacement for m2r2)
-
- ``poetry run tidy3d develop convert-all-markdown-to-rst``
* - Running ``pytest`` commands inside the ``poetry`` environment.
- Make sure you have already installed ``tidy3d`` in ``poetry`` and you are in the root directory.
- ``poetry run pytest``
Expand All @@ -70,3 +73,4 @@ There are a range of handy development functions that you might want to use to s
* - Update lockfile after updating a dependency in ``pyproject.toml``
- Remember to install after this command.
- ``poetry lock``

2 changes: 1 addition & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAQ
FAQ |:mag_right:|
==========================

What is Tidy3D?
Expand Down
14 changes: 7 additions & 7 deletions docs/howdoi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. _howdoi:

How do I ...
============
How do I ... |:eyes:|
========================


Work with the Tidy3d Package
Expand Down Expand Up @@ -48,7 +48,7 @@ Plot Tidy3D Components
* - Change the object plotting characteristics (facecolor, edgecolor, etc).
- Plotting keyword arguments can be supplied to ``plot()``, for example ``obj.plot(x=0, edgecolor='blue', fill=False)``. These keyword arguments correspond to those fed to `Matplotlib Patches <https://tinyurl.com/2nf5c2fk>`__.
* - Change the global plot characteristics (title, size, etc).
- The plotting function return a matplotlib ``Axes``, wihch can be manipulated, for example ``ax = obj.plot(x=0); ax.set_title('my_title')``.
- The plotting function return a matplotlib ``Axes``, which can be manipulated, for example ``ax = obj.plot(x=0); ax.set_title('my_title')``.

Create Geometries
-----------------
Expand All @@ -62,7 +62,7 @@ Create Geometries
* - Load a structure from GDS format?
- From a cell in the ``gdstk`` package, the ``ps = td.PolySlab.from_gds(gds_cell, ...)`` method will load the geometry into a :class:`PolySlab`.
* - Create a complex geometry, such as a ring?
- While many complex geometries can be created by supplying the vertices to :class:`PolySlab`, simple geometries, such as rings, can be constructed by overlaying two structures with :class:`Cylinder` geomety with the inner cylinder defined with medium of air. Note that structures later in the ``structures`` list will override previous structures, which can be leveraged to make more complex geometries.
- While many complex geometries can be created by supplying the vertices to :class:`PolySlab`, simple geometries, such as rings, can be constructed by overlaying two structures with :class:`Cylinder` geometry with the inner cylinder defined with medium of air. Note that structures later in the ``structures`` list will override previous structures, which can be leveraged to make more complex geometries.

Materials
---------
Expand Down Expand Up @@ -163,7 +163,7 @@ Submit Jobs to Server
* - Submit my simulation to run on Flexcompute's servers?
- ``sim_data = web.run(simulation, task_name='my_task', path='out/data.hdf5')`` or ``job = web.Job(simulation, task_name='my_task'); job.run(path='out/data.hdf5')``.
* - Upload a job to the web without running it so I can inspect it first?
- Once you've created a :class:`tidy3d.web.container.Job`, you can upload it to our servers with ``job.upload()`` and it will not run until you excplicitly tell it to with ``job.start()``.
- Once you've created a :class:`tidy3d.web.container.Job`, you can upload it to our servers with ``job.upload()`` and it will not run until you explicitly tell it to with ``job.start()``.
* - Monitor the progress of a simulation?
- ``web.monitor(task_id)``, ``job.monitor()``, or ``batch.monitor()`` will display the progress of your simulation(s).
* - Load the results of a simulation?
Expand All @@ -175,7 +175,7 @@ Submit Jobs to Server
* - Loop through :class:`tidy3d.web.container.BatchData` without loading all of the data into memory?
- ``for task_name, sim_data in batch_data.items():`` will give access to a :class:`SimulationData` instance for each :class:`tidy3d.web.container.Job` in the batch one by one, so you can perform your postprocessing in the loop body without loading each of the simulations' data into memory at once.
* - Save or load a :class:`tidy3d.web.container.Job` or :class:`tidy3d.web.container.Batch` so I can work with it later?
- Like most other tidy3d objects, :class:`tidy3d.web.container.Job` and :class:`tidy3d.web.container.Batch` instances have ``.to_file(path)`` and ``.from_file(path)`` methods that will export and load thier metadata as .json files. This is especially useful for loading batches for analysis long after they have run.
- Like most other tidy3d objects, :class:`tidy3d.web.container.Job` and :class:`tidy3d.web.container.Batch` instances have ``.to_file(path)`` and ``.from_file(path)`` methods that will export and load their metadata as .json files. This is especially useful for loading batches for analysis long after they have run.

Extensions
----------
Expand All @@ -190,7 +190,7 @@ Extensions
- Refer to the `Dispersion tutorial <notebooks/Fitting.html>`_ on the :class:`tidy3d.plugins.DispersionFitter` plugin.
* - Specify the modes for a :class:`ModeMonitor` or :class:`ModeSource`?
- Refer to the `Mode Solver tutorial <notebooks/ModeSolver.html>`_ on the :class:`tidy3d.plugins.ModeSolver` plugin.
* - Projet electromagnetic near field data to the far field?
* - Project electromagnetic near field data to the far field?
- Refer to the `FieldProjections tutorial <notebooks/FieldProjections.html>`_.
* - Compute scattering matrix parameters for modeling my device?
- Refer to the `S Matrix tutorial <notebooks/SMatrix.html>`_ on the :class:`tidy3d.plugins.ComponentModeler` plugin.
6 changes: 3 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*************************
Installation
Installation |:wave:|
*************************

Welcome to Tidy3D
Expand Down Expand Up @@ -113,14 +113,14 @@ and pasting the API key when prompted. Note that one can also specify the API ke
tidy3d configure --apikey=XXX
Note: Windows users will need to peform a slighlty different step to link the registration. From the anaconda prompt where tidy3d was pip installed, the following commands should be run instead
Note: Windows users will need to perform a slightly different step to link the registration. From the anaconda prompt where tidy3d was pip installed, the following commands should be run instead

.. code-block:: bash
pip install pipx
pipx run tidy3d configure --apikey=XXX
Alternatively, the API key can be set up using the evironment variable ``SIMCLOUD_APIKEY`` as:
Alternatively, the API key can be set up using the environment variable ``SIMCLOUD_APIKEY`` as:

.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions docs/lectures/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Lectures
#########
Lectures |:book:|
##################

Welcome to our lecture series!

Expand Down
2 changes: 1 addition & 1 deletion make_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(args):
# add the simulation body itself
sim_string += sim.__repr__()

# new we need to get rid of all the "type" info that isnt needed
# new we need to get rid of all the "type" info that isn't needed

# remove type='...', in middle
pattern = r"type='([A-Za-z0-9_\./\\-]*)', "
Expand Down
Loading

0 comments on commit 26751d9

Please sign in to comment.