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

doc: add minimal structure to SkeletonDataset class #2991

Merged
merged 4 commits into from
Dec 16, 2020

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Dec 7, 2020

PR Summary

  • Init required instance attributes in order to leave a valid Dataset structure.
  • minor doc update (hopefully making the instructions a little clearer)

edit:
the changes to SkeletonDataset make it so the following code pass without error

yt.load("myfile.from.a.new.format")

where the only changes required from the author of a new frontend are

  • adding the frontend to yt/frontends/api.py
  • implementing NewDataset._is_valid()

@neutrinoceros neutrinoceros added enhancement Making something better docs labels Dec 7, 2020
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

Nice!! Looking forward to review, but this looks good so far.

@neutrinoceros
Copy link
Member Author

Actually I was expecting to do more with this as I went along implementing my new frontend (PR still not open), but I didn't need to. This is now ready for review.

@neutrinoceros neutrinoceros marked this pull request as ready for review December 10, 2020 15:46
Copy link
Member

@munkm munkm left a comment

Choose a reason for hiding this comment

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

One minor comment but everything looks good to me.

@@ -143,7 +148,8 @@ def _parse_parameter_file(self):
# self.geometry <= a lower case string
# ("cartesian", "polar", "cylindrical"...)
# (defaults to 'cartesian')
pass
self.current_time = -1 # required, change this !
Copy link
Member

Choose a reason for hiding this comment

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

It might be worth suggesting what a good value would be for this in a code that doesn't have time dependence. Since it is required, a helpful suggestion might be good here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. This didn't occur to me. Actually I don't know why it's required at all. I should look for the reason first.
Do you think ˋ0.0` would make sense here ?

@matthewturk
Copy link
Member

This seems fine to me. My suggestion would be a time of zero for default, but setting to -1 makes it so that they explicitly have to set it if they don't want some weird value.

@neutrinoceros
Copy link
Member Author

So I'm down with whatever default value you deem most sensible @munkm , though I don't know what would be a helpful suggestion here :/

@munkm
Copy link
Member

munkm commented Dec 16, 2020

I think leaving it as -1 in the code but having an inline comment that we suggest 0 would work.

@neutrinoceros
Copy link
Member Author

done !

@munkm munkm merged commit aa0d88b into yt-project:master Dec 16, 2020
@neutrinoceros neutrinoceros deleted the skeleton_update branch December 16, 2020 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement Making something better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants