This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
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.
Duplicated code is no good very bad.
impactutils hosts the rupture package because it is needed by other applicantions than shakemap; it also includes the distance module. These edits bring the impactutils code up to date with shakemap so that we can remove the dupclicated code in shakelib.
Note that this also updates the unit tests for rupture and distsance in impactutils and so they should be removed from shakemap. There are some exceptions:
test_rupture_depth
inrupture_test.py
must stay in shakemap because it uses maptio.test_exceptions
,test_distance_no_rupture
,test_distance_from_sites_origin
indistance_test.py
because they use Sitestest_EdgeRupture_vs_QuadRupture
inrupture_distance_tests.py
because it uses SitesI also had to move tensor.py from strec into impactutils because it is used by origin.py.
This also fixes the pandas future warning about append (closees #149). @gferragu, note that there is no concat method for a dataframe, it is a pandas method and the solution here is
newdf = pd.concat([newdf, tdf])
.