Coder Social home page Coder Social logo

ps2ff's Introduction

This respository has moved to gitlab and will be archived.

Use the following repository for the latest version of the code, reporting new issues, or sending merge requests: https://code.usgs.gov/ghsc/esi/ps2ff

ps2ff's People

Contributors

cbworden avatar emartinez-usgs avatar emthompson-usgs avatar mhearne-usgs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps2ff's Issues

Incorrect paths listed in tests

In the test cases, there are a number of paths listed like:

    r2 = pd.read_csv(
        "TestData/Rjb_WC94_mechA_ar1p7_seis0_20_Ratios.csv",
        header=6)
    v2 = pd.read_csv(
        "TestData/Rjb_WC94_mechA_ar1p7_seis0_20_Var.csv",
        header=6)

However, the TestData directory isn't in the program structure.

Error in dimensions_from_magnitude, Mechanism.N, length computation?

One of these does not look like the others. The formulas used for each Mechanism are similar, so looking at this line for Mechanism.N, is there is a typographical error? Should this line:
length = 10**(-1.88 + 0.50 * M) + sig_length * epsmid
be this instead?
length = 10**(-1.88 + 0.50 * M + sig_length * epsmid)

Refactor code

We should refactor the code so that we don't have so much redundancy. This code is probably well suited to being subclasses of an abstract base class. Other suggestions by Peter:

  • Use enum types instead of strings to identify finite sets of options with specific names
    • e.g. mag-scaling relations
    • e.g. you can also use this for NP, with options like [one, n_minus_one, half, all] to obviate the need know how many cores one has (it’s not clear to me how the programs behaves when given bad options such as more cores than that actually available; perhaps it fails gracefully already).
  • Consider modularizing the work being done in the middle of the big loops so that the redundant code between programs is limited; you could also consider collapsing to a single program.

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.