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

Updating Firefly-dependent areas to match API changes and PyPI packaging #4143

Merged
merged 16 commits into from
Oct 3, 2022
Merged

Updating Firefly-dependent areas to match API changes and PyPI packaging #4143

merged 16 commits into from
Oct 3, 2022

Conversation

mtryan83
Copy link
Contributor

PR Summary

This PR aims to reconcile the changes to Firefly introduced since version 4.0.0 of yt was released. In summary, Firefly tweaked the Reader and ParticleGroup APIs and the installation of Firefly from PyPI installs as firefly (instead of Firefly or Firefly-vis, the devs were able to get control of the package name). I've updated the documentation, including that (I believe) Firefly also now prefers their binary .ffly format.

I'm very new to Firefly and yt, so I would greatly appreciate it if e.g. @agurvich would double check.

I believe this counts as a fix/update for #3415

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

mtryan83 and others added 3 commits September 22, 2022 11:36
Current version of Firefly is 3.2.0.  These seem to be the only changes necessary to convert to the new python API. (API changes seem to mostly be a relabeling of parameter fields, plus velocities is elevated to a separate field. )
When installed from PyPI (e.g. using pip install firefly), the firefly module is brought in as lower-case.
@welcome
Copy link

welcome bot commented Sep 24, 2022

Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution!

@mtryan83 mtryan83 changed the title Updating Firefly-dependent areas to match API changes and PyPI packaging Bug: Updating Firefly-dependent areas to match API changes and PyPI packaging Sep 24, 2022
@mtryan83 mtryan83 changed the title Bug: Updating Firefly-dependent areas to match API changes and PyPI packaging Updating Firefly-dependent areas to match API changes and PyPI packaging Sep 24, 2022
Removed excess whitespace to make flake8 happy.
@mtryan83
Copy link
Contributor Author

pre-commit.ci autofix

@neutrinoceros neutrinoceros added the enhancement Making something better label Sep 25, 2022
Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

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

Hi @mtryan83, thanks a lot for doing this !
Indeed, it'd be great if @agurvich could sign off here.
In the mean time, here are a couple comments, one of which is crucial (API change)

setup.cfg Outdated Show resolved Hide resolved
yt/data_objects/data_containers.py Outdated Show resolved Hide resolved
yt/utilities/on_demand_imports.py Outdated Show resolved Hide resolved
mtryan83 and others added 5 commits September 25, 2022 14:03
Co-authored-by: Clément Robert <cr52@protonmail.com>
Followed approach used in yt/data_objects/image_array, since as far as I can tell, datadir is just the new name of JSONdir (because data files are now generally .ffly instead of .json).
Fixes to the actual function call documentation that I missed earlier.
Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

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

follow up comments on the deprecated API part

yt/data_objects/data_containers.py Show resolved Hide resolved
yt/data_objects/data_containers.py Show resolved Hide resolved
yt/data_objects/data_containers.py Outdated Show resolved Hide resolved
mtryan83 and others added 2 commits September 25, 2022 15:13
Co-authored-by: Clément Robert <cr52@protonmail.com>
Co-authored-by: Clément Robert <cr52@protonmail.com>
mtryan83 and others added 2 commits September 25, 2022 16:32
Additional kwargs passed to create_firefly_object are passed unchanged to the firefly.data_reader.Reader initialization.
@neutrinoceros neutrinoceros added this to the 4.1.0 milestone Sep 26, 2022
Co-authored-by: Clément Robert <cr52@protonmail.com>
neutrinoceros
neutrinoceros previously approved these changes Sep 26, 2022
@agurvich
Copy link
Contributor

So, I am only just now tuning in. I am traveling until next Monday 10/3 and won't have a chance to formally review this until then. @mtryan83, first of all, thank you for putting all of this together! from your original PR summary this seems like exactly the sort of changes that I've had on a to-do list to do since we updated the API and submitted the Firefly paper so I am in your debt for handling it.

It's been hard to follow the updates to the PR since then, has it all mostly been yt documentation stuff? Is there something in particular I should pay close attention to (it sounds like you covered all the bookkeeping stuff like switching JSONDIR and .ffly format, etc.). I can have a look at the file diffs but it may be worth coordinating and changing things upstream if there's something worth cleaning up there (e.g. if it means removing a warning on yt's side because I just do better type checking on firefly's side).

@neutrinoceros
Copy link
Member

So, I am only just now tuning in. I am traveling until next Monday 10/3 and won't have a chance to formally review this until then.

No rush on our side !

it may be worth coordinating and changing things upstream if there's something worth cleaning up there (e.g. if it means removing a warning on yt's side because I just do better type checking on firefly's side).

AFAICT there's nothing we'd want to clean up upstream.

@mtryan83
Copy link
Contributor Author

I think the main thing is just making sure I updated the API correctly. From what I could tell, it was just JSONdir --> datadir, tracked_* --> field_*, Firefly --> firefly, and dumpToJSON --> writeToDisk and options --> settings (though those two only appear in the documentation).

I don't see anything to clean up upstream either.

Looks like I missed a JSONdir though, @neutrinoceros, sorry!

@neutrinoceros
Copy link
Member

For later reference, I previously triaged this for the 4.1 milestone, but I'm going to take it back, because that release is already far behind schedule. I would still be happy to include the patch in the release if we can get a second review in time, which seems likely, I just want to signal that the patch shouldn't be considered blocking.

@neutrinoceros neutrinoceros removed this from the 4.1.0 milestone Sep 28, 2022
@mtryan83
Copy link
Contributor Author

mtryan83 commented Oct 3, 2022

(fast-cache and updated firefly dependencies were touching! Couldn't automerge anymore)

Copy link
Contributor

@agurvich agurvich left a comment

Choose a reason for hiding this comment

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

These look great to me, thank you @mtryan83 for cleaning all this up with the new API. I'm hoping that I won't be compelled to change it again any time soon now that we have the .ffly format (which is what inspired most of the changes).

@neutrinoceros neutrinoceros merged commit f7eb388 into yt-project:main Oct 3, 2022
@welcome
Copy link

welcome bot commented Oct 3, 2022

Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆

@mtryan83 mtryan83 deleted the updating_firefly branch October 4, 2022 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making something better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants