Code Monkey home page Code Monkey logo

Comments (6)

ChetGoerzen avatar ChetGoerzen commented on May 28, 2024

I am interested in helping with this. Would you like a function for all of the EMC-hosted reference Earth models? I plan on following a similar format to the fetch_prem function.

from rockhound.

leouieda avatar leouieda commented on May 28, 2024

Hi @ChetGoerzen, thanks for volunteering! I wonder if having a single function would make the documentation a bit cluttered. Ideally, the docstring should cite the reference for every model and include a description of each. It might make more sense to have separate functions for each one. The amount of code required is minimal and a majority of the work will be the docstrings (which we can't reuse between models anyway). What do you think?

@santisoler any opinions on this?

from rockhound.

ChetGoerzen avatar ChetGoerzen commented on May 28, 2024

Hi @leouieda, thanks for being so open to contributors. I think that having separate functions for each model sounds like a good idea. Would it be alright to include all these functions in one script? Also, would you like me to include all the earth models from http://ds.iris.edu/ds/products/emc-referencemodels/?

from rockhound.

leouieda avatar leouieda commented on May 28, 2024

Would it be alright to include all these functions in one script?

That would be fine. You could even move the PREM code into it. We generally import all functions in rockhound/__init__.py so the internal organization of modules doesn't matter to the user.

Also, would you like me to include all the earth models

Sure, that would be great. You can start with one to get the process down and add more later. What do you think?

from rockhound.

ChetGoerzen avatar ChetGoerzen commented on May 28, 2024

Hi @leouieda, I am close to completing the work for this issue. I think it may be easiest for me to submit a pull request once I have completed everything. When writing the tests I have experienced some of the tests failing due to what appears to be floating point error. Replacing the standard assert statement by using the numpy.testing.assert_almost_equal with precision up to six decimal places seems to have solved this problem. Is it alright for me to write my tests using this function and this precision?

from rockhound.

santisoler avatar santisoler commented on May 28, 2024

Hi @leouieda and @ChetGoerzen. Sorry for the delay. I agree with adding more reference models. A few of them are widely used among seismologists, like the iasp91 or ak135-f. So would be nice to have them in Rockhound.

@ChetGoerzen would you mind opening that PR? It doesn't matter if it's not finished, you could add WIP on the PR title (WIP: Work In Progress) so the WIP bot doesn't allow us to merge. It's easier to review code and discuss it on the PR interface.

When comparing numerical values we use numpy.testing.assert_allclose(...) instead of assert ... == ..., you are right about that! See the test_seafloor_age() function for example.

Thanks for taking the time to tackle this down!

from rockhound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.