Skip to content

Commit

Permalink
Fix linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewoldag committed Jul 31, 2023
1 parent ce53dfb commit f02a562
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 49 deletions.
51 changes: 8 additions & 43 deletions docs/notebooks/sinusoidal/sinusoidal_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -20,17 +20,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'sorcha.lightcurves.base_lightcurve.SinusoidalLightCurve'>\n"
]
}
],
"outputs": [],
"source": [
"# Update the `LC_METHODS` registration dictionary\n",
"update_lc_subclasses()\n",
Expand All @@ -41,22 +33,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" FieldMJD LCA Period Time0\n",
"0 60277.351867 1 0.001 60277.351867\n",
"1 60289.319749 1 0.001 60277.351867\n",
"2 60289.330920 1 0.001 60277.351867\n",
"3 60292.334497 1 0.001 60277.351867\n",
"4 60292.346208 1 0.001 60277.351867\n"
]
}
],
"outputs": [],
"source": [
"# make a small pandas dataframe with ~5 rows\n",
"import pandas as pd\n",
Expand All @@ -74,22 +53,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 -0.340932\n",
"1 -0.934792\n",
"2 0.186596\n",
"3 -0.026723\n",
"4 0.737016\n",
"dtype: float64\n"
]
}
],
"outputs": [],
"source": [
"# instantiate the sinusoidal class\n",
"lc_model = LC_METHODS['sinusoidal']()\n",
Expand Down Expand Up @@ -118,8 +84,7 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4
}
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pandas as pd
import numpy as np


class SinusoidalLightCurve(AbstractLightCurve):
"""
Note: assuming sinusoidal in magnitude instead of flux. Maybe not call LCA?
Expand Down
12 changes: 6 additions & 6 deletions tests/sinusoidal/test_sinusoidal.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from sorcha_community_utils.sinusoidal.sinusoidal_lightcurve import SinusoidalLightCurve
import numpy as np
import pandas as pd


def test_sinusoidal_lightcurve_name():
assert 'sinusoidal' == SinusoidalLightCurve.name_id()
assert "sinusoidal" == SinusoidalLightCurve.name_id()


def test_compute_simple():
data_dict = {
'FieldMJD': [0],
'LCA': [1],
'Period': [1],
'Time0': [0],
"FieldMJD": [0],
"LCA": [1],
"Period": [1],
"Time0": [0],
}

df = pd.DataFrame.from_dict(data_dict)
Expand Down

0 comments on commit f02a562

Please sign in to comment.