Giter VIP home page Giter VIP logo

opensha-core's Introduction

OpenSHA

Primary OpenSHA code repository

Build Status

Build Status Test Status Server Status
This tests for compile errors on the master branch This runs our standard test suite on the master branch This runs every 6 hours and tests that our server at opensha.usc.edu is accessible and web services are working

Compilation and project configuration

This repository contains OpenSHA code and model implementations. This project is intended for the core APIs and stable models. Exploratory code or one-off tests should instead go in our development sandbox, opensha-dev, which has this project as a dependency.

Requirements

Other dependencies are managed with Gradle, which does not require a separate installation. Gradle is clever about finding Java, but some users may have to explicitly define a JAVA_HOME environment variable.

Cloning in a terminal

To clone this project in a terminal (simplest and quickest for most users):

cd ~/git # create this directory or navigate an alternative directory of your choosing
git clone https://github.com/opensha/opensha.git

Building in a terminal with Gradle

OpenSHA uses Gradle to handle the build process from dependency management to compilation. You should compile OpenSHA from your lowest level project, opensha-dev for the example above.

cd opensha
./gradlew assemble

This will build all source files in opensha. It will also build a jar file for each project, not including any dependencies. You can build a "fat jar" which includes dependent libraries as follows:

cd opensha
./gradlew fatJar

Developing & building OpenSHA with Eclipse

Most active OpenSHA development is done through Eclipse. You will need the Eclipse IDE for Java Developers.

NOTE: The following instructions assume that you have already cloned the OpenSHA projects on a terminal, though you can clone them through Eclipse. If you chose to go this route, be sure to leave the "Import all existing Eclipse projects after clone finishes" check-box UNSELECTED, as this feature will cause issues with gradle.

Once you have eclipse installed and running, do the following:

  • File > Import
  • Select Gradle > Existing Gradle Project and hit Next
  • Browse to the location of opensha under Project root directory
  • Hit Finish

You can either use Eclipse's built in Git tools, or the Git command line client to pull/push changes. Any time any of the .gradle files are modified, or you see many unexpected compilation errors, right click on the project within eclipse and select Gradle > Refresh Gradle Project.

Repository history

OpenSHA has been in active development since the early 2000's. It was originally in CVS version control, and was ported to this SVN repository circa 2008. In 2017, it was migrated to GitHub and split into a number of sub-projects. History from the SVN repository was not retained, but it is archived here. The main codebase, which was re-unified into this repository in 2021, was previously stored in the now-archived opensha-commons, opensha-core, opensha-ucerf3, and opensha-apps.

A development sandbox, with which we're more relaxed with write-permissions, can be found here. Otherwise, outside contributions should come in the form of pull requests on this repository.

opensha-core's People

Contributors

chrisbc avatar field-usgs avatar jasonmotha avatar kevinmilner avatar mbarall avatar pmpowers-usgs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

opensha-core's Issues

Building subsections for crustal faults

The subsections would generally have length shorter than 0.5 times the down-dip width (DDW), if maxSubSectionLen is defined 0.5 DDW. In turn, the combined length of 2 subsections would be shorter than DDW. This implies that rupture length for considered smallest magnitude (at least 2 subsections) would be shorter than rupture width (unless AseismicSlipFactor is not zero).

When fault-dip is 90 degrees, seismogenic thickness would be the same as DDW. It is then possible that the consideration: “requiring at least 2 subsections ensures that the minimum rupture lengths are approximately equal to the seismogenic thickness (Main report UCERF3, p27)” may not hold.

On the other hand, what if we define the subsection length to be at least 0.5 DDW as follows:

traceLength = faultTrace.getTraceLength();
dL = 0.5*DDW;
numSubSec = (int) traceLength/dL;
dF = (traceLength - (numSubSec*dL))/numSubSec;
sectionLength = dL+dF;

Would not this simply the procedure to build the subsections.

Test suite compile failing

On: commit bf9ee39

when I run: ./gradlew test

I see

> Task :compileTestJava FAILED
/home/chrisbc/DEV/GNS/opensha/opensha-core/test/org/opensha/sra/SRA_Suite.java:5: error: cannot find symbol
import org.opensha.commons.util.InterpolateTests;
                               ^
  symbol:   class InterpolateTests
  location: package org.opensha.commons.util
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
6 actionable tasks: 1 executed, 5 up-to-date
chrisbc@hushtwo:~/DEV/GNS/opensha/opensha-core$ 

Observations

As a workaround I've commented out this import, since it doesn't appear to be used in the Suite anyway. After this tests built OK.

Three failing tests

after applying workaround as per #10 the tests now run with failures

on: commit bf9ee39e25661e8b7e78a86e055cabc89a2e6ae9

when I run: ./gradlew test

I see:

> Task :compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :test

org.opensha.sha.imr.attenRelImpl.test.AttenRelTestsSuite > org.opensha.sha.imr.attenRelImpl.test.MultiIMR_ParamTest.testInitialConsist FAILED
    org.opensha.commons.exceptions.ConstraintException at MultiIMR_ParamTest.java:84

org.opensha.sha.imr.attenRelImpl.test.AttenRelTestsSuite > org.opensha.sha.imr.attenRelImpl.test.MultiIMR_ParamTest.testChangeProp FAILED
    org.opensha.commons.exceptions.ConstraintException at MultiIMR_ParamTest.java:92

org.opensha.sha.imr.attenRelImpl.test.AttenRelTestsSuite > org.opensha.sha.imr.attenRelImpl.test.MultiIMR_ParamTest.testSetIMTs FAILED
    org.opensha.commons.exceptions.ConstraintException at MultiIMR_ParamTest.java:66

2959 tests completed, 3 failed

> Task :test FAILED

FAILURE: Build failed with an exception.

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.