This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Fortran backend for 1D EM forward modelling and Numpy broadcasting #22
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
cd5c127
Removed np.empty statements when the next line would recast the varia…
68f2a39
Added 3 new functions. Piecewise ramp fast uses Numpy broadcasting f…
3f7d08f
Added single layer flags to half-switch so no need to specify.
98d7e39
Updated forward modelling to use Piecewise_Pulse_Fast
f21906f
minor
f98e0f8
Added Fortran module for forward and sensitivity calculations
a20954b
Inputs to forward modelling must be in Fortran order to get efficient…
8d83d1f
Added Fortran extension to setup.py. On my Mac, I could not get pip …
e7b6529
Removed unused variables
255f5d0
version update
2fe95e6
Merge branch 'speed_up_leon' into master
sgkang 3f76463
Merge pull request #19 from leonfoks/master
sgkang 6ad4342
add import setuptools
508cef4
add fortran
d08c212
minor change
39d4cf5
blah..
045d8de
add pip install
52f4fdf
add fortran
37f9f8c
minor fix
47e2b61
blah
20d92e5
update travis.ml
25d4e39
minor fix
d0917d4
...
5a53afc
update notebooks
63653bc
tests parallel version
a3d1943
add make build
2cfaa11
minor fix
20bb56e
minor fix
b66a0a6
add make build
ceeace8
add try and except statement for fortran
c546fea
add gcc
afa21c6
fix time range bug in Survey.py
d8aca20
pep8 clean up
7fc58f0
back to piecewise_pulse_fast
73735de
minor update
79a6ea5
back master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
.PHONY: tests clean | ||
.PHONY: build tests clean deploy | ||
|
||
build: | ||
python setup.py build_ext -i -b . | ||
|
||
tests: | ||
nosetests --logging-level=INFO | ||
|
||
clean: | ||
find . -name "*.pyc" | xargs -I {} rm -v "{}" | ||
find . -name "*.pyc" | xargs -I {} rm -v "{}" | ||
|
||
deploy: | ||
python setup.py sdist bdist_wheel upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
538 changes: 134 additions & 404 deletions
538
notebooks/develop/Test_global_em1d_inversion_booky_example.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
463 changes: 104 additions & 359 deletions
463
notebooks/examples/EM1D_inversion_FD_height_correction.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
116 changes: 69 additions & 47 deletions
116
notebooks/examples/EM1D_inversion_FD_height_correction_halfspace.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
520 changes: 256 additions & 264 deletions
520
notebooks/examples/EM1D_inversion_TD_layers_dual_moment.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,10 @@ | |
simpegEM1D is the package for simulation and inversion of | ||
electromagnetic data using 1D layered-earth solution. | ||
""" | ||
|
||
from distutils.core import setup | ||
import setuptools | ||
from numpy.distutils.core import setup, Extension | ||
from setuptools import find_packages | ||
|
||
|
||
CLASSIFIERS = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Education', | ||
|
@@ -29,24 +28,41 @@ | |
with open('README.md') as f: | ||
LONG_DESCRIPTION = ''.join(f.readlines()) | ||
|
||
fExt = [Extension(name='simpegEM1D.m_rTE_Fortran', # Name of the package to import | ||
sources=['simpegEM1D/Fortran/m_rTE_Fortran.f90'], | ||
# extra_f90_compile_args=['-ffree-line-length-none', | ||
# '-O3', | ||
# '-finline-functions', | ||
# '-funroll-all-loops', | ||
# '-DNDEBUG', | ||
# '-g0'], | ||
extra_link_args=['-ffree-line-length-none', | ||
'-O3', | ||
'-finline-functions', | ||
'-funroll-all-loops', | ||
'-g0'], | ||
) | ||
] | ||
|
||
|
||
setup( | ||
name = 'simpegEM1D', | ||
version = '0.0.13', | ||
packages = find_packages(), | ||
install_requires = [ | ||
name='simpegEM1D', | ||
version='0.0.15', | ||
packages=find_packages(), | ||
install_requires=[ | ||
'SimPEG>=0.4.1', | ||
'empymod>=1.6.2', | ||
'multiprocess' | ||
], | ||
author = 'Seogi Kang', | ||
author_email = '[email protected]', | ||
description = 'simpegEM1D', | ||
long_description = LONG_DESCRIPTION, | ||
keywords = 'geophysics, electromagnetics', | ||
author='Seogi Kang', | ||
author_email='[email protected]', | ||
description='simpegEM1D', | ||
long_description=LONG_DESCRIPTION, | ||
keywords='geophysics, electromagnetics', | ||
url='https://github.com/simpeg/simpegEM1D', | ||
download_url='https://github.com/simpeg/simpegEM1D', | ||
classifiers=CLASSIFIERS, | ||
platforms = ['Windows', 'Linux', 'Solaris', 'Mac OS-X', 'Unix'], | ||
platforms=['Windows', 'Linux', 'Solaris', 'Mac OS-X', 'Unix'], | ||
license='MIT License', | ||
use_2to3 = False, | ||
ext_modules=fExt | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leonfoks what are these commented lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally you put the fortran compile flags in the extra_f90_compile_args attribute, but it was not being recognized for some reason so I put them in the extra_link_args instead. You can delete these, but i left them commented to remind that this was the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I'll remove them.