Skip to content

Commit

Permalink
Merge pull request #83 from pmav99/master
Browse files Browse the repository at this point in the history
Add plot functions
  • Loading branch information
pmav99 authored Oct 5, 2023
2 parents dc48db5 + 188965b commit 1acf3ed
Show file tree
Hide file tree
Showing 17 changed files with 972 additions and 1,026 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements/*') }}
- uses: actions/cache@main
id: cache-netcdfs
with:
path: |
notebooks/schout_adcirc_20230828.nc
notebooks/schout_adcirc_20230829.nc
notebooks/schout_adcirc_20230830.nc
key: test-stofs-3d-atl-netcdf-files
- run: python --version
- run: python -m pip install --upgrade pip
- run: python -m pip --version
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
- id: "python-use-type-annotations"

- repo: "https://github.com/asottile/reorder_python_imports"
rev: "v3.11.0"
rev: "v3.12.0"
hooks:
- id: "reorder-python-imports"
args:
Expand All @@ -48,7 +48,7 @@ repos:

- repo: "https://github.com/charliermarsh/ruff-pre-commit"
# Ruff version.
rev: 'v0.0.291'
rev: 'v0.0.292'
hooks:
- id: "ruff"

Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ clean_notebooks:
pre-commit run nbstripout

exec_notebooks:
python -m nbconvert --to notebook --execute --stdout notebooks/* >/dev/null
set -e; \
for file in $$(git -C notebooks ls-files); do \
echo $$file; \
timeout 600 papermill --start-timeout 1 --cwd notebooks notebooks/$$file --progress-bar /dev/null; \
done

deps:
pre-commit run poetry-lock -a
pre-commit run poetry-export -a

docs:
mkdocs serve
4 changes: 3 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Reference

::: thalassa.api
::: thalassa

<!-- ::: thalassa.api -->

<!-- ::: thalassa.utils -->
<!---->
Expand Down
116 changes: 100 additions & 16 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,110 @@ watch:

plugins:
- "search"
- "autorefs"
- "mkdocstrings":
default_handler: python
handlers:
python:
options:
# General
allow_inspection: true
show_source: false
# Headings
show_root_toc_entry: true
show_root_full_path: true
show_object_full_path: true
show_root_members_full_path: true
# members
members_order: "source"
### General
# Whether to allow inspecting modules when visiting them is not possible. Default: True.
allow_inspection: True
# Show the base classes of a class. Default: True.
show_bases: True
# Show the source code of this object. Default: True.
show_source: True
# Pre-load modules that are not specified directly in autodoc instructions (::: identifier). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.
# For an imported member to be rendered, you need to add it to the __all__ attribute of the importing module.
# The modules must be listed as an array of strings. Default: None.
preload_modules: null

annotations_path: "brief"
show_signature: true
show_signature_annotations: true
separate_signature: true
### Headings
# The initial heading level to use. Default: 2.
heading_level: 2
# Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::). Default: False.
show_root_heading: True
# If the root heading is not shown, at least add a ToC entry for it. Default: True.
show_root_toc_entry: True
# Show the full Python path for the root object heading. Default: True.
show_root_full_path: True
# Show the full Python path of the root members. Default: False.
show_root_members_full_path: False
# Show the full Python path of every object. Default: False.
show_object_full_path: False
# When grouped by categories, show a heading for each category. Default: False.
show_category_heading: False
# Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False.
show_symbol_type_heading: False
# Show the symbol type in the Table of Contents (e.g. mod, class, methd, func and attr). Default: False
show_symbol_type_toc: False

### Members
# A boolean, or an explicit list of inherited members to render. If true, select all inherited members, which can then be filtered with members. If false or empty list, do not select any inherited member. Default: False.
inherited_members: False
# A boolean, or an explicit list of members to render. If true, select all members without further filtering. If false or empty list, do not render members. If none, select all members and apply further filtering with filters and docstrings. Default: None.
members: null
# The members ordering to use. Options: alphabetical - order by the members names, source - order members as they appear in the source file. Default: "alphabetical".
members_order: "alphabetical"
# A list of filters applied to filter objects based on their name. A filter starting with ! will exclude matching objects instead of including them. The members option takes precedence over filters (filters will still be applied recursively to lower members in the hierarchy). Default: ["!^_[^_]"].
filters: ["!^_[^_]"]
# Group the object's children by categories: attributes, classes, functions, and modules. Default: True.
group_by_category: True
# When rendering a module, show its submodules recursively. Default: False.
show_submodules: False
# Whether to render summaries of modules, classes, functions (methods) and attributes.
summary: True

### Docstrings
# The docstring style to use: google, numpy, sphinx, or None. Default: "google".
docstring_style: "google"
# The options for the docstring parser. See parsers under griffe.docstrings.
# docstring_options:
# The style used to render docstring sections. Options: table, list, spacy. Default: "table".
docstring_section_style: "spacy"
# Whether to merge the __init__ method into the class' signature and docstring. Default: False.
merge_init_into_class: False
# Show the object heading even if it has no docstring or children with docstrings. Default: False.
show_if_no_docstring: False
# Whether to display the "Attributes" section in the object's docstring. Default: True.
show_docstring_attributes: True
# Whether to display the "Functions" or "Methods" sections in the object's docstring. Default: True.
show_docstring_functions: True
# Whether to display the "Classes" section in the object's docstring. Default: True.
show_docstring_classes: True
# Whether to display the "Modules" section in the object's docstring. Default: True.
show_docstring_modules: True
# Whether to display the textual block (including admonitions) in the object's docstring. Default: True.
show_docstring_description: True
# Whether to display the "Examples" section in the object's docstring. Default: True.
show_docstring_examples: True
# Whether to display the "Other Parameters" section in the object's docstring. Default: True.
show_docstring_other_parameters: True
# Whether to display the "Parameters" section in the object's docstring. Default: True.
show_docstring_parameters: True
# Whether to display the "Raises" section in the object's docstring. Default: True.
show_docstring_raises: True
# Whether to display the "Receives" section in the object's docstring. Default: True.
show_docstring_receives: True
# Whether to display the "Returns" section in the object's docstring. Default: True.
show_docstring_returns: True
# Whether to display the "Warns" section in the object's docstring. Default: True.
show_docstring_warns: True
# Whether to display the "Yields" section in the object's docstring. Default: True.
show_docstring_yields: True

### Signature/annotations
# The verbosity for annotations path: brief (recommended), or source (as written in the source). Default: "brief".
annotations_path: "full"
# Maximum line length when formatting code/signatures. Default: 60.
line_length: 88
signature_crossrefs: true
show_root_heading: true
# Show methods and functions signatures. Default: True.
show_signature: True
# Show the type annotations in methods and functions signatures. Default: False.
show_signature_annotations: True
# Whether to render cross-references for type annotations in signatures. Default: False.
signature_crossrefs: True
# Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. Default: False.
separate_signature: True
# Whether to unwrap Annotated types to show only the type without the annotations. Default: False.
unwrap_annotated: True
2 changes: 1 addition & 1 deletion notebooks/API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"\n",
"# The trimesh is the most basic object. This is what you need to create all the others graphs\n",
"# It is on this object that you specify the timestamp and/or the layer.\n",
"trimesh = api.create_trimesh(ds=ds.sel(time=timestamp), variable=variable)\n",
"trimesh = api.create_trimesh(ds.sel(time=timestamp), variable=variable)\n",
"\n",
"# The wireframe is the representation of the mesh\n",
"wireframe = api.get_wireframe(trimesh)\n",
Expand Down
Loading

0 comments on commit 1acf3ed

Please sign in to comment.