Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming dataclasses folder, fixing linting. #176

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repos:

# Analyze the code style and report code that doesn't adhere.
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.10.0
hooks:
- id: black-jupyter
name: Format code using black
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/adler_phasecurve_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"\n",
"import numpy as np\n",
Expand Down Expand Up @@ -351,7 +351,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions docs/notebooks/colour_functions_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.science.Colour import col_obs_ref\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
Expand Down Expand Up @@ -282,7 +282,7 @@
"\n",
"# store running colour parameters as a dataframe\n",
"df_col = pd.DataFrame(col_dict_list)\n",
"df_col = pd.concat([df_obs, df_col], axis=1)\n",
"df_col = df_col.merge(df_obs, on=x_plot)\n",
"\n",
"ax1.set_xlabel(x_plot)\n",
"ax1.set_ylabel(y_plot)\n",
Expand Down Expand Up @@ -361,7 +361,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "605a043a",
"id": "30e90de5-e50b-4339-a027-7b2165a6b664",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -383,7 +383,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/outlier_detection_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"import adler.utilities.science_utilities as utils\n",
"\n",
"import numpy as np\n",
Expand Down Expand Up @@ -296,7 +296,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/plotting_utilities_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
"\n",
Expand Down Expand Up @@ -251,7 +251,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/adler_demo/adler_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
"import adler.utilities.science_utilities as sci_utils\n",
Expand Down Expand Up @@ -568,9 +568,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -582,7 +582,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/adler_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"\n",
"import numpy as np\n",
Expand Down Expand Up @@ -324,9 +324,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/adlerdata_in_and_out.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"import pandas as pd\n",
"import sqlite3\n",
"\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.utilities.tests_utilities import get_test_data_filepath"
]
},
Expand Down
10 changes: 5 additions & 5 deletions notebooks/colour_functions_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.science.Colour import col_obs_ref\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
Expand Down Expand Up @@ -369,9 +369,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -383,7 +383,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions notebooks/colour_functions_testing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.science.Colour import col_obs_ref\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
Expand Down Expand Up @@ -2035,9 +2035,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -2049,7 +2049,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/outlier_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.dataclasses.AdlerData import AdlerData\n",
"from adler.objectdata.AdlerData import AdlerData\n",
"import adler.utilities.science_utilities as utils\n",
"\n",
"import numpy as np\n",
Expand Down Expand Up @@ -275,9 +275,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
6 changes: 3 additions & 3 deletions notebooks/plotting_utilities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid\n",
"from adler.science.PhaseCurve import PhaseCurve\n",
"from adler.utilities.plotting_utilities import plot_errorbar\n",
"\n",
Expand Down Expand Up @@ -246,9 +246,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "adler-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "adler-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 1 addition & 1 deletion src/adler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import dataclasses
from . import objectdata
from . import science
from . import utilities
from . import lasair
10 changes: 5 additions & 5 deletions src/adler/adler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import matplotlib.gridspec as gridspec
import os

from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid
from adler.dataclasses.AdlerData import AdlerData
from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid
from adler.objectdata.AdlerData import AdlerData
from adler.science.PhaseCurve import PhaseCurve
from adler.science.Colour import col_obs_ref
from adler.utilities.AdlerCLIArguments import AdlerCLIArguments
Expand Down Expand Up @@ -102,9 +102,9 @@ def runAdler(cli_args):
logger.info("load previously classified observations: {}".format(save_file))
_df_obs = pd.read_csv(save_file, index_col=0)
df_obs = df_obs.merge(_df_obs, on=["diaSourceId", "midPointMjdTai"], how="left")
df_obs.loc[
pd.isnull(df_obs["outlier_y"]), "outlier_y"
] = False # ensure that classifications exist (nan entries can only be false?). Weird behaviour here for g filter, is it to do with when new g obs appear relative to r/i etc?
df_obs.loc[pd.isnull(df_obs["outlier_y"]), "outlier_y"] = (
False # ensure that classifications exist (nan entries can only be false?). Weird behaviour here for g filter, is it to do with when new g obs appear relative to r/i etc?
)
df_obs = df_obs.rename({"outlier_y": "outlier"}, axis=1)
df_obs = df_obs.drop("outlier_x", axis=1)
else:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import logging
import json

from adler.dataclasses.Observations import Observations
from adler.dataclasses.MPCORB import MPCORB
from adler.dataclasses.SSObject import SSObject
from adler.dataclasses.AdlerData import AdlerData
from adler.dataclasses.dataclass_utilities import get_data_table
from adler.objectdata.Observations import Observations
from adler.objectdata.MPCORB import MPCORB
from adler.objectdata.SSObject import SSObject
from adler.objectdata.AdlerData import AdlerData
from adler.objectdata.objectdata_utilities import get_data_table

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass

from adler.dataclasses.dataclass_utilities import get_from_table, get_from_dictionary
from adler.objectdata.objectdata_utilities import get_from_table, get_from_dictionary

MPCORB_KEYS = {
"mpcDesignation": str,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass, field
import numpy as np

from adler.dataclasses.dataclass_utilities import get_from_table, get_from_dictionary
from adler.objectdata.objectdata_utilities import get_from_table, get_from_dictionary

OBSERVATIONS_KEYS = {
"diaSourceId": np.ndarray,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass, field
import numpy as np

from adler.dataclasses.dataclass_utilities import get_from_table, get_from_dictionary
from adler.objectdata.objectdata_utilities import get_from_table, get_from_dictionary

SSO_KEYS = {
"discoverySubmissionDate": float,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from . import AdlerData
from . import Observations
from . import dataclass_utilities
from . import objectdata_utilities
from . import MPCORB
from . import AdlerPlanetoid
from . import SSObject
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from numpy.testing import assert_array_equal

from adler.dataclasses.AdlerData import AdlerData
from adler.objectdata.AdlerData import AdlerData
from adler.utilities.tests_utilities import get_test_data_filepath

# setting up the AdlerData object to be used for testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy.testing import assert_almost_equal

from adler.utilities.tests_utilities import get_test_data_filepath
from adler.dataclasses.AdlerPlanetoid import AdlerPlanetoid
from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid


ssoid = 8268570668335894776
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from numpy.testing import assert_almost_equal
import numpy as np

from adler.dataclasses.MPCORB import MPCORB
from adler.dataclasses.dataclass_utilities import get_data_table
from adler.objectdata.MPCORB import MPCORB
from adler.objectdata.objectdata_utilities import get_data_table
from adler.utilities.tests_utilities import get_test_data_filepath


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from numpy.testing import assert_almost_equal
import numpy as np

from adler.dataclasses.Observations import Observations
from adler.dataclasses.dataclass_utilities import get_data_table
from adler.objectdata.Observations import Observations
from adler.objectdata.objectdata_utilities import get_data_table
from adler.utilities.tests_utilities import get_test_data_filepath


Expand Down
Loading
Loading