-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from phaseportrait/release/1.2.0
Release/1.2.0
- Loading branch information
Showing
63 changed files
with
1,375 additions
and
1,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: PyPi and Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy-pypi: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
token: ${{ github.token }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish package to PyPi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_url: https://upload.pypi.org/legacy/ | ||
|
||
|
||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
token: ${{ github.token }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
python -m pip install --upgrade pip | ||
pip install build | ||
pip install mkdocs | ||
pip install mkdocstrings[python]>=0.18 | ||
pip install mkdocs-gen-files | ||
pip install mkdocs-material | ||
pip install mkdocs-literate-nav | ||
pip install Pygments>=2.12 | ||
- name: Build documentation | ||
run: | | ||
python3 docs/generate_reference_docs.py | ||
mkdocs build | ||
- name: Update github-pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
include README_no_imgs.md | ||
include README.md | ||
recursive-include docs * | ||
recursive-include examples * | ||
include setup.cfg | ||
include setup.py | ||
|
||
graft phaseportrait/* | ||
graft examples/* | ||
|
||
prune */__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
* reference | ||
* phaseportrait | ||
* [Cobweb](reference/phaseportrait/Cobweb.md) | ||
* [Map1D](reference/phaseportrait/Map1D.md) | ||
* [PhasePortrait2D](reference/phaseportrait/PhasePortrait2D.md) | ||
* [PhasePortrait3D](reference/phaseportrait/PhasePortrait3D.md) | ||
* [PhasePortraitManager](reference/phaseportrait/PhasePortraitManager.md) | ||
* [Trajectories2D](reference/phaseportrait/Trajectories2D.md) | ||
* [Trajectories3D](reference/phaseportrait/Trajectories3D.md) | ||
* exceptions | ||
* [exceptions](reference/phaseportrait/exceptions/exceptions.md) | ||
* generators_base | ||
* [generator_base](reference/phaseportrait/generators_base/generator_base.md) | ||
* maps | ||
* [map](reference/phaseportrait/maps/map.md) | ||
* nullclines | ||
* [nullclines](reference/phaseportrait/nullclines/nullclines.md) | ||
* sliders | ||
* [sliders](reference/phaseportrait/sliders/sliders.md) | ||
* streamlines | ||
* [size_gradient](reference/phaseportrait/streamlines/size_gradient.md) | ||
* [streamlines_base](reference/phaseportrait/streamlines/streamlines_base.md) | ||
* [velocity_color_gradient](reference/phaseportrait/streamlines/velocity_color_gradient.md) | ||
* trajectories | ||
* [rungekutta](reference/phaseportrait/trajectories/rungekutta.md) | ||
* [trajectory](reference/phaseportrait/trajectories/trajectory.md) | ||
* utils | ||
* [manager](reference/phaseportrait/utils/manager.md) | ||
* [utils](reference/phaseportrait/utils/utils.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright 2023 Unai Lería Fortea & Pablo Vizcaíno García | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Generate the code reference pages and navigation. Ty mkdocstrings""" | ||
|
||
from pathlib import Path | ||
|
||
import mkdocs_gen_files | ||
|
||
nav = mkdocs_gen_files.Nav() | ||
|
||
LICENSE = """<!-- Copyright 2023 PhasePortriat | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. --> | ||
""" | ||
|
||
# import shutil | ||
|
||
# shutil.copy("README.md", "docs/index.md") | ||
# shutil.copy("LICENSE", "docs/LICENSE.md") | ||
|
||
for path in sorted(Path("phaseportrait").rglob("*.py")): | ||
module_path = path.with_suffix("") | ||
doc_path = path.with_suffix(".md") | ||
full_doc_path = Path("reference", doc_path) | ||
|
||
parts = tuple(module_path.parts) | ||
|
||
if parts[-1] == "__init__": | ||
continue | ||
parts = parts[:-1] | ||
doc_path = doc_path.with_name("index.md") | ||
full_doc_path = full_doc_path.with_name("index.md") | ||
elif parts[-1] == "__main__": | ||
continue | ||
|
||
nav[("reference", *parts)] = full_doc_path.as_posix() | ||
|
||
with mkdocs_gen_files.open(full_doc_path, "w") as fd: | ||
ident = ".".join(parts) | ||
fd.write(LICENSE) | ||
fd.write(f":::{ident}") | ||
|
||
mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path) | ||
|
||
|
||
for path in sorted(list(Path("examples").rglob("*.md"))): | ||
example_name = path.with_suffix("") | ||
doc_path = path.with_suffix(".md") | ||
full_doc_path = Path(doc_path) | ||
|
||
parts = tuple(example_name.parts) | ||
|
||
nav[("examples", *parts)] = full_doc_path.as_posix() | ||
|
||
with mkdocs_gen_files.open(full_doc_path, "w") as fd: | ||
ident = ".".join(parts) | ||
fd.write(''.join([line for line in open(path, 'r').readlines()])) | ||
|
||
mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path) | ||
|
||
with mkdocs_gen_files.open("SUMMARY.md", "w") as nav_file: | ||
nav_file.writelines(nav.build_literate_nav()) | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.