From 61d178852d5967a3a49f0a79dfeaba41de950d5e Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 11:46:29 -0700 Subject: [PATCH 01/36] testing autosum --- docs/source/api.rst | 152 ++++++++++---------------------------------- 1 file changed, 33 insertions(+), 119 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index d33d8886..470b220b 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,120 +1,34 @@ -=== -API -=== -Acceleration ---------------- - -.. automodule:: ssapy.accel - :members: - - -Body ---------------- - -.. automodule:: ssapy.body - :members: - - -Compute ---------------- - -.. automodule:: ssapy.compute - :members: - - -Constants ---------------- - -.. automodule:: ssapy.constants - :members: - - -Correlate Tracks ----------------- - -.. automodule:: ssapy.correlate_tracks - :members: - -Ellipsoid ---------------- - -.. automodule:: ssapy.ellipsoid - :members: - - -Gravity ---------------- - -.. automodule:: ssapy.gravity - :members: - - -Io ---------------- - -.. automodule:: ssapy.io - :members: - - -Linker ---------------- - -.. automodule:: ssapy.linker - :members: - - -Orbit Solver ---------------- - -.. automodule:: ssapy.orbit_solver - :members: - - -Orbit ---------------- - -.. automodule:: ssapy.orbit - :members: - - -Particles ---------------- - -.. automodule:: ssapy.particles - :members: - - -Plot Utilities ---------------- - -.. automodule:: ssapy.plotUtils - :members: - - -Propagator ---------------- - -.. automodule:: ssapy.propagator - :members: - - -Position and Velocity Sampler ------------------------------- - -.. automodule:: ssapy.rvsampler - :members: - - -Simple ---------------- - -.. automodule:: ssapy.simple - :members: - - -Utilities ---------------- - -.. automodule:: ssapy.utils - :members: \ No newline at end of file +API Reference Guide +******************* +SSAPy: Space Situational Awareness for Python + +When executing + + >>> import SSAPy + +a subset of the full SSAPy package is imported into the python environment. +Some packages must be imported explicitly, so as to avoid importing unnecessary +and/or heavy dependencies. Below lists the packages available in the ``ssapy`` namespace. + + .. autosummary:: + :toctree: _autosummary + :recursive: + + ssapy.accel + ssapy.body + ssapy.compute + ssapy.constants + ssapy.correlate_tracks + ssapy.ellipsoid + ssapy.gravity + ssapy.io + ssapy.linker + ssapy.orbit_solver + ssapy.orbit + ssapy.particles + ssapy.plotUtils + ssapy.propagator + ssapy.rvsampler + ssapy.simple + ssapy.utils \ No newline at end of file From 4a867e6d301a1342d25c50026ac922302f4dfff1 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:01:19 -0700 Subject: [PATCH 02/36] testing automodule --- docs/source/api.rst | 88 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 470b220b..7620c13d 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -31,4 +31,90 @@ and/or heavy dependencies. Below lists the packages available in the ``ssapy`` ssapy.propagator ssapy.rvsampler ssapy.simple - ssapy.utils \ No newline at end of file + ssapy.utils + + + .. automodule:: ssapy.accel + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.body + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.compute + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.constants + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.correlate_tracks + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.ellipsoid + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.gravity + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.io + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.linker + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.orbit_solver + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.orbit + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.particles + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.plotUtils + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.propagator + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.rvsampler + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.simple + :members: + :undoc-members: + :show-inheritance: + + .. automodule:: ssapy.utils + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file From bf6f5450e72c5fa5726549ca2e92159234c3b638 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:08:46 -0700 Subject: [PATCH 03/36] testing template --- docs/source/api.rst | 86 +-------------------------------- docs/source/module_template.rst | 75 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 85 deletions(-) create mode 100644 docs/source/module_template.rst diff --git a/docs/source/api.rst b/docs/source/api.rst index 7620c13d..f5177678 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -13,6 +13,7 @@ and/or heavy dependencies. Below lists the packages available in the ``ssapy`` .. autosummary:: :toctree: _autosummary + :template: module-template.rst :recursive: ssapy.accel @@ -33,88 +34,3 @@ and/or heavy dependencies. Below lists the packages available in the ``ssapy`` ssapy.simple ssapy.utils - - .. automodule:: ssapy.accel - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.body - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.compute - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.constants - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.correlate_tracks - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.ellipsoid - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.gravity - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.io - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.linker - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.orbit_solver - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.orbit - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.particles - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.plotUtils - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.propagator - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.rvsampler - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.simple - :members: - :undoc-members: - :show-inheritance: - - .. automodule:: ssapy.utils - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/source/module_template.rst b/docs/source/module_template.rst new file mode 100644 index 00000000..13238001 --- /dev/null +++ b/docs/source/module_template.rst @@ -0,0 +1,75 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: Module Attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block inheritance %} + {% if classes %} + + .. inheritance-diagram:: {{ fullname }} + :caption: Inheritance Relationship + :parts: -1 + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. rubric:: Modules + +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} \ No newline at end of file From a308409e2f2bd759518acc88d0e0b029a0d36154 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:14:31 -0700 Subject: [PATCH 04/36] fixing templates --- docs/source/class_template.rst | 33 +++++++++++++++++++++++++++++++++ docs/source/module_template.rst | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 docs/source/class_template.rst diff --git a/docs/source/class_template.rst b/docs/source/class_template.rst new file mode 100644 index 00000000..d2718c5f --- /dev/null +++ b/docs/source/class_template.rst @@ -0,0 +1,33 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :private-members: + :undoc-members: + + {% block methods %} + .. automethod:: __init__ + + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/source/module_template.rst b/docs/source/module_template.rst index 13238001..d2a11713 100644 --- a/docs/source/module_template.rst +++ b/docs/source/module_template.rst @@ -20,7 +20,7 @@ .. autosummary:: :toctree: - :template: custom-class-template.rst + :template: class_template.rst {% for item in classes %} {{ item }} {%- endfor %} @@ -66,7 +66,7 @@ .. autosummary:: :toctree: - :template: custom-module-template.rst + :template: module_template.rst :recursive: {% for item in modules %} {{ item }} From 05e3196c7d870f75e8973bae56e9828e858be5ef Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:15:22 -0700 Subject: [PATCH 05/36] fixing api --- docs/source/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index f5177678..62733253 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -13,7 +13,7 @@ and/or heavy dependencies. Below lists the packages available in the ``ssapy`` .. autosummary:: :toctree: _autosummary - :template: module-template.rst + :template: module_template.rst :recursive: ssapy.accel From a60271775809dab14b7777cf5ee9239493555826 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:21:49 -0700 Subject: [PATCH 06/36] module test --- docs/source/module_template.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/module_template.rst b/docs/source/module_template.rst index d2a11713..0a5f05e0 100644 --- a/docs/source/module_template.rst +++ b/docs/source/module_template.rst @@ -1,6 +1,6 @@ {{ fullname | escape | underline}} -.. automodule:: {{ fullname }} +.. automodule:: ssapy.{{ fullname }} {% block attributes %} {% if attributes %} From bbc50f5510b71e71af2c5366fa7941f5eeb1891d Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:32:28 -0700 Subject: [PATCH 07/36] module test again --- docs/source/module_template.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/module_template.rst b/docs/source/module_template.rst index 0a5f05e0..15538242 100644 --- a/docs/source/module_template.rst +++ b/docs/source/module_template.rst @@ -1,6 +1,6 @@ {{ fullname | escape | underline}} -.. automodule:: ssapy.{{ fullname }} +.. automodule:: {{ ssapy.fullname }} {% block attributes %} {% if attributes %} From 5e642575bf4d28c8f318f52e0fe45d594e2c42ce Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:37:42 -0700 Subject: [PATCH 08/36] api test --- docs/source/api.rst | 27 +++++---------------------- docs/source/module_template.rst | 2 +- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 62733253..e133d1f8 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -11,26 +11,9 @@ a subset of the full SSAPy package is imported into the python environment. Some packages must be imported explicitly, so as to avoid importing unnecessary and/or heavy dependencies. Below lists the packages available in the ``ssapy`` namespace. - .. autosummary:: - :toctree: _autosummary - :template: module_template.rst - :recursive: - - ssapy.accel - ssapy.body - ssapy.compute - ssapy.constants - ssapy.correlate_tracks - ssapy.ellipsoid - ssapy.gravity - ssapy.io - ssapy.linker - ssapy.orbit_solver - ssapy.orbit - ssapy.particles - ssapy.plotUtils - ssapy.propagator - ssapy.rvsampler - ssapy.simple - ssapy.utils +.. autosummary:: + :toctree: _autosummary + :template: module_template.rst + :recursive: + ssapy diff --git a/docs/source/module_template.rst b/docs/source/module_template.rst index 15538242..d2a11713 100644 --- a/docs/source/module_template.rst +++ b/docs/source/module_template.rst @@ -1,6 +1,6 @@ {{ fullname | escape | underline}} -.. automodule:: {{ ssapy.fullname }} +.. automodule:: {{ fullname }} {% block attributes %} {% if attributes %} From 222d9c406b379859e95666b0d87a9c6c2da562c7 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 11 Apr 2025 13:47:48 -0700 Subject: [PATCH 09/36] edits --- .../{ => _templates}/class_template.rst | 0 .../{ => _templates}/module_template.rst | 0 docs/source/api.rst | 27 ++++++++++++++----- docs/source/conf.py | 12 +++++++++ 4 files changed, 33 insertions(+), 6 deletions(-) rename docs/source/{ => _templates}/class_template.rst (100%) rename docs/source/{ => _templates}/module_template.rst (100%) diff --git a/docs/source/class_template.rst b/docs/source/_templates/class_template.rst similarity index 100% rename from docs/source/class_template.rst rename to docs/source/_templates/class_template.rst diff --git a/docs/source/module_template.rst b/docs/source/_templates/module_template.rst similarity index 100% rename from docs/source/module_template.rst rename to docs/source/_templates/module_template.rst diff --git a/docs/source/api.rst b/docs/source/api.rst index e133d1f8..ab3e90ac 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,4 +1,3 @@ - API Reference Guide ******************* SSAPy: Space Situational Awareness for Python @@ -11,9 +10,25 @@ a subset of the full SSAPy package is imported into the python environment. Some packages must be imported explicitly, so as to avoid importing unnecessary and/or heavy dependencies. Below lists the packages available in the ``ssapy`` namespace. -.. autosummary:: - :toctree: _autosummary - :template: module_template.rst - :recursive: + .. autosummary:: + :toctree: _autosummary + :template: module_template.rst + :recursive: - ssapy + ssapy.accel + ssapy.body + ssapy.compute + ssapy.constants + ssapy.correlate_tracks + ssapy.ellipsoid + ssapy.gravity + ssapy.io + ssapy.linker + ssapy.orbit_solver + ssapy.orbit + ssapy.particles + ssapy.plotUtils + ssapy.propagator + ssapy.rvsampler + ssapy.simple + ssapy.utils diff --git a/docs/source/conf.py b/docs/source/conf.py index de29c4d0..0ac25409 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,8 +30,19 @@ 'sphinxcontrib.bibtex', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', + 'sphinx.ext.duration', + 'sphinx.ext.doctest', + 'sphinx.ext.inheritance_diagram', + 'sphinx.ext.autosectionlabel', ] +source_suffix = { + '.rst': 'restructuredtext', + '.txt': 'markdown', + '.md': 'markdown', +} + + def linkcode_resolve(domain, info): if domain != 'py': return None @@ -42,6 +53,7 @@ def linkcode_resolve(domain, info): autosummary_generate = True numpydoc_show_class_members = False +autodoc_member_order = 'bysource' sphinx_tabs_valid_builders = ['linkcheck'] source_suffix = ['.rst', '.md'] templates_path = ['_templates'] From 08599a70e476ad0e7c9fd90c18adbe1b5749714b Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:00:41 -0700 Subject: [PATCH 10/36] codecov test --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d582e7cb..1db13838 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,10 +75,10 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - #- name: Test with pytest - # run: | - # python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - # pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + - name: Test with pytest + run: | + python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - name: Upload coverage reports to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: codecov/codecov-action@v4 From fa1c996e7abdc6863422b894905697b15fb1de02 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:05:25 -0700 Subject: [PATCH 11/36] testing order --- .github/workflows/ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1db13838..f10e00fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,16 +75,7 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - - name: Test with pytest - run: | - python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - - name: Upload coverage reports to Codecov - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: LLNL/SSAPy + - name: Build documentation if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 run: | @@ -98,6 +89,16 @@ jobs: pip install -r docs/requirements.txt cd docs && make html && make html touch _build/html/.nojekyll + - name: Test with pytest + run: | + python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + - name: Upload coverage reports to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: LLNL/SSAPy - name: Deploy documentation if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: crazy-max/ghaction-github-pages@v4 From e03c74b8fd5ae67863589f3f56388a9d317e690b Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:10:33 -0700 Subject: [PATCH 12/36] defining project directory --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f10e00fa..5285d427 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + CI_PROJECT_DIR: ${{ github.workspace }} + jobs: test: runs-on: ${{ matrix.os }} @@ -75,7 +78,6 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - - name: Build documentation if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 run: | @@ -107,6 +109,7 @@ jobs: build_dir: docs/_build/html env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass: needs: [test] runs-on: ubuntu-latest From 1a43a748beb65d2a24136ed94f8a6d9d593c0ec8 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:14:10 -0700 Subject: [PATCH 13/36] fixing ssapy install --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5285d427..51b2a7ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,13 @@ jobs: - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | + sudo apt-get update + sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake + git submodule update --init --recursive + git lfs install + git lfs pull + python3 setup.py build + python3 setup.py install python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy @@ -57,6 +64,13 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | + sudo apt-get update + sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake + git submodule update --init --recursive + git lfs install + git lfs pull + python3 setup.py build + python3 setup.py install python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy @@ -78,6 +92,16 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ + - name: Test with pytest + run: | + python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + - name: Upload coverage reports to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: LLNL/SSAPy - name: Build documentation if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 run: | @@ -91,16 +115,6 @@ jobs: pip install -r docs/requirements.txt cd docs && make html && make html touch _build/html/.nojekyll - - name: Test with pytest - run: | - python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - - name: Upload coverage reports to Codecov - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: LLNL/SSAPy - name: Deploy documentation if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: crazy-max/ghaction-github-pages@v4 From 7e4947931518dfa5c4c7b4596005eab7eca57f27 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:17:18 -0700 Subject: [PATCH 14/36] fixing mac ssapy install --- .github/workflows/ci.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51b2a7ca..e9d77c50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,19 +64,27 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - sudo apt-get update - sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake + # Update Homebrew and install dependencies + brew update + brew install git git-lfs python3 graphviz cmake + + # Initialize and update submodules git submodule update --init --recursive + + # Install Git LFS and pull LFS objects git lfs install git lfs pull + + # Upgrade pip and install Python dependencies + python3 -m pip install --upgrade pip setuptools flake8 + python3 -m pip install -r requirements.txt + + # Build and install the project python3 setup.py build python3 setup.py install - python -m pip install --upgrade pip setuptools flake8 - python -m pip install -r requirements.txt - # install checked out SSAPy - python setup.py build - python setup.py install - python -m pip list + + # List installed Python packages + python3 -m pip list #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: | From 59c7bc9233b6572af957ab7f482db10e97bf46f9 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:19:43 -0700 Subject: [PATCH 15/36] fixing ubuntu install --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d77c50..5748cdb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,8 +53,6 @@ jobs: git submodule update --init --recursive git lfs install git lfs pull - python3 setup.py build - python3 setup.py install python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy From a72e77a50ce7f608d837fceedffb6f491a467021 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:25:51 -0700 Subject: [PATCH 16/36] fixing pytest dependencies --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5748cdb3..1323e1e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,9 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ + - name: Install pytest plugins + run: | + pip install pytest pytest-cov pytest-xdist - name: Test with pytest run: | python3 ${CI_PROJECT_DIR}/tests/test_orbit.py From 0c4736131cdc52d76fe5ba0dde6daa9d69bc861b Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 14:40:32 -0700 Subject: [PATCH 17/36] continue on error --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1323e1e7..704fe1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,7 @@ jobs: run: | python3 ${CI_PROJECT_DIR}/tests/test_orbit.py pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + continue-on-error: true - name: Upload coverage reports to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: codecov/codecov-action@v4 From 07acd177be1c9dfea63bf2ab2f21ef1426691d49 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 14 Apr 2025 15:18:10 -0700 Subject: [PATCH 18/36] reverting ci --- .github/workflows/ci.yml | 48 +++++++++------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 704fe1bc..d582e7cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - CI_PROJECT_DIR: ${{ github.workspace }} - jobs: test: runs-on: ${{ matrix.os }} @@ -48,11 +45,6 @@ jobs: - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | - sudo apt-get update - sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake - git submodule update --init --recursive - git lfs install - git lfs pull python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy @@ -62,27 +54,12 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - # Update Homebrew and install dependencies - brew update - brew install git git-lfs python3 graphviz cmake - - # Initialize and update submodules - git submodule update --init --recursive - - # Install Git LFS and pull LFS objects - git lfs install - git lfs pull - - # Upgrade pip and install Python dependencies - python3 -m pip install --upgrade pip setuptools flake8 - python3 -m pip install -r requirements.txt - - # Build and install the project - python3 setup.py build - python3 setup.py install - - # List installed Python packages - python3 -m pip list + python -m pip install --upgrade pip setuptools flake8 + python -m pip install -r requirements.txt + # install checked out SSAPy + python setup.py build + python setup.py install + python -m pip list #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: | @@ -98,14 +75,10 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - - name: Install pytest plugins - run: | - pip install pytest pytest-cov pytest-xdist - - name: Test with pytest - run: | - python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - continue-on-error: true + #- name: Test with pytest + # run: | + # python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + # pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - name: Upload coverage reports to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: codecov/codecov-action@v4 @@ -133,7 +106,6 @@ jobs: build_dir: docs/_build/html env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pass: needs: [test] runs-on: ubuntu-latest From bf4b2f056004339662ae6fd0e0e2d255e8050234 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Tue, 15 Apr 2025 09:21:12 -0700 Subject: [PATCH 19/36] testing container build --- .github/workflows/build-containers.yml | 62 ++++++++++++++ .github/workflows/ci.yml | 110 +++++++++++-------------- 2 files changed, 108 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/build-containers.yml diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml new file mode 100644 index 00000000..10d3ebe0 --- /dev/null +++ b/.github/workflows/build-containers.yml @@ -0,0 +1,62 @@ +on: + repository_dispatch: + types: [trigger-container-build] + +deploy-images: + needs: [pass] + if: github.event_name == 'push' || github.event_name == 'release' + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Checkout SSAPy + uses: actions/checkout@v4 + with: + path: 'SSAPy' + lfs: 'true' + submodules: 'recursive' + - name: Look around + run: | + echo ${{ github.workspace }} + pwd + ls -alh ./ + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Setup Metadata + uses: docker/metadata-action@v5 + id: docker_meta + with: + images: | + ghcr.io/${{ github.repository_owner }}/ssapy-centos-s9 + tags: | + type=schedule,pattern=nightly + type=schedule,pattern=develop + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build & Deploy Images + uses: docker/build-push-action@v5 + with: + context: . + file: SSAPy/.docker/Dockerfile + platforms: 'linux/amd64,linux/arm64' + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + + images-built: + needs: [deploy-images] + runs-on: ubuntu-latest + steps: + - run: echo "Container built" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d582e7cb..523d6541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + CI_PROJECT_DIR: ${{ github.workspace }} + jobs: test: runs-on: ${{ matrix.os }} @@ -45,6 +48,11 @@ jobs: - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | + sudo apt-get update + sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake + git submodule update --init --recursive + git lfs install + git lfs pull python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy @@ -54,12 +62,27 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - python -m pip install --upgrade pip setuptools flake8 - python -m pip install -r requirements.txt - # install checked out SSAPy - python setup.py build - python setup.py install - python -m pip list + # Update Homebrew and install dependencies + brew update + brew install git git-lfs python3 graphviz cmake + + # Initialize and update submodules + git submodule update --init --recursive + + # Install Git LFS and pull LFS objects + git lfs install + git lfs pull + + # Upgrade pip and install Python dependencies + python3 -m pip install --upgrade pip setuptools flake8 + python3 -m pip install -r requirements.txt + + # Build and install the project + python3 setup.py build + python3 setup.py install + + # List installed Python packages + python3 -m pip list #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: | @@ -75,10 +98,14 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - #- name: Test with pytest - # run: | - # python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - # pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + - name: Install pytest plugins + run: | + pip install pytest pytest-cov pytest-xdist + - name: Test with pytest + run: | + python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + pytest --cov-report=xml --cov=coffea --deselect=test_taskvine + continue-on-error: true - name: Upload coverage reports to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: codecov/codecov-action@v4 @@ -106,66 +133,21 @@ jobs: build_dir: docs/_build/html env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass: needs: [test] runs-on: ubuntu-latest steps: - run: echo "All jobs passed" - deploy-images: - needs: [pass] - if: github.event_name == 'push' || github.event_name == 'release' + + trigger-container-build: runs-on: ubuntu-latest - permissions: - packages: write + needs: [pass] + if: success() steps: - - name: Checkout SSAPy - uses: actions/checkout@v4 - with: - path: 'SSAPy' - lfs: 'true' - submodules: 'recursive' - - name: Look around - run: | - echo ${{ github.workspace }} - pwd - ls -alh ./ - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Setup Metadata - uses: docker/metadata-action@v5 - id: docker_meta - with: - images: | - ghcr.io/${{ github.repository_owner }}/ssapy-centos-s9 - tags: | - type=schedule,pattern=nightly - type=schedule,pattern=develop - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=ref,event=branch - type=ref,event=pr - type=ref,event=tag - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + - name: Trigger contianer build workflow + uses: peter-evans/repository-dispatch@v3 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build & Deploy Images - uses: docker/build-push-action@v5 - with: - context: . - file: SSAPy/.docker/Dockerfile - platforms: 'linux/amd64,linux/arm64' - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} + token: ${{ secrets.GITHUB_TOKEN }} + event-type: trigger-container-build - images-built: - needs: [deploy-images] - runs-on: ubuntu-latest - steps: - - run: echo "Container built" From fb127f4d4d8529ee2f0aea28bc4960b144a04def Mon Sep 17 00:00:00 2001 From: dehiggin Date: Tue, 15 Apr 2025 09:33:42 -0700 Subject: [PATCH 20/36] . --- .github/workflows/build-containers.yml | 62 -------------------------- 1 file changed, 62 deletions(-) delete mode 100644 .github/workflows/build-containers.yml diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml deleted file mode 100644 index 10d3ebe0..00000000 --- a/.github/workflows/build-containers.yml +++ /dev/null @@ -1,62 +0,0 @@ -on: - repository_dispatch: - types: [trigger-container-build] - -deploy-images: - needs: [pass] - if: github.event_name == 'push' || github.event_name == 'release' - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Checkout SSAPy - uses: actions/checkout@v4 - with: - path: 'SSAPy' - lfs: 'true' - submodules: 'recursive' - - name: Look around - run: | - echo ${{ github.workspace }} - pwd - ls -alh ./ - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Setup Metadata - uses: docker/metadata-action@v5 - id: docker_meta - with: - images: | - ghcr.io/${{ github.repository_owner }}/ssapy-centos-s9 - tags: | - type=schedule,pattern=nightly - type=schedule,pattern=develop - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=ref,event=branch - type=ref,event=pr - type=ref,event=tag - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build & Deploy Images - uses: docker/build-push-action@v5 - with: - context: . - file: SSAPy/.docker/Dockerfile - platforms: 'linux/amd64,linux/arm64' - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} - - images-built: - needs: [deploy-images] - runs-on: ubuntu-latest - steps: - - run: echo "Container built" \ No newline at end of file From 093a8ce019cab598d69cded3d4a62da37c0f87d7 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Tue, 15 Apr 2025 09:37:01 -0700 Subject: [PATCH 21/36] reverting ci --- .github/workflows/ci.yml | 110 +++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 523d6541..d582e7cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - CI_PROJECT_DIR: ${{ github.workspace }} - jobs: test: runs-on: ${{ matrix.os }} @@ -48,11 +45,6 @@ jobs: - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | - sudo apt-get update - sudo apt-get install build-essential git git-lfs python3 python3-setuptools python3-venv graphviz cmake - git submodule update --init --recursive - git lfs install - git lfs pull python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt # install checked out SSAPy @@ -62,27 +54,12 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - # Update Homebrew and install dependencies - brew update - brew install git git-lfs python3 graphviz cmake - - # Initialize and update submodules - git submodule update --init --recursive - - # Install Git LFS and pull LFS objects - git lfs install - git lfs pull - - # Upgrade pip and install Python dependencies - python3 -m pip install --upgrade pip setuptools flake8 - python3 -m pip install -r requirements.txt - - # Build and install the project - python3 setup.py build - python3 setup.py install - - # List installed Python packages - python3 -m pip list + python -m pip install --upgrade pip setuptools flake8 + python -m pip install -r requirements.txt + # install checked out SSAPy + python setup.py build + python setup.py install + python -m pip list #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: | @@ -98,14 +75,10 @@ jobs: # python3 --version # flake8 --version # flake8 ssapy/ tests/ devel/ - - name: Install pytest plugins - run: | - pip install pytest pytest-cov pytest-xdist - - name: Test with pytest - run: | - python3 ${CI_PROJECT_DIR}/tests/test_orbit.py - pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - continue-on-error: true + #- name: Test with pytest + # run: | + # python3 ${CI_PROJECT_DIR}/tests/test_orbit.py + # pytest --cov-report=xml --cov=coffea --deselect=test_taskvine - name: Upload coverage reports to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 uses: codecov/codecov-action@v4 @@ -133,21 +106,66 @@ jobs: build_dir: docs/_build/html env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pass: needs: [test] runs-on: ubuntu-latest steps: - run: echo "All jobs passed" - - trigger-container-build: - runs-on: ubuntu-latest + deploy-images: needs: [pass] - if: success() + if: github.event_name == 'push' || github.event_name == 'release' + runs-on: ubuntu-latest + permissions: + packages: write steps: - - name: Trigger contianer build workflow - uses: peter-evans/repository-dispatch@v3 + - name: Checkout SSAPy + uses: actions/checkout@v4 + with: + path: 'SSAPy' + lfs: 'true' + submodules: 'recursive' + - name: Look around + run: | + echo ${{ github.workspace }} + pwd + ls -alh ./ + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Setup Metadata + uses: docker/metadata-action@v5 + id: docker_meta + with: + images: | + ghcr.io/${{ github.repository_owner }}/ssapy-centos-s9 + tags: | + type=schedule,pattern=nightly + type=schedule,pattern=develop + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} - event-type: trigger-container-build + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build & Deploy Images + uses: docker/build-push-action@v5 + with: + context: . + file: SSAPy/.docker/Dockerfile + platforms: 'linux/amd64,linux/arm64' + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + images-built: + needs: [deploy-images] + runs-on: ubuntu-latest + steps: + - run: echo "Container built" From 93e26c928d5655048f1e9748173d41340ba81dd1 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Tue, 22 Apr 2025 12:25:54 -0700 Subject: [PATCH 22/36] alexx suggestions --- .github/workflows/ci.yml | 1 + docs/source/api.rst | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d582e7cb..f532ef9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,7 @@ jobs: python3 setup.py build python3 setup.py install pip install -r docs/requirements.txt + cd docs && sphinx-autogen source/reference.rst -t source/_templates -o source/modules && cd ../ cd docs && make html && make html touch _build/html/.nojekyll - name: Deploy documentation diff --git a/docs/source/api.rst b/docs/source/api.rst index ab3e90ac..2edf723a 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -11,9 +11,8 @@ Some packages must be imported explicitly, so as to avoid importing unnecessary and/or heavy dependencies. Below lists the packages available in the ``ssapy`` namespace. .. autosummary:: - :toctree: _autosummary - :template: module_template.rst - :recursive: + :toctree: modules + :template: automodapi_templ.rst ssapy.accel ssapy.body From 4d1f9a74bbe4b903690e737ab5cf826b827305a9 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Wed, 23 Apr 2025 10:09:20 -0700 Subject: [PATCH 23/36] removing templates --- docs/requirements.txt | 4 +- docs/source/_templates/class_template.rst | 33 ---------- docs/source/_templates/module_template.rst | 75 ---------------------- docs/source/conf.py | 1 - 4 files changed, 2 insertions(+), 111 deletions(-) delete mode 100644 docs/source/_templates/class_template.rst delete mode 100644 docs/source/_templates/module_template.rst diff --git a/docs/requirements.txt b/docs/requirements.txt index 88cb9c90..083d86fa 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ -sphinx==7.2.3 +sphinx==7.1.2 sphinx-copybutton -myst-parser +myst-parser<4.0.0 sphinx-tabs sphinx-automodapi sphinx_rtd_theme diff --git a/docs/source/_templates/class_template.rst b/docs/source/_templates/class_template.rst deleted file mode 100644 index d2718c5f..00000000 --- a/docs/source/_templates/class_template.rst +++ /dev/null @@ -1,33 +0,0 @@ -{{ fullname | escape | underline}} - -.. currentmodule:: {{ module }} - -.. autoclass:: {{ objname }} - :members: - :show-inheritance: - :private-members: - :undoc-members: - - {% block methods %} - .. automethod:: __init__ - - {% if methods %} - .. rubric:: {{ _('Methods') }} - - .. autosummary:: - {% for item in methods %} - ~{{ name }}.{{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block attributes %} - {% if attributes %} - .. rubric:: {{ _('Attributes') }} - - .. autosummary:: - {% for item in attributes %} - ~{{ name }}.{{ item }} - {%- endfor %} - {% endif %} - {% endblock %} \ No newline at end of file diff --git a/docs/source/_templates/module_template.rst b/docs/source/_templates/module_template.rst deleted file mode 100644 index d2a11713..00000000 --- a/docs/source/_templates/module_template.rst +++ /dev/null @@ -1,75 +0,0 @@ -{{ fullname | escape | underline}} - -.. automodule:: {{ fullname }} - - {% block attributes %} - {% if attributes %} - .. rubric:: Module Attributes - - .. autosummary:: - :toctree: - {% for item in attributes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block classes %} - {% if classes %} - .. rubric:: {{ _('Classes') }} - - .. autosummary:: - :toctree: - :template: class_template.rst - {% for item in classes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block inheritance %} - {% if classes %} - - .. inheritance-diagram:: {{ fullname }} - :caption: Inheritance Relationship - :parts: -1 - {% endif %} - {% endblock %} - - {% block functions %} - {% if functions %} - .. rubric:: {{ _('Functions') }} - - .. autosummary:: - :toctree: - {% for item in functions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block exceptions %} - {% if exceptions %} - .. rubric:: {{ _('Exceptions') }} - - .. autosummary:: - :toctree: - {% for item in exceptions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - -{% block modules %} -{% if modules %} -.. rubric:: Modules - -.. autosummary:: - :toctree: - :template: module_template.rst - :recursive: -{% for item in modules %} - {{ item }} -{%- endfor %} -{% endif %} -{% endblock %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 0ac25409..75b688ae 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,7 +42,6 @@ '.md': 'markdown', } - def linkcode_resolve(domain, info): if domain != 'py': return None From 753164b6212cac8522de573baf6e443dddc51f15 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Thu, 24 Apr 2025 16:02:26 -0700 Subject: [PATCH 24/36] fixing dir --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f532ef9b..700d6ae1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: python3 setup.py build python3 setup.py install pip install -r docs/requirements.txt - cd docs && sphinx-autogen source/reference.rst -t source/_templates -o source/modules && cd ../ + cd docs && sphinx-autogen source/api.rst -t source/_templates -o source/modules && cd ../ cd docs && make html && make html touch _build/html/.nojekyll - name: Deploy documentation From c12ad62afda2ebbcf59d95d0b6e194c83a6dbe01 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 25 Apr 2025 12:28:56 -0700 Subject: [PATCH 25/36] alexx questions --- docs/source/conf.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 75b688ae..fa31fdf8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,17 +30,17 @@ 'sphinxcontrib.bibtex', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', - 'sphinx.ext.duration', - 'sphinx.ext.doctest', - 'sphinx.ext.inheritance_diagram', - 'sphinx.ext.autosectionlabel', + # 'sphinx.ext.duration', + # 'sphinx.ext.doctest', + # 'sphinx.ext.inheritance_diagram', + # 'sphinx.ext.autosectionlabel', ] -source_suffix = { - '.rst': 'restructuredtext', - '.txt': 'markdown', - '.md': 'markdown', -} +# source_suffix = { +# '.rst': 'restructuredtext', +# '.txt': 'markdown', +# '.md': 'markdown', +# } def linkcode_resolve(domain, info): if domain != 'py': @@ -52,7 +52,7 @@ def linkcode_resolve(domain, info): autosummary_generate = True numpydoc_show_class_members = False -autodoc_member_order = 'bysource' +# autodoc_member_order = 'bysource' sphinx_tabs_valid_builders = ['linkcheck'] source_suffix = ['.rst', '.md'] templates_path = ['_templates'] From 62849325417b7d70038877fd15ff508b732111af Mon Sep 17 00:00:00 2001 From: dehiggin Date: Fri, 25 Apr 2025 12:34:32 -0700 Subject: [PATCH 26/36] still works --- docs/source/conf.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index fa31fdf8..f7dd4ebf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,17 +30,8 @@ 'sphinxcontrib.bibtex', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', - # 'sphinx.ext.duration', - # 'sphinx.ext.doctest', - # 'sphinx.ext.inheritance_diagram', - # 'sphinx.ext.autosectionlabel', ] -# source_suffix = { -# '.rst': 'restructuredtext', -# '.txt': 'markdown', -# '.md': 'markdown', -# } def linkcode_resolve(domain, info): if domain != 'py': @@ -52,7 +43,6 @@ def linkcode_resolve(domain, info): autosummary_generate = True numpydoc_show_class_members = False -# autodoc_member_order = 'bysource' sphinx_tabs_valid_builders = ['linkcheck'] source_suffix = ['.rst', '.md'] templates_path = ['_templates'] From edb1a015ea40cc3d1b6deb7fdf54537d8adcb9ea Mon Sep 17 00:00:00 2001 From: dehiggin Date: Wed, 30 Apr 2025 10:25:03 -0700 Subject: [PATCH 27/36] utils edits --- ssapy/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssapy/utils.py b/ssapy/utils.py index 22e8091f..7143e326 100644 --- a/ssapy/utils.py +++ b/ssapy/utils.py @@ -2411,7 +2411,7 @@ def xyz_to_equatorial(xq, yq, zq, xe=0, ye=0, ze=0, degrees=False): def ecliptic_xyz_to_equatorial(xc, yc, zc, xe=0, ye=0, ze=0, degrees=False): - """ + """ Convert ecliptic Cartesian coordinates (X, Y, Z) to equatorial right ascension (RA) and declination (DEC). This function first converts ecliptic Cartesian coordinates to equatorial Cartesian coordinates @@ -2542,7 +2542,7 @@ def ecliptic_to_equatorial(lon, lat, degrees=False): def proper_motion_ra_dec(r=None, v=None, x=None, y=None, z=None, vx=None, vy=None, vz=None, r_earth=np.array([0, 0, 0]), v_earth=np.array([0, 0, 0]), input_unit='si'): - """ + """ Calculate the proper motion in right ascension (RA) and declination (DEC) for celestial objects. This function computes the proper motion in RA and DEC based on the position and velocity of the object @@ -2573,6 +2573,7 @@ def proper_motion_ra_dec(r=None, v=None, x=None, y=None, z=None, vx=None, vy=Non - Proper motion is scaled by a factor of 206265 to convert radians to arcseconds. - For REBOUND simulation units, proper motion is adjusted to account for time scaling. """ + if r is None or v is None: if x is not None and y is not None and z is not None and vx is not None and vy is not None and vz is not None: r = np.array([x, y, z]) @@ -3327,4 +3328,4 @@ def find_smallest_bounding_cube(r: np.ndarray, pad: float = 0.0) -> Tuple[np.nda lower_bound = center - half_side_length upper_bound = center + half_side_length - return lower_bound, upper_bound + return lower_bound, upper_bound \ No newline at end of file From f1d2a9080beb4b9ec67f8fe545fc86e706aca7b5 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Wed, 30 Apr 2025 10:37:20 -0700 Subject: [PATCH 28/36] doc fixes --- ssapy/rvsampler.py | 3 +++ ssapy/utils.py | 47 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/ssapy/rvsampler.py b/ssapy/rvsampler.py index 91e17b31..85e166fb 100644 --- a/ssapy/rvsampler.py +++ b/ssapy/rvsampler.py @@ -1,3 +1,6 @@ +""" This module provides functions and classes for orbital mechanics calculations, optimization techniques, sampling methods, and orbital parameter translations. """ + + import numpy as np from astropy.time import Time diff --git a/ssapy/utils.py b/ssapy/utils.py index 7143e326..a5d2d9e9 100644 --- a/ssapy/utils.py +++ b/ssapy/utils.py @@ -1,3 +1,6 @@ +""" This module provides functions for coordinate transformations, vector operations, celestial mechanics, and mathematical utilities. """ + + import sys import os import numpy as np @@ -2150,6 +2153,33 @@ def rightascension_to_hourangle(right_ascension, local_time): def equatorial_to_horizontal(observer_latitude, declination, right_ascension=None, hour_angle=None, local_time=None, hms=False): + """ + Convert equatorial coordinates (declination and either right ascension or hour angle) + to horizontal coordinates (azimuth and altitude) for a given observer's latitude. + + Parameters: + ----------- + observer_latitude (float): Latitude of the observer in degrees. + declination (float): Declination of the celestial object in degrees. + right_ascension (float, optional): Right ascension of the celestial object in hours. + If provided, `local_time` is required to calculate hour angle. + hour_angle (float, optional): Hour angle of the celestial object in degrees or hours. + If provided, it will be used directly for calculations. + local_time (float, optional): Local time in hours, used to compute hour angle from right ascension. + hms (bool, optional): If True, interprets hour angle or right ascension as hours-minutes-seconds (HMS) + and converts them to decimal degrees. + + Returns: + -------- + tuple: A tuple containing: + - azimuth (float): Azimuth angle in degrees, measured clockwise from north. + - altitude (float): Altitude angle in degrees, measured above the horizon. + + Notes: + ------ + - Either `right_ascension` or `hour_angle` must be provided for the calculation. + - If both `right_ascension` and `hour_angle` are provided, `hour_angle` will take precedence. + """ if right_ascension is not None: hour_angle = rightascension_to_hourangle(right_ascension, local_time) if hms: @@ -2911,6 +2941,21 @@ def gcrf_to_itrf_astropy(state_vectors, t): def v_from_r(r, t): + """ + Calculate the velocity from position and time data. + + Parameters: + ----------- + r (ndarray): Array of position data with shape (N, D), + where N is the number of time steps and D is the number of dimensions. + t (array-like): Array of time data corresponding to the position data. + If the first element is of type `Time`, it will be converted to GPS time. + + Returns: + -------- + ndarray: Array of velocity data with shape (N, D), calculated as the rate of change of position + over time. The last row of the velocity array is repeated to match the input shape. + """ if isinstance(t[0], Time): t = t.gps delta_r = np.diff(r, axis=0) @@ -3241,7 +3286,6 @@ def interpolate_points_between(r, m): def check_lunar_collision(r, times, m=1000): - from .body import get_body """ Checks if the trajectory of a particle intersects with the Moon. @@ -3258,6 +3302,7 @@ def check_lunar_collision(r, times, m=1000): np.array Indexes where collision occurs. """ + from .body import get_body # For a time step of 1 hour, m=1000 will be sensitive of collisions up to 482 km/s new_r = interpolate_points_between(r, m) # Time span of integration From 20060cb2d7bc4be76152e493bdd0a04bd54a3839 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 5 May 2025 12:43:46 -0700 Subject: [PATCH 29/36] install update --- docs/source/installation.rst | 7 +++---- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 2a7f8056..1fced55f 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -45,7 +45,7 @@ After cloning the main git repository, you must run the following command to clo .. code-block:: console - git submodule update --init --recursive + git submodule update --init --recursive Then checkout the large files @@ -54,12 +54,11 @@ Then checkout the large files git lfs install git lfs pull -Then run the usual setup commands: +Then run the install commands: .. code-block:: console - python3 setup.py build - python3 setup.py install + pip install llnl-ssapy Orekit dependency ^^^^^^^^^^^^^^^^^ diff --git a/pyproject.toml b/pyproject.toml index 095c84dd..8c425e3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "ssapy" +name = "llnl-ssapy" version = "1.0.0" authors = [ { name="LLNL SSAPy Software Team", email="yeagerastro@gmail.com" }, From 6ddc8614551696b33568e3222137c6b946fb8a2f Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 5 May 2025 12:57:38 -0700 Subject: [PATCH 30/36] pypi badge --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 512159c3..03a3d3ba 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ SSAPy - Space Situational Awareness for Python ============================================== -|ci_badge| |docs_badge| |codecov_badge| |joss_badge| +|ci_badge| |docs_badge| |codecov_badge| |joss_badge| |pypi-badge| |DOI| .. |ci_badge| image:: https://github.com/LLNL/SSAPy/actions/workflows/ci.yml/badge.svg :target: https://github.com/LLNL/SSAPy/actions/workflows/ci.yml @@ -15,6 +15,9 @@ SSAPy - Space Situational Awareness for Python .. |joss_badge| image:: https://joss.theoj.org/papers/a629353cbdd8d64a861bb807e12c5d06/status.svg :target: https://joss.theoj.org/papers/a629353cbdd8d64a861bb807e12c5d06 +.. |pypi-badge| image:: https://badge.fury.io/py/llnl-ssapy.svg + :target: https://badge.fury.io/py/llnl-ssapy + `SSAPy `_ is a fast, flexible, high-fidelity orbital modeling and analysis tool for orbits spanning from low-Earth orbit into the cislunar regime, and includes the following: - Ability to define satellite parameters (area, mass, radiation and drag coefficients, etc.) From 00d00b1ce41b72db4dd6ea9ff13a67872b6463a6 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 5 May 2025 12:58:42 -0700 Subject: [PATCH 31/36] removing doi --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 03a3d3ba..4d612db2 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ SSAPy - Space Situational Awareness for Python ============================================== -|ci_badge| |docs_badge| |codecov_badge| |joss_badge| |pypi-badge| |DOI| +|ci_badge| |docs_badge| |codecov_badge| |joss_badge| |pypi-badge| .. |ci_badge| image:: https://github.com/LLNL/SSAPy/actions/workflows/ci.yml/badge.svg :target: https://github.com/LLNL/SSAPy/actions/workflows/ci.yml From 9bb310742d8db7315ac2f528b8a6db9df61f6406 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 5 May 2025 13:16:32 -0700 Subject: [PATCH 32/36] remove pip show --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b987c2a2..ab26d694 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,7 +161,6 @@ jobs: - name: Build documentation if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 run: | - pip show ssapy pip install -r docs/requirements.txt # python3 ${CI_PROJECT_DIR}/ssapy/update_benchmarks.py From 1a2b03db5e7d48b70ea455869b3a51a9ee3a7a81 Mon Sep 17 00:00:00 2001 From: dehiggin Date: Mon, 5 May 2025 14:04:10 -0700 Subject: [PATCH 33/36] remove cloning --- docs/source/installation.rst | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 1fced55f..15593cfe 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -39,22 +39,7 @@ These requirements can be easily installed on most modern macOS and Linux system Installation ------------ -As the package has not yet been published on `PyPI `_, it CANNOT be installed using pip. Instead, use the following directions to install the package. - -After cloning the main git repository, you must run the following command to clone the submodules: - -.. code-block:: console - - git submodule update --init --recursive - -Then checkout the large files - -.. code-block:: console - - git lfs install - git lfs pull - -Then run the install commands: +As the package has been published on `PyPI `_, it can be installed using pip. .. code-block:: console From 321f6f903cfcf885ecd35f2d9d736f996eee7c20 Mon Sep 17 00:00:00 2001 From: Higgins Date: Tue, 9 Sep 2025 10:35:42 -0700 Subject: [PATCH 34/36] checking if this works --- .github/workflows/ci.yml | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c0625f5..722998e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,42 +76,37 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - # Update Homebrew and install dependencies + # Update Homebrew brew update - brew install git python3 cmake - - # Initialize and update submodules - git submodule update --init --recursive - - # Upgrade pip and install Python dependencies - python3 -m pip install --upgrade pip setuptools flake8 - python3 -m pip install -r requirements.txt - PYTHON_VERSION=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") + # Only install if missing (avoids tap conflicts) + brew list --formula git >/dev/null 2>&1 || brew install git + brew list --formula cmake >/dev/null 2>&1 || brew install cmake + + # Use the toolchain set by actions/setup-python + python -m pip install --upgrade pip setuptools flake8 + python -m pip install -r requirements.txt + PYTHON_VERSION=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") export ARCHFLAGS="-arch arm64" export CMAKE_OSX_ARCHITECTURES=arm64 export CIBW_BUILD="${PYTHON_VERSION}-macosx_*" - - # Optional: print to confirm echo "ARCHFLAGS=$ARCHFLAGS" echo "CMAKE_OSX_ARCHITECTURES=$CMAKE_OSX_ARCHITECTURES" echo "CIBW_BUILD=$CIBW_BUILD" - - # Ensure delocate is installed - python3 -m pip install --upgrade cibuildwheel delocate + + python -m pip install --upgrade cibuildwheel delocate python -m cibuildwheel --platform macos - # Check the wheel for missing shared libraries + # Check wheel deps find wheelhouse -name '*.whl' -exec delocate-listdeps {} \; - - # Install the generated wheel - pip install wheelhouse/*.whl + + # Install the generated wheel and hide the source tree so imports use the wheel + python -m pip install wheelhouse/*.whl mv ssapy ssapy_src_backup - # List installed Python packages - python3 -m pip list + python -m pip list - name: Debug build artifacts run: | find . -name "*_ssapy*.so" From cdc4d96b8556ae7348b8882cd0b6fd4838388ee0 Mon Sep 17 00:00:00 2001 From: Higgins Date: Tue, 9 Sep 2025 10:43:32 -0700 Subject: [PATCH 35/36] debug error --- .github/workflows/ci.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 722998e6..5bf06885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,14 +76,17 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - # Update Homebrew + # Update Homebrew; only install missing formulae (avoid tap conflicts) brew update - - # Only install if missing (avoids tap conflicts) brew list --formula git >/dev/null 2>&1 || brew install git brew list --formula cmake >/dev/null 2>&1 || brew install cmake + brew list --formula git-lfs >/dev/null 2>&1 || brew install git-lfs + + # Make LFS usable in this headless environment + git lfs install --skip-repo + git config --global credential.helper "" # avoid Keychain prompts - # Use the toolchain set by actions/setup-python + # Use the actions/setup-python toolchain consistently python -m pip install --upgrade pip setuptools flake8 python -m pip install -r requirements.txt @@ -102,18 +105,16 @@ jobs: # Check wheel deps find wheelhouse -name '*.whl' -exec delocate-listdeps {} \; - # Install the generated wheel and hide the source tree so imports use the wheel + # Install the generated wheel into the SAME interpreter python -m pip install wheelhouse/*.whl + + # Hide source tree so imports resolve to the wheel mv ssapy ssapy_src_backup python -m pip list - name: Debug build artifacts run: | find . -name "*_ssapy*.so" - - name: Debug installed ssapy - run: | - python -c "import ssapy; print('ssapy is at:', ssapy.__file__)" - ls -l $(python -c "import ssapy; import os; print(os.path.dirname(ssapy.__file__))") #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: | From bc6217a401ef3ad60b32df16bec05c29ec675fdc Mon Sep 17 00:00:00 2001 From: Higgins Date: Tue, 9 Sep 2025 11:44:11 -0700 Subject: [PATCH 36/36] credentials error --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bf06885..1a2e975a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'recursive' + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: