Skip to content

Commit

Permalink
Merge pull request #21 from CDJellen/V1.19.6
Browse files Browse the repository at this point in the history
update tests for new realtime page format
  • Loading branch information
CDJellen committed Aug 1, 2023
2 parents c4b9479 + 9944008 commit 424a1d2
Show file tree
Hide file tree
Showing 9 changed files with 2,047 additions and 417 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7]
python-version: ["3.7", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Brewfile.lock.json
dist/
build/
.ipynb_checkpoints/
!notebooks/example.ipynb
!notebooks/overview.ipynb
3 changes: 2 additions & 1 deletion ndbc_api/api/parsers/station_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class RealtimeParser(StationParser):
def available_measurements(cls, response: dict) -> dict:
if response.get('status') == 200:
soup = bs4.BeautifulSoup(response.get('body'), 'html.parser')
line_items = soup.find_all('li')
items = soup.find('section', {"class": "data"})
line_items = items.find_all('li')
return cls._build_available_measurements(line_items=line_items)
else:
return dict()
Expand Down
4 changes: 2 additions & 2 deletions ndbc_api/ndbc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ def _handle_data(data: pd.DataFrame,
return data.to_dict()
elif as_df:
try:
return pd.DataFrame().from_dict(data)
except (NotImplementedError, ValueError) as e:
return pd.DataFrame().from_dict(data, orient='index')
except (NotImplementedError, ValueError, TypeError) as e:
raise HandlerException(
'Failed to convert `pd.DataFrame` to `dict`.') from e
else:
Expand Down
166 changes: 0 additions & 166 deletions notebooks/example.ipynb

This file was deleted.

Loading

0 comments on commit 424a1d2

Please sign in to comment.