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

Observation factory function #328

Merged
merged 5 commits into from
Dec 14, 2023
Merged

Observation factory function #328

merged 5 commits into from
Dec 14, 2023

Conversation

jsmariegaard
Copy link
Member

A factory function for creating an appropriate observation object based on the data and args.

If 'x' or 'y' is given, a PointObservation is created.
If 'x_item' or 'y_item' is given, a TrackObservation is created.

>>> import modelskill as ms
>>> o_pt = ms.observation(df, item=0, x=366844, y=6154291, name="Klagshamn")
>>> o_tr = ms.observation("lon_after_lat.dfs0", item="wl", x_item=1, y_item=0)

Equivalent to ms.model_result

@jsmariegaard jsmariegaard marked this pull request as ready for review December 13, 2023 14:40
@jsmariegaard jsmariegaard merged commit c9c70c9 into main Dec 14, 2023
@jsmariegaard jsmariegaard deleted the observation-function branch December 14, 2023 21:56
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.

1 participant