geoscixyz / geosci-labs

collection of notebook-apps for concepts in applied geophysics
https://geosci.xyz
MIT License
50 stars 34 forks source link

Fix_PF #10

Closed fourndo closed 5 years ago

fourndo commented 5 years ago

Fix for upstream change on SimPEG.PF

fourndo commented 5 years ago

@lheagy The notebooks will run, but will need to review the field orientation. The latest SimPEG.PF now uses the Cartesian (z+ up) system, so the z field might be flipped. Can you double check on your side. @sgkang : Took a quick look at the applet. Why is X (north)? Were you guys happy with this convention?

lheagy commented 5 years ago

Thanks @fourndo. It looks like there are a couple more that might still need to be updated based on the travis fail (https://travis-ci.org/geoscixyz/geosci-labs/jobs/483694107)

AttributeError: module 'SimPEG.PF.Magnetics' has no attribute 'calcRow'


- Mag_Induced2D.ipynb

~/build/geoscixyz/geosci-labs/geoscilabs/mag/Mag.py in Intrgl_Fwr_Op(xn, yn, zn, rxLoc) 159 for ii in range(ndata): 160 --> 161 tx, ty, tz = PF.Magnetics.calcRow(Xn, Yn, Zn, rxLoc[ii, :]) 162 163 G[ii, :] = tx / 1e-9 * mu_0

AttributeError: module 'SimPEG.PF.Magnetics' has no attribute 'calcRow'


- MagneticPrismApplet.ipynb

~/build/geoscixyz/geosci-labs/geoscilabs/mag/Mag.py in Intrgl_Fwr_Op(xn, yn, zn, rxLoc) 159 for ii in range(ndata): 160 --> 161 tx, ty, tz = PF.Magnetics.calcRow(Xn, Yn, Zn, rxLoc[ii, :]) 162 163 G[ii, :] = tx / 1e-9 * mu_0 AttributeError: module 'SimPEG.PF.Magnetics' has no attribute 'calcRow'



Would you mind taking a look at these? 
lheagy commented 5 years ago

cc @dougoldenburg on the conversation about sign conventions

fourndo commented 5 years ago

@lheagy That's really weird because I am running it locally from simpeg\master, and calcRow is definitely the new call. Is travis running on the latest master?

I think some of the other notebooks are failing for other reasons. I ll keep pushing.

lheagy commented 5 years ago

ah, maybe the deploy to pypi on SimPEG is behind. I will check

lheagy commented 5 years ago

The upload to pypi of SimPEG fixed most of the errors, but there is one more lingering. @fourndo, did plot_obs_2D get renamed?

AttributeError: module 'SimPEG.PF.Magnetics' has no attribute 'plot_obs_2D' 
fourndo commented 5 years ago

Yep totally, just relying on Utils.plot_utils. I ll do the change once i m back at the office

fourndo commented 5 years ago

@lheagy Can you provide details for the Style test that's failing?

lheagy commented 5 years ago

@fourndo: yep, all you need to do is run make format from the root directory of this repo. Then to check that all the style checks pass you can run make check and then make lint (those are the two tests that are run on travis)

lheagy commented 5 years ago

You might run into some import errors if you do not have black, flake8, and pylint installed. All are available through a pip install

fourndo commented 5 years ago

Do you have a make.bat?

lheagy commented 5 years ago

no, I don't... but if windows is giving you problems, you should be able to copy-paste the commands from the makefile to a command line and run them instead of using the makefile. I can look into what is needed for a make.bat in the mean time.

fourndo commented 5 years ago

No probs. Sorry didn't manage to get black and flake8 running.

lheagy commented 5 years ago

no worries, we can chat about it next week at the mtg (would be nice to implement on discretize down the road)