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

Updating variable name. #19

Merged
merged 3 commits into from
Mar 25, 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
8 changes: 4 additions & 4 deletions docs/notebooks/lightcurve/sinusoidal/sinusoidal_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"import pandas as pd\n",
"\n",
"data_dict = {\n",
" 'FieldMJD_TAI': [60277.351867, 60289.319749, 60289.330920, 60292.334497, 60292.346208],\n",
" 'fieldMJD_TAI': [60277.351867, 60289.319749, 60289.330920, 60292.334497, 60292.346208],\n",
" 'LCA': [1, 1, 1, 1, 1],\n",
" 'Period': [0.001, 0.001, 0.001, 0.001, 0.001],\n",
" 'Time0': [60277.351867, 60277.351867, 60277.351867, 60277.351867, 60277.351867],\n",
Expand Down Expand Up @@ -69,7 +69,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "sorcha_addons",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -83,9 +83,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SinusoidalLightCurve(AbstractLightCurve):
* ``Time0`` - phase for the light curve [days].
"""

def __init__(self, required_column_names: List[str] = ["FieldMJD_TAI", "LCA", "Period", "Time0"]) -> None:
def __init__(self, required_column_names: List[str] = ["fieldMJD_TAI", "LCA", "Period", "Time0"]) -> None:
super().__init__(required_column_names)

def compute(self, df: pd.DataFrame) -> np.array:
Expand All @@ -39,7 +39,7 @@ def compute(self, df: pd.DataFrame) -> np.array:
# Verify that the input data frame contains each of the required columns.
self._validate_column_names(df)

time = 2 * np.pi * (df["FieldMJD_TAI"] - df["Time0"]) / df["Period"]
time = 2 * np.pi * (df["fieldMJD_TAI"] - df["Time0"]) / df["Period"]
return df["LCA"] * np.sin(time)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion tests/lightcurve/sinusoidal/test_sinusoidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_sinusoidal_lightcurve_name():

def test_compute_simple():
data_dict = {
"FieldMJD_TAI": [1.0 / 4],
"fieldMJD_TAI": [1.0 / 4],
"LCA": [1],
"Period": [1],
"Time0": [0],
Expand Down
Loading