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

update viewer2range to extract time range #408

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Conversation

Mikejmnez
Copy link
Collaborator

@Mikejmnez Mikejmnez commented Jan 15, 2024

This PR closes: #407 and #405 . In specific, it does:

  • Time range extraction from poseidon viewer json data.
  • Pythonic output format (time, lat, lon = viewer2range(p))
  • updates name of function (from viewer_to_range to viewer2range)
  • ValueError if the json argument contains more that one geometry type (e.g. Point and Polygon)
  • upgrade testing.

Usage:

from poseidon_viewer import get_shapes
import json
shapes = json.loads(get_shapes())
timeRange, lats, lons = viewer2range(shapes)

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c7d4039) 96.79% compared to head (ca20c01) 96.63%.

Files Patch % Lines
oceanspy/utils.py 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
- Coverage   96.79%   96.63%   -0.17%     
==========================================
  Files           9        9              
  Lines        4987     4987              
  Branches     1189     1190       +1     
==========================================
- Hits         4827     4819       -8     
- Misses         90       96       +6     
- Partials       70       72       +2     
Flag Coverage Δ
unittests 96.63% <90.90%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@MaceKuailv MaceKuailv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a more robust function with better structured test

@Mikejmnez Mikejmnez merged commit e5f2608 into hainegroup:main Jan 15, 2024
5 checks passed
@Mikejmnez Mikejmnez deleted the pview branch January 15, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poseidon viewer extraction
2 participants