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 moab frontend #2856

Merged
merged 6 commits into from
Aug 14, 2020
Merged

Update moab frontend #2856

merged 6 commits into from
Aug 14, 2020

Conversation

bam241
Copy link
Contributor

@bam241 bam241 commented Aug 13, 2020

PR Summary

PR Checklist

  • pass black --check yt/
  • pass isort . --check --diff
  • pass flake8 yt/
  • pass flynt yt/ --fail-on-change --dry-run -e yt/extern
  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

This fixes the call to PyNE::mesh that now uses pymoab in place of pytaps

Thx to @kkiesling and @pshriwise for the help on this!

@welcome
Copy link

welcome bot commented Aug 13, 2020

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!

@bam241
Copy link
Contributor Author

bam241 commented Aug 13, 2020

@pshriwise @kkiesling do you know how to add labels ?

@neutrinoceros
Copy link
Member

Hi @bam241 , thanks for this update !
FYI, only project members can manage labels, I'll do it for you :-)

@neutrinoceros neutrinoceros added bug code frontends Things related to specific frontends needs example Example needed to reproduce bug labels Aug 13, 2020
@neutrinoceros
Copy link
Member

I'm putting the "bug" label here but it'd be useful to have an example showing why the frontend is currently broken.
Also, I see the git history is a bit scrambled here, which makes reviewing harder than it should (there are a lot of files showing up in the diff that do not belong so it's easier to miss something you actually changed). Would you be able to rebase on the current tip of master ? If you're not confortable with the process I can do it for you, just let me know !

@kkiesling
Copy link

@neutrinoceros - the history should be fixed now.

@neutrinoceros
Copy link
Member

Awesome ! Thanks for reacting so promptly !

@kkiesling
Copy link

Regarding how the frontend was broken. We updated PyNE back in January to use PyMOAB for meshes rather than PyTAPS. The methods called on the mesh in yt here were still the PyTAPS methods which are non-existent in PyNE now. We've updated them to the correct PyMOAB methods. (pyne mesh class for reference).

@neutrinoceros neutrinoceros removed the needs example Example needed to reproduce bug label Aug 13, 2020
@matthewturk
Copy link
Member

@kkiesling Thank you for doing this -- I (personally) had no idea that currently the Pyne frontend was broken, and we definitely want to rectify that!

@neutrinoceros
Copy link
Member

Thanks for your reply ! It was brought to my attention that this is a known issue so an example isn't actually needed.
I've got a naive question before I start an actual review: this looks to me like it could maybe break some backward compatibility ? if it doesn't, great, otherwise we could have both versions of the affected code in and select which one to use with an if or a try statement.

@kkiesling
Copy link

By backwards compatibility, do you mean with older PyNE versions? It definitely does break compatibility with older release versions. We haven't had a PyNE release in a very long time so we are getting one ready this week. This works with the current develop branch of PyNE and will work with our in-progress PyNE release version. I would think it's okay to wait until that release is fully out to merge if you want it tied to a specific PyNE version (cc @gonuke if he wants to chime in on this). In my opinion, it is not worth supporting any older PyNE versions since those rely on PyTAPS which is not compatible with python 3. We don't support any PyTAPS anymore.

@matthewturk
Copy link
Member

@kkiesling I think we would defer to your judgment on this topic, and we should not insist on backward compatibility if you believe the returns for the PyNE community are low.

@neutrinoceros
Copy link
Member

we should not insist on backward compatibility if you believe the returns for the PyNE community are low.

I agree, was just curious how this would be received.

In my opinion, it is not worth supporting any older PyNE versions since those rely on PyTAPS which is not compatible with python 3

Well that settles it then, since yt isn't compatible with Python 2 anymore, there's is exactly 0 reasons to worry about backward compatibility indeed.

@kkiesling
Copy link

@matthewturk I don't think supporting backward compatibility here will be worthwhile.

@neutrinoceros
Copy link
Member

I would think it's okay to wait until that release is fully out to merge if you want it tied to a specific PyNE version

Doesn't seems necessary since we're in between yt releases too, so that's on your end to judge whichever path you guys want to go.
I think we can always factor in more updates later if it turns out necessary.

@neutrinoceros
Copy link
Member

As a note, I think it would be helpful to add a test of some sort here. It looks to me that the affected code isn't, and actually couldn't be tested as it is.

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.

Left a couple of suggestions to improve code quality but overall this looks good to me !

yt/frontends/moab/data_structures.py Outdated Show resolved Hide resolved
yt/frontends/moab/data_structures.py Outdated Show resolved Hide resolved
yt/frontends/moab/data_structures.py Outdated Show resolved Hide resolved
@kkiesling
Copy link

As a note, I think it would be helpful to add a test of some sort here. It looks to me that the affected code isn't, and actually couldn't be tested as it is.

We may want a bigger discussion on this- adding tests would require building PyNE from source as a part of CI. Is this something the yt team would be okay with? If so, it would definitely make sense for this to wait until after we get our release out.

@neutrinoceros
Copy link
Member

Yes, we discussed this with @munkm and indeed it's not as trivial as I naively assumed at first. I didn't realise how special this specific frontend is. Now I personally think it's probably not worth the maintenance cost for us to test this in here, unless it can be done through mock patches ?
Otherwise the testing part could probably be leveraged downstream in Pyne. Does this make any sense ? :)

Co-authored-by: Clément Robert <cr52@protonmail.com>
@kkiesling
Copy link

We just discussed too and I think it makes sense for us to cover testing of the frontend in PyNE rather than here as it would not be trivial indeed. We don't rely on yt as a dependency in source except for visualizing data in tutorials (which is actually why this went unnoticed so long). But yes, we could come up with a better testing system on the PyNE side to catch these updates more frequently.

@neutrinoceros
Copy link
Member

/black

@neutrinoceros
Copy link
Member

I took the liberty of fixing a mistake introduced by my suggestion. Note that the black command affected a cookbook file as a side effect, which is okay. We don't regularly check format there but the bot doesn't know it.

@bam241
Copy link
Contributor Author

bam241 commented Aug 13, 2020

running "/black" actually reformat the files ? that's cool !

@neutrinoceros
Copy link
Member

@matthewturk just deployed this, we're still trying it out but seems to work !
you can use /format to apply black+isort+flynt too :-)

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.

Thank you so much for this PR @bam241 @kkiesling and @pshriwise!! 🎉 ⚛️ 😎

@munkm munkm merged commit 0e4c38c into yt-project:master Aug 14, 2020
@welcome
Copy link

welcome bot commented Aug 14, 2020

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

@munkm
Copy link
Member

munkm commented Aug 14, 2020

Also, we're working towards a major release in the next few months. If you all notice any API discrepancies in yt infrastructure that you all are using please don't hesitate to let us know so we can try to address it. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug code frontends Things related to specific frontends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants