From c585550dae67b1720f32a0ddcac4f643e1b241af Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Thu, 12 Oct 2023 15:25:27 -0700 Subject: [PATCH 1/4] Rename the package to sorcha_addons --- README.md | 8 ++++---- docs/conf.py | 4 ++-- .../activity/lsst_comet/simple_cometary_magnitude.ipynb | 4 ++-- .../lightcurve/sinusoidal/sinusoidal_example.ipynb | 4 ++-- docs/usage.rst | 4 ++-- pyproject.toml | 4 ++-- src/sorcha_addons/__init__.py | 7 +++++++ .../activity/__init__.py | 0 .../activity/lsst_comet/LICENSE | 0 .../activity/lsst_comet/__init__.py | 0 .../activity/lsst_comet/lsst_comet_activity.py | 0 .../activity/lsst_comet/model.py | 0 .../activity/lsst_comet/phase.py | 0 .../lightcurve/__init__.py | 0 .../lightcurve/sinusoidal/__init__.py | 0 .../lightcurve/sinusoidal/sinusoidal_lightcurve.py | 0 src/sorcha_community_utils/__init__.py | 7 ------- .../lsst_comet/test_PPCalculateApparentMagnitude.py | 2 +- tests/activity/lsst_comet/test_model.py | 2 +- tests/lightcurve/sinusoidal/test_sinusoidal.py | 2 +- 20 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 src/sorcha_addons/__init__.py rename src/{sorcha_community_utils => sorcha_addons}/activity/__init__.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/activity/lsst_comet/LICENSE (100%) rename src/{sorcha_community_utils => sorcha_addons}/activity/lsst_comet/__init__.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/activity/lsst_comet/lsst_comet_activity.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/activity/lsst_comet/model.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/activity/lsst_comet/phase.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/lightcurve/__init__.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/lightcurve/sinusoidal/__init__.py (100%) rename src/{sorcha_community_utils => sorcha_addons}/lightcurve/sinusoidal/sinusoidal_lightcurve.py (100%) delete mode 100644 src/sorcha_community_utils/__init__.py diff --git a/README.md b/README.md index 5b4f2eb..02809df 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Sorcha Community Utilities +# Sorcha Add-ons -[![ci](https://github.com/dirac-institute/sorcha_community_utils/actions/workflows/smoke-test.yml/badge.svg)](https://github.com/dirac-institute/sorcha_community_utils/actions/workflows/smoke-test.yml) -[![pytest](https://github.com/dirac-institute/sorcha_community_utils/actions/workflows/testing-and-coverage.yml/badge.svg)](https://github.com/dirac-institute/sorcha_community_utils/actions/workflows/testing-and-coverage.yml) -[![Documentation Status](https://readthedocs.org/projects/sorcha-community-utils/badge/?version=latest)](https://sorcha-community-utils.readthedocs.io/en/latest/?badge=latest) +[![ci](https://github.com/dirac-institute/sorcha-addons/actions/workflows/smoke-test.yml/badge.svg)](https://github.com/dirac-institute/sorcha-addons/actions/workflows/smoke-test.yml) +[![pytest](https://github.com/dirac-institute/sorcha-addons/actions/workflows/testing-and-coverage.yml/badge.svg)](https://github.com/dirac-institute/sorcha-addons/actions/workflows/testing-and-coverage.yml) +[![Documentation Status](https://readthedocs.org/projects/sorcha-addons/badge/?version=latest)](https://sorcha-addons.readthedocs.io/en/latest/?badge=latest) [![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/) diff --git a/docs/conf.py b/docs/conf.py index 499ec9d..0ee8556 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,10 +16,10 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "sorcha_community_utils" +project = "sorcha_addons" copyright = "2023, Meg Schwamb" author = "Meg Schwamb" -release = version("sorcha_community_utils") +release = version("sorcha_addons") # for example take major/minor version = ".".join(release.split(".")[:2]) diff --git a/docs/notebooks/activity/lsst_comet/simple_cometary_magnitude.ipynb b/docs/notebooks/activity/lsst_comet/simple_cometary_magnitude.ipynb index 1eb1b85..8861339 100644 --- a/docs/notebooks/activity/lsst_comet/simple_cometary_magnitude.ipynb +++ b/docs/notebooks/activity/lsst_comet/simple_cometary_magnitude.ipynb @@ -18,7 +18,7 @@ "import numpy as np\n", "import pandas as pd\n", "import astropy.units as u\n", - "from sorcha_community_utils.activity.lsst_comet.model import Comet\n", + "from sorcha_addons.activity.lsst_comet.model import Comet\n", "from sbpy.activity import Afrho\n", "import synphot\n", "\n", @@ -99,7 +99,7 @@ "metadata": {}, "outputs": [], "source": [ - "from sorcha_community_utils.activity.lsst_comet.lsst_comet_activity import LSSTCometActivity\n", + "from sorcha_addons.activity.lsst_comet.lsst_comet_activity import LSSTCometActivity\n", "from sorcha.activity.activity_registration import update_activity_subclasses\n", "\n", "update_activity_subclasses()\n", diff --git a/docs/notebooks/lightcurve/sinusoidal/sinusoidal_example.ipynb b/docs/notebooks/lightcurve/sinusoidal/sinusoidal_example.ipynb index 4a617ac..93ec9f9 100644 --- a/docs/notebooks/lightcurve/sinusoidal/sinusoidal_example.ipynb +++ b/docs/notebooks/lightcurve/sinusoidal/sinusoidal_example.ipynb @@ -14,7 +14,7 @@ "outputs": [], "source": [ "# Import the SinusoidalLightCurve class into the current scope\n", - "from sorcha_community_utils.lightcurve.sinusoidal.sinusoidal_lightcurve import SinusoidalLightCurve\n", + "from sorcha_addons.lightcurve.sinusoidal.sinusoidal_lightcurve import SinusoidalLightCurve\n", "from sorcha.lightcurves.lightcurve_registration import update_lc_subclasses, LC_METHODS" ] }, @@ -69,7 +69,7 @@ ], "metadata": { "kernelspec": { - "display_name": "sorcha_community_utils", + "display_name": "sorcha_addons", "language": "python", "name": "python3" }, diff --git a/docs/usage.rst b/docs/usage.rst index e2be523..32b0019 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -6,9 +6,9 @@ virtual environment. .. code:: bash - >> pip install sorcha-community-utils + >> pip install sorcha-addons -Once the ``sorcha-community-utils`` is installed, Sorcha will automatically detect +Once the ``sorcha-addons`` is installed, Sorcha will automatically detect the available plugins and make them available during processing. To use one of the plugins from the community utilities, simply add the unique diff --git a/pyproject.toml b/pyproject.toml index bbaf8e1..667de1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "sorcha_community_utils" +name = "sorcha_addons" license = {file = "LICENSE"} readme = "README.md" authors = [ @@ -49,7 +49,7 @@ requires = [ build-backend = "setuptools.build_meta" [tool.setuptools_scm] -write_to = "src/sorcha_community_utils/_version.py" +write_to = "src/sorcha_addons/_version.py" [tool.pytest.ini_options] testpaths = [ diff --git a/src/sorcha_addons/__init__.py b/src/sorcha_addons/__init__.py new file mode 100644 index 0000000..24685b2 --- /dev/null +++ b/src/sorcha_addons/__init__.py @@ -0,0 +1,7 @@ +from sorcha_addons import activity +from sorcha_addons import lightcurve + +__all__ = [ + "activity", + "lightcurve", +] diff --git a/src/sorcha_community_utils/activity/__init__.py b/src/sorcha_addons/activity/__init__.py similarity index 100% rename from src/sorcha_community_utils/activity/__init__.py rename to src/sorcha_addons/activity/__init__.py diff --git a/src/sorcha_community_utils/activity/lsst_comet/LICENSE b/src/sorcha_addons/activity/lsst_comet/LICENSE similarity index 100% rename from src/sorcha_community_utils/activity/lsst_comet/LICENSE rename to src/sorcha_addons/activity/lsst_comet/LICENSE diff --git a/src/sorcha_community_utils/activity/lsst_comet/__init__.py b/src/sorcha_addons/activity/lsst_comet/__init__.py similarity index 100% rename from src/sorcha_community_utils/activity/lsst_comet/__init__.py rename to src/sorcha_addons/activity/lsst_comet/__init__.py diff --git a/src/sorcha_community_utils/activity/lsst_comet/lsst_comet_activity.py b/src/sorcha_addons/activity/lsst_comet/lsst_comet_activity.py similarity index 100% rename from src/sorcha_community_utils/activity/lsst_comet/lsst_comet_activity.py rename to src/sorcha_addons/activity/lsst_comet/lsst_comet_activity.py diff --git a/src/sorcha_community_utils/activity/lsst_comet/model.py b/src/sorcha_addons/activity/lsst_comet/model.py similarity index 100% rename from src/sorcha_community_utils/activity/lsst_comet/model.py rename to src/sorcha_addons/activity/lsst_comet/model.py diff --git a/src/sorcha_community_utils/activity/lsst_comet/phase.py b/src/sorcha_addons/activity/lsst_comet/phase.py similarity index 100% rename from src/sorcha_community_utils/activity/lsst_comet/phase.py rename to src/sorcha_addons/activity/lsst_comet/phase.py diff --git a/src/sorcha_community_utils/lightcurve/__init__.py b/src/sorcha_addons/lightcurve/__init__.py similarity index 100% rename from src/sorcha_community_utils/lightcurve/__init__.py rename to src/sorcha_addons/lightcurve/__init__.py diff --git a/src/sorcha_community_utils/lightcurve/sinusoidal/__init__.py b/src/sorcha_addons/lightcurve/sinusoidal/__init__.py similarity index 100% rename from src/sorcha_community_utils/lightcurve/sinusoidal/__init__.py rename to src/sorcha_addons/lightcurve/sinusoidal/__init__.py diff --git a/src/sorcha_community_utils/lightcurve/sinusoidal/sinusoidal_lightcurve.py b/src/sorcha_addons/lightcurve/sinusoidal/sinusoidal_lightcurve.py similarity index 100% rename from src/sorcha_community_utils/lightcurve/sinusoidal/sinusoidal_lightcurve.py rename to src/sorcha_addons/lightcurve/sinusoidal/sinusoidal_lightcurve.py diff --git a/src/sorcha_community_utils/__init__.py b/src/sorcha_community_utils/__init__.py deleted file mode 100644 index 5c32b85..0000000 --- a/src/sorcha_community_utils/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from sorcha_community_utils import activity -from sorcha_community_utils import lightcurve - -__all__ = [ - "activity", - "lightcurve", -] diff --git a/tests/activity/lsst_comet/test_PPCalculateApparentMagnitude.py b/tests/activity/lsst_comet/test_PPCalculateApparentMagnitude.py index 5d719e0..a0683db 100644 --- a/tests/activity/lsst_comet/test_PPCalculateApparentMagnitude.py +++ b/tests/activity/lsst_comet/test_PPCalculateApparentMagnitude.py @@ -5,7 +5,7 @@ from sorcha.modules.PPCalculateSimpleCometaryMagnitude import PPCalculateSimpleCometaryMagnitude # imported so that it can be registered by `update_activity_subclasses` -from sorcha_community_utils.activity.lsst_comet.lsst_comet_activity import LSSTCometActivity +from sorcha_addons.activity.lsst_comet.lsst_comet_activity import LSSTCometActivity from sorcha.activity.activity_registration import update_activity_subclasses diff --git a/tests/activity/lsst_comet/test_model.py b/tests/activity/lsst_comet/test_model.py index 088461a..8264dd5 100644 --- a/tests/activity/lsst_comet/test_model.py +++ b/tests/activity/lsst_comet/test_model.py @@ -5,7 +5,7 @@ import astropy.units as u from sbpy.activity import Afrho import synphot -from sorcha_community_utils.activity.lsst_comet.model import Comet +from sorcha_addons.activity.lsst_comet.model import Comet class TestComet: diff --git a/tests/lightcurve/sinusoidal/test_sinusoidal.py b/tests/lightcurve/sinusoidal/test_sinusoidal.py index affe54f..e1cb6bb 100644 --- a/tests/lightcurve/sinusoidal/test_sinusoidal.py +++ b/tests/lightcurve/sinusoidal/test_sinusoidal.py @@ -1,4 +1,4 @@ -from sorcha_community_utils.lightcurve.sinusoidal.sinusoidal_lightcurve import SinusoidalLightCurve +from sorcha_addons.lightcurve.sinusoidal.sinusoidal_lightcurve import SinusoidalLightCurve import pandas as pd import numpy as np From 8b5261becb8f85b1422781d71f257040f8fe1a60 Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Thu, 12 Oct 2023 15:26:04 -0700 Subject: [PATCH 2/4] .gitignore: add *~ --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 523b316..57a1ae7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Editor-created file backups +*~ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 95079629401ca940d72ad92b634fb2dc3efb15f4 Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Thu, 12 Oct 2023 17:04:56 -0700 Subject: [PATCH 3/4] Set up the versioning system --- .git_archival.txt | 4 ++++ .gitattributes | 22 ++++++++++++++++++++++ src/sorcha_addons/__init__.py | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 .git_archival.txt create mode 100644 .gitattributes diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000..8fb235d --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b5b9515 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# For explanation of this file and uses see +# https://git-scm.com/docs/gitattributes +# https://developer.lsst.io/git/git-lfs.html#using-git-lfs-enabled-repositories +# +# Used by https://github.com/lsst/afwdata.git +# *.boost filter=lfs diff=lfs merge=lfs -text +# *.dat filter=lfs diff=lfs merge=lfs -text +# *.fits filter=lfs diff=lfs merge=lfs -text +# *.gz filter=lfs diff=lfs merge=lfs -text +# +# apache parquet files +# *.parq filter=lfs diff=lfs merge=lfs -text +# +# sqlite files +# *.sqlite3 filter=lfs diff=lfs merge=lfs -text +# +# gzip files +# *.gz filter=lfs diff=lfs merge=lfs -text +# +# png image files +# *.png filter=lfs diff=lfs merge=lfs -text +.git_archival.txt export-subst diff --git a/src/sorcha_addons/__init__.py b/src/sorcha_addons/__init__.py index 24685b2..a3a3027 100644 --- a/src/sorcha_addons/__init__.py +++ b/src/sorcha_addons/__init__.py @@ -5,3 +5,12 @@ "activity", "lightcurve", ] + +# Version information (autogenerated by setuptools-scm) +try: + from ._version import version as __version__ + from ._version import version_tuple +except ImportError: + __version__ = "unknown version" + version_tuple = (0, 0, "unknown version") + \ No newline at end of file From 64e215b1a5a5bd0c563350b487ef9a15a1c02fb7 Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Thu, 12 Oct 2023 17:17:04 -0700 Subject: [PATCH 4/4] Remove stray whitespace --- src/sorcha_addons/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sorcha_addons/__init__.py b/src/sorcha_addons/__init__.py index a3a3027..577f420 100644 --- a/src/sorcha_addons/__init__.py +++ b/src/sorcha_addons/__init__.py @@ -13,4 +13,3 @@ except ImportError: __version__ = "unknown version" version_tuple = (0, 0, "unknown version") - \ No newline at end of file