Skip to content

Commit

Permalink
fix(docs): revert back to having a api.rst for better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hassec committed May 6, 2024
1 parent aff0ec0 commit 6fb0e6f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 71 deletions.
19 changes: 3 additions & 16 deletions cfspopcon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,29 @@
__version__ = metadata(__package__)["Version"]
__author__ = metadata(__package__)["Author"]

from . import file_io, formulas, helpers, named_options
from . import file_io, formulas, named_options
from .algorithm_class import Algorithm, CompositeAlgorithm
from .formulas.read_atomic_data import AtomicData
from .input_file_handling import read_case
from .plotting import read_plot_style
from .point_selection import find_coords_of_maximum, find_coords_of_minimum
from .unit_handling import (
Quantity,
Unit,
convert_to_default_units,
convert_units,
default_unit,
magnitude,
magnitude_in_default_units,
set_default_units,
ureg,
wraps_ufunc,
)

Algorithm.write_yaml()

# export main classes users should need as well as the option enums
__all__ = [
"helpers",
"named_options",
"formulas",
"ureg",
"Quantity",
"Unit",
"wraps_ufunc",
"named_options",
"magnitude_in_default_units",
"set_default_units",
"default_unit",
"convert_to_default_units",
"set_default_units",
"convert_units",
"magnitude",
"read_case",
"read_plot_style",
"find_coords_of_maximum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from ....algorithm_class import Algorithm
from ....named_options import MomentumLossFunction
from ....unit_handling import Unitfull
from .target_first_model import solve_target_first_two_point_model
from .model import solve_two_point_model
from .target_first_model import solve_target_first_two_point_model


@Algorithm.register_algorithm(
Expand Down
2 changes: 1 addition & 1 deletion cfspopcon/plotting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Plotting functionality."""
from .coordinate_formatter import CoordinateFormatter
from .plots import label_contour, make_plot, units_to_string
from .plot_style_handling import read_plot_style
from .plots import label_contour, make_plot, units_to_string

__all__ = [
"CoordinateFormatter",
Expand Down
1 change: 0 additions & 1 deletion cfspopcon/unit_handling/setup_unit_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pint
import pint_xarray # type:ignore[import-untyped]
import xarray as xr
from pint import DimensionalityError, UndefinedUnitError, UnitStrippedWarning
from typing_extensions import ParamSpec

ureg = pint_xarray.setup_registry(
Expand Down
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@
"sphinx_copybutton",
"sphinxcontrib.bibtex",
"nbsphinx",
"autoapi.extension",
]

autoapi_dirs = ["../cfspopcon"]
nitpick_ignore = [("py:class", "Ellipsis")]

# -- nbsphinx
Expand Down Expand Up @@ -226,7 +224,7 @@ def get_object_members(self, want_all: bool):
unitless_func = members.get("unitless_func", None)
if unitless_func is not None:
unitless_func.object.__doc__ = "A scalar and not unit aware version of the above function."
# the unitless function will get documented as a member of the FuncitionWrapper clas
# the unitless function will get documented as a member of the FuncitionWrapper class
# but sphinx pops the first argument because it thinks that's the "self" so we monkey patch around that
# by prepending a parameter that gets thrown away
tmp_param = Parameter("tmp", kind=Parameter.POSITIONAL_ONLY)
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_sources/dev_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This is because all calculations in cfspopcon use explicit unit handling to bett
The units handling cfspopcon is powered by the `pint <https://pint.readthedocs.io/en/stable/>`_ and `pint-xarray <https://github.com/xarray-contrib/pint-xarray>`_ python packages.
The type :class:`~cfspopcon.unit_handling.Unitfull`, used in the above function as type annotation, is an alias of :code:`pint.Quantity | xarray.DataArray`.

In addition to the above example, we also recommend having a look at the :mod:`~cfspopcon.formulas` module, which holds many good examples.
In addition to the above example, we also recommend having a look at the :code:`cfspopcon.formulas` module, which holds many good examples.


Pre-Commit Checks
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ If you are interested in how to setup a development environment to make changes
doc_sources/Usage
doc_sources/physics_glossary
doc_sources/dev_guide
doc_sources/api
doc_sources/bib
48 changes: 1 addition & 47 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ ipdb = "^0.13.13"
click = "^8.1.0"
netcdf4 = "^1.6.5"
radas = "^2024.3.1"
sphinx-autoapi = "^3.0.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "^2.20.0"
Expand Down

0 comments on commit 6fb0e6f

Please sign in to comment.