Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic Feature: enhanced participation rate options #42

Closed
6 tasks done
Tracked by #30
chrisbc opened this issue Jul 23, 2024 · 2 comments
Closed
6 tasks done
Tracked by #30

Epic Feature: enhanced participation rate options #42

chrisbc opened this issue Jul 23, 2024 · 2 comments
Assignees

Comments

@chrisbc
Copy link
Member

chrisbc commented Jul 23, 2024

ref (GNS-Science/solvis-graphql-api#46 (comment))
and GNS-Science/kororaa#455

Our support for participation rate can be improved/formalisedrounded so that the various use cases for this concept are all supported, clearly defined and named well.

We want to be able to filter for fault participation rate. This is the combined rate for all subsections on that "parent" fault (i.e. the highest cumulative MFD rate for all subsections of the fault)`

Overview

There are 3) levels where we want to calculate and use Participation Rate values:

  1. at the subsection level
  2. at the fault level (aka ParentFault) level
  3. at the named-fault level - where named faults is a mapping from each fault (by name) to a parent named-fault
    NB this one needs the mapping data, which is not included in the NSHM_1.* inversion solutions.

And, there are two options when calculating rates:

  • A. the participation rate including all ruptures within the solution (i.e. the entire fault system )
    NB this option may be used as a filter criteria itself
  • B. the participation rate for a given set up ruptures - where the user had narrowed these down using some criteria. eg. i) just those ruptures intersecting a given a polygon, or ii) ruptures exceeding some magnitude, or iii) involving some particular fault.

see discussion in GNS-Science/solvis-graphql-api#59 where B is called the "Conditional Participation Rate" and A) the "Participation Rate"

Done Criteria

  • provide a dataframe series/function for each permutation of the discussion above:
    • subsection_participation_rate
    • fault_participation_rate
    • subsection_conditional_participation_rate
    • fault_conditional_participation_rate
  • update solvis documentation to explain all this
  • use caching where applicable to maximise performance

split out to new tickets

Related tickets:

@chrisbc chrisbc changed the title Feature: provide subsection participation rate filter Feature: enhanced participation rate options Aug 12, 2024
@chrisbc
Copy link
Member Author

chrisbc commented Aug 18, 2024

NamedFaults

The Rupture Set RmlsZToxMDAwODc= is used in all NSHM_V1.0.* crustal Inversion Solutions. This rupture set used the
fault_model: CFM_1_0A_DOM_SANSTVZ

and it looks like this is defined here: https://github.com/GNS-Science/nzshm-opensha/blob/main/src/main/resources/faultModels/cfm_1_0A_no_tvz.xml.FaultsByNameAlt.txt

TODO:

  • check that all the fault names in current NSHM model align wiht this mapping, and then ...
  • include this mapping in solvis (as a workaround to support the historic solutions)
  • ask for the mapping to be included in future opensha solutions

@chrisbc chrisbc self-assigned this Sep 12, 2024
@chrisbc chrisbc changed the title Feature: enhanced participation rate options Epic Feature: enhanced participation rate options Oct 22, 2024
chrisbc added a commit that referenced this issue Feb 10, 2025
closes  Feature: named_fault_participation_rate #49
closes Epic Feature: enhanced participation rate options #42
adds named_faults support to FilterParentFaultIds class
adds named _fault support to SolutionParticipation class

**commits:**
* WIP on named_fault support;
* fix some docstrings;
* WIP on new named_fault particiPation; needs test coverage;
* added test coverage for new functions. Updated fixture to include data for  named_fault testing;
* add support and test coverage for named_faults in subsection filter;
* update changelog;
* use cache instead of lru_cache
@chrisbc
Copy link
Member Author

chrisbc commented Feb 10, 2025

closed by #67

@chrisbc chrisbc closed this as completed Feb 10, 2025
chrisbc added a commit that referenced this issue Feb 27, 2025
* new fault_system_solution_helper module
* a simple rupture grouping algo;
* drop_zero_rate differentiates between FSS and IS;
* refactor subsection filter & tests
* migrate to filter_rupture_ids.for_subsections();
* migrate to filter_rupture_ids.for_parent_fault_ids();
* fixed method names; added doc page for subsection_id_filter;
* refactor filter tests; WIP on DeprecationWarnings; new filter_parent_fault_ids; detox
* fixing many deprecation warnings; updated geopandas, pandas, numpy, pyvista libs; changes to read_csv_dtype configuration; detox
* refactor filters int package; more test cover; implement new filters; migrate old functions and deprecate warn the originals;
* unifying filter methods; improve docstrings & tests;
* implement rate and mag filtering on rupture_id_filter;
* migrate find rupture polygons into filter class; move drop_zero_rates into class init;
* implement ChainableSetBase; migrate FilterRuptureIds to be chainable;
* add set operation support for chaining (join_prior) and test coverage;
* join arguments tidied up; strings and ENUMS are supported;
* fix set operand method names;
* fix set operations return type
* implement set operands for supported set methods; improve docs
* merge 3d geometry changes from @voj; add some testing;
* new participation rate functions; detox
* test 3d surfaces
* migrate participation functions into classes proper; add FSS section_participation;
* make subsection_id_filter chainable;
* added participation methods to fault_system_solution
* simplify FSS participation using rate_weighted_mean; refactor dataframe dtypes; participation performance testing;
* standardise participation functions API and return column;
* fix rate_column; add .all() methods to filter classes;
* add TinyInversionSolution fixture; tune pytest fixture scoping for massive test speed up (~3 times faster);
* doc and docstrings improvements; Better typing in filter package;
* more on rupture_grouping
* add module docstring to inversion_solution_file;
* adding dataframe schema validations with panderas;
* WIP, adding InversionSolutionFile::RuptureRateSchema;
* Feature/52 refactor inversion solution (#53)
* Chore/54 test coverage (#55)
* Chore/59 doc fixes (#61)
* make parent fault filter chainable (#66)
* fix for #57 (return int type for polygons);
* update pytz dep (#69)
* Feature/49 named fault participation (#67)
* Feature: named_fault_participation_rate #49
* Epic Feature: enhanced participation rate options #42
* refactor to remove *Protocol superclasses (#73)
* refactor to remove *Protocol superclasses; migrate and improve docstrings; detox
* Feature/71 scale rupture rates (#74)
* fold in changes suggested by @chrisdicaprio on PR #73;
* fix drop_zero_rates on FilterRuptureIds.for_magnitude(); 
* fix for_parent_fault_ids
* fix test_ruptures_for_subsections
* fix for_rupture_rate
* fix for_polygon ; fix impacted tests;
* Bump version: 0.13.0 → 1.0.0-alpha
* add joint_type arg to relevant FilterRuptureId class methods (#80)
* add joint_type arg to `for_parent_fault_names` *  `for_parent_fault_ids`; add tolist() convenience method;
* refactor for readability/efficiency; add full test coverage for new arg;
* add `join_type` arg to `for_subsection_ids` (working but a little slow); detox;
* rename arg for consistency
* refactoring; new docstrings; named_faults support; detox;
* remove commented line
* changelog entry;
* Bump version: 1.0.0-alpha → 1.0.0-beta
* align version ids
* Chore/82 make docs and api align (#83)
* Bump version: 1.0.0-beta-0 → 1.0.0

---------

Co-authored-by: Chris DiCaprio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant