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

Module names #153

Closed
wants to merge 4 commits into from
Closed

Module names #153

wants to merge 4 commits into from

Conversation

lheagy
Copy link
Member

@lheagy lheagy commented Apr 24, 2019

  • use lower case names for modules (TensorMesh.py --> tensor_mesh.py)
  • note that this doesn't change the import structure of discretize.
    from discretize import TensorMesh
    
    still works as expected
  • to run the TreeMesh, you will need to re-install
     python setup.py build_ext --inplace
    

Todos:

  • fix the slicer example: the shelve is not unpacking correctly because of this change. @prisae, would you be willing to help update this example?

@prisae
Copy link
Member

prisae commented Apr 26, 2019

I tried to run the laguna_del_maule notebook, but due to your changes this doesn't work either, I think.

If you can do it, all you have to do is to put these lines after the inversion:

with shelve.open('./laguna_del_maule-result') as db:
    db['mesh'] = mesh
    db['Lpout'] = Lpout

This will generate you a new archive, which you can upload then instead of the existing.

@prisae
Copy link
Member

prisae commented Apr 26, 2019

The error I get, in case that helps you:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-cc408050a04a> in <module>
      2 import shutil
      3 import tarfile
----> 4 import SimPEG.PF as PF
      5 from SimPEG import (
      6     Maps, Regularization, Optimization, DataMisfit,

~/anaconda3/lib/python3.7/site-packages/SimPEG/__init__.py in <module>
      3 
      4 import discretize as Mesh
----> 5 from discretize import Tests
      6 
      7 from . import Maps

ImportError: cannot import name 'Tests' from 'discretize' (/home/dtr/Codes/discretize/discretize/__init__.py)

Edit: So maybe these changes affect more examples than you thought...

@codecov
Copy link

codecov bot commented Jul 24, 2019

Codecov Report

Merging #153 into master will decrease coverage by 12.96%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #153       +/-   ##
===========================================
- Coverage    82.1%   69.14%   -12.97%     
===========================================
  Files          23       20        -3     
  Lines        4974     4028      -946     
===========================================
- Hits         4084     2785     -1299     
- Misses        890     1243      +353
Impacted Files Coverage Δ
discretize/mesh_io.py 91.73% <ø> (ø)
discretize/view.py 17.95% <100%> (ø)
discretize/inner_products.py 97.42% <100%> (ø)
discretize/differential_operators.py 74.02% <100%> (ø)
discretize/tests.py 78.64% <100%> (ø)
discretize/curvilinear_mesh.py 99.4% <100%> (ø)
discretize/tree_mesh.py 47.41% <100%> (ø)
discretize/utils/io_utils.py 8.88% <0%> (-51.12%) ⬇️
discretize/utils/meshutils.py 77.94% <0%> (-15.45%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd7c205...0e21f1c. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 24, 2019

Codecov Report

Merging #153 into master will decrease coverage by 12.96%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #153       +/-   ##
===========================================
- Coverage    82.1%   69.14%   -12.97%     
===========================================
  Files          23       20        -3     
  Lines        4974     4028      -946     
===========================================
- Hits         4084     2785     -1299     
- Misses        890     1243      +353
Impacted Files Coverage Δ
discretize/mesh_io.py 91.73% <ø> (ø)
discretize/view.py 17.95% <100%> (ø)
discretize/inner_products.py 97.42% <100%> (ø)
discretize/differential_operators.py 74.02% <100%> (ø)
discretize/tests.py 78.64% <100%> (ø)
discretize/curvilinear_mesh.py 99.4% <100%> (ø)
discretize/tree_mesh.py 47.41% <100%> (ø)
discretize/utils/io_utils.py 8.88% <0%> (-51.12%) ⬇️
discretize/utils/meshutils.py 77.94% <0%> (-15.45%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd7c205...0e21f1c. Read the comment docs.

@jcapriot jcapriot closed this Nov 17, 2020
@jcapriot jcapriot deleted the module-names branch November 17, 2020 20:03
@prisae
Copy link
Member

prisae commented Nov 18, 2020

Closed as it was superseded by #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants