-
Notifications
You must be signed in to change notification settings - Fork 280
Import utils in resistivity and induced_polarization #1442
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
base: main
Are you sure you want to change the base?
Conversation
Import objects from `simpeg.electromagnetics.static.utils` in `simpeg.electromagnetics.static.resistivity.utils` and `simpeg.electromagnetics.static.induced_polarization.utils` to make them more discoverable. Add tests that check if those imports are available.
|
I understand the want to make them more discoverable, but I feel like there should be only be one place to import them from. You could add a link to those functions in the |
|
Should it just be in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1442 +/- ##
=======================================
Coverage 86.19% 86.20%
=======================================
Files 432 434 +2
Lines 56119 56131 +12
Branches 5209 5209
=======================================
+ Hits 48373 48385 +12
Misses 6350 6350
Partials 1396 1396 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I agree that having @lheagy having all the utils in |
|
Thanks @santisoler and @jcapriot! And sorry for my slow reply here. Having the utils be consolidated under That way, once you import any of they physics, they come "fully loaded" as a user, it is subtle that you need to import utils from somewhere else |
|
I don’t think it’s necessary, and it encourages users to work in isolated modes. SimPEG is about modularity! Ideally, I’d love for all utility code to exist in a single module: |
|
Thanks Joe, I don't necessarily think that having the ability to import the relevant utils from the related physics module goes against modularity. If it can help with the discoverability of useful things without adding maintenance load (all this would be is a file that imports the relevant functions in the This touches a bit on a bigger picture question about imports. I would like to see us simplify some of this e.g. having to go 4 layers deep to get to DC resistivity is pretty deep ( The organization of utils will take a bit of thought. For example, plotting pseudosections is only relevant to DC, IP, and SP, so I think it is appropriate to keep them with the For now, I still think that we should help users discover relevant utils by having it available with the physics that they import |
|
I guess my biggest issue with it is that it goes against the Zen of Python. |
|
Sorry for my late reply! That is a reasonable point Joe. I am not too hung up on this, importing from |
Summary
Import objects from
simpeg.electromagnetics.static.utilsinsimpeg.electromagnetics.static.resistivity.utilsandsimpeg.electromagnetics.static.induced_polarization.utilsto make them more discoverable. Add tests that check if those imports are available.PR Checklist
expect style.
to a Pull Request
@simpeg/simpeg-developerswhen ready for review.Reference issue
What does this implement/fix?
Fixes #1440
Additional information