Skip to content

Commit

Permalink
fix testing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-gorman committed Feb 7, 2022
1 parent 8b9d186 commit 16b1a2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: 3.10
python-version: 3.10.2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -110,7 +110,7 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: 3.10
python-version: 3.10.2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
31 changes: 11 additions & 20 deletions nempy/historical_inputs/mms_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,7 @@ def get_data(self, date_time):
... 'SETTLEMENTDATE': ['2019/01/01 11:55:00', '2019/01/01 12:00:00'],
... 'INITIALMW': [1.0, 2.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
2
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by SETTLEMENTDATE.
Expand Down Expand Up @@ -888,8 +887,7 @@ def get_data(self, date_time):
... 'INTERVAL_DATETIME': ['2019/01/01 11:55:00', '2019/01/01 12:00:00'],
... 'INITIALMW': [1.0, 2.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
2
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by INTERVAL_DATETIME.
Expand Down Expand Up @@ -957,8 +955,7 @@ def get_data(self, date_time):
... 'SETTLEMENTDATE': ['2019/01/01 00:00:00', '2019/01/02 00:00:00'],
... 'INITIALMW': [1.0, 2.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
2
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by SETTLEMENTDATE and the results from the appropriate market
day starting at 04:05:00 are retrieved. In the results below note when the output changes
Expand Down Expand Up @@ -1048,8 +1045,7 @@ def get_data(self, date_time):
... 'END_DATE': ['2019/01/02 00:00:00', '2019/01/03 00:00:00'],
... 'INITIALMW': [1.0, 2.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
2
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by START_DATE and END_DATE.
Expand Down Expand Up @@ -1131,8 +1127,7 @@ def get_data(self, date_time):
... 'VERSIONNO': [1, 2, 2, 3],
... 'RHS': [1.0, 2.0, 2.0, 3.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
4
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
>>> data = pd.DataFrame({
... 'SETTLEMENTDATE' : ['2019/01/02 00:00:00', '2019/01/02 00:00:00', '2019/01/03 00:00:00',
Expand All @@ -1142,8 +1137,7 @@ def get_data(self, date_time):
... '2019/01/03 00:00:00'],
... 'GENCONID_VERSIONNO': [1, 2, 2, 3]})
>>> data.to_sql('DISPATCHCONSTRAINT', con=con, if_exists='append', index=False)
4
>>> _ = data.to_sql('DISPATCHCONSTRAINT', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by the contents of DISPATCHCONSTRAINT.
Expand Down Expand Up @@ -1225,8 +1219,7 @@ def get_data(self, date_time):
... 'VERSIONNO': [1, 2, 2, 3],
... 'INITIALMW': [1.0, 2.0, 2.0, 3.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
4
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
We also need to add data to DISPATCHINTERCONNECTORRES because the results of the get_data method are filtered
against this table
Expand All @@ -1235,8 +1228,7 @@ def get_data(self, date_time):
... 'INTERCONNECTORID': ['X', 'X', 'Y'],
... 'SETTLEMENTDATE': ['2019/01/02 00:00:00', '2019/01/03 00:00:00', '2019/01/02 00:00:00']})
>>> data.to_sql('DISPATCHINTERCONNECTORRES', con=con, if_exists='append', index=False)
3
>>> _ = data.to_sql('DISPATCHINTERCONNECTORRES', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by the contents of DISPATCHCONSTRAINT.
Expand Down Expand Up @@ -1352,8 +1344,7 @@ def get_data(self, date_time):
... 'VERSIONNO': [1, 2, 2, 3],
... 'INITIALMW': [1.0, 2.0, 2.0, 3.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
4
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data the output is filtered by most recent effective date and highest version no.
Expand Down Expand Up @@ -1458,8 +1449,8 @@ def get_data(self):
... 'DUID': ['X', 'Y'],
... 'INITIALMW': [1.0, 2.0]})
>>> data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
2
>>> _ = data.to_sql('EXAMPLE', con=con, if_exists='append', index=False)
When we call get_data all data in the table is returned.
Expand Down

0 comments on commit 16b1a2b

Please sign in to comment.