Skip to main content

ANU Inversion Course Package

Project description

ANU Inversion Course Package

Build PyPI version

This package contains resources to be used in the inversion course practicals.

Table of contents

Getting started

1. Set up virtual environment

(optional) It's recommended to use a virtual environment (using conda or venv, etc.) so that it doesn't conflict with your other Python projects. Create a new environment with

conda create -n inversion_course python=3.10 scipy

and enter that environment with

conda activate inversion_course

and if you are on MacOS M1 chip:

conda install -c conda-forge gfortran

2. Dependency

If you are on Linux/Windows and have followed above step to install scipy using conda, then feel free to skip this step.

This package requires you to have gfortran (or at least libgfortran on Linux/Windows) installed. Check this page (and notes below for MacOS) for instructions on how to install gfortran.

Notes for installing gfortran on MacOS

  1. Install XCode (from App Store)
  2. Install command line tools xcode-select --install
  3. For M1 chip: if you've set up a conda environment, then conda install -c conda-forge gfortran will work
  4. If step 3 doesn't suit you: follow the instructions in this page about how to install gfortran
Reasons for why we need `gfortran` (only) on MacOS
  • A Fortran compiler is needed for MacOS to build C/Fortran libraries from source, as wheels are not provided for MacOS due to a problem described here.
  • Fortran libraries (libgfortran.5.dylib) is also needed for other operating systems. Otherwise anu_inversion_course.rf will fail to import. If you've followed step one above to install scipy via conda, then libgfortran5 is downloaded so no further action is needed.
  • The issue on MacOS is possible to fix, but with some effort of uploading the package to conda, so this will be in future work

3. Installation

Type the following in your terminal:

pip install anu-inversion-course

4. Check

And when you run jupyter-lab to do the practicals, make sure you are in the same environment as where your anu-inversion-course was installed. You can try to test this by checking if the following commands give you similar result:

$ which pip
<some-path>/bin/pip
$ which jupyter-lab
<same-path>/bin/jupyter-lab
$ pip list | grep ANU-inversion-course
ANU-inversion-course               0.1.0

Troubleshooting

If you find problems importing anu_inversion_course.rf, try to search the error message you get. Here contains a nice explanation for the possible cause. And here is how to locate libgfortran:

gfortran --print-file-name libgfortran.5.dylib

Developer Notes

Check out NOTES.md if you'd like to contribute to this package.

  1. Getting started
  2. Cheatsheet
    1. conda environment
    2. git operations
    3. package development
    4. package metadata
    5. package building test & release
  3. Adding C/C++ extensions
  4. Adding Fortran extensions
  5. More references
  6. Appendix - semantic versioning

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ANU_inversion_course-0.1.0.dev8.tar.gz (1.5 MB view hashes)

Uploaded Source

Built Distributions

ANU_inversion_course-0.1.0.dev8-cp310-cp310-win_amd64.whl (183.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ANU_inversion_course-0.1.0.dev8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ANU_inversion_course-0.1.0.dev8-cp310-cp310-macosx_11_0_arm64.whl (208.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ANU_inversion_course-0.1.0.dev8-cp310-cp310-macosx_10_9_x86_64.whl (253.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ANU_inversion_course-0.1.0.dev8-cp39-cp39-win_amd64.whl (183.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ANU_inversion_course-0.1.0.dev8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ANU_inversion_course-0.1.0.dev8-cp39-cp39-macosx_11_0_arm64.whl (208.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ANU_inversion_course-0.1.0.dev8-cp39-cp39-macosx_10_9_x86_64.whl (253.0 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ANU_inversion_course-0.1.0.dev8-cp38-cp38-win_amd64.whl (183.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ANU_inversion_course-0.1.0.dev8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ANU_inversion_course-0.1.0.dev8-cp38-cp38-macosx_11_0_arm64.whl (208.1 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ANU_inversion_course-0.1.0.dev8-cp38-cp38-macosx_10_9_x86_64.whl (253.0 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page