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

Feature: user API improvements #39

Open
3 tasks
chrisbc opened this issue Jan 22, 2024 · 0 comments
Open
3 tasks

Feature: user API improvements #39

chrisbc opened this issue Jan 22, 2024 · 0 comments
Assignees
Labels
LIB for filtering nzshm-model for filtering

Comments

@chrisbc
Copy link
Member

chrisbc commented Jan 22, 2024

as API user I want some simple, documented API helper methods that make it easier it easier to extract useful information from the model:

for example:

>>> def get_branch_set(short_name:str):
...     for branch_set in model.source_logic_tree().fault_system_lts:
...         if branch_set.short_name == short_name:
...             return branch_set

>>> for b in get_branch_set('CRU').branches:
...     print( b.inversion_solution_id, b.values )
...
U2NhbGVkSW52ZXJzaW9uU29sdXRpb246MTIwNzIy [dmgeodetic, tdFalse, bN[0.823, 2.7], C4.2, s0.66]
U2NhbGVkSW52ZXJzaW9uU29sdXRpb246MTIwNzE3 [dmgeodetic, tdFalse, bN[0.823, 2.7], C4.2, s1.0]
...

find a similar libraries and select an appropriate pattern from those (agree with chrisbc and chrisdc)

Suggestions:

  • improve listing / accessing the models
  • improve branch set retrieval (as above).
  • help and/or docs for accessing and interpreting the various dataclass attributes. (custom repr() ??)
@chrisbc chrisbc added nzshm-model for filtering LIB for filtering labels Jan 22, 2024
@chrisbc chrisbc self-assigned this Feb 15, 2024
@chrisdicaprio chrisdicaprio reopened this Jun 5, 2024
@chrisdicaprio chrisdicaprio self-assigned this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LIB for filtering nzshm-model for filtering
Projects
None yet
Development

No branches or pull requests

2 participants