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/52 refactor inversion solution #53

Open
wants to merge 19 commits into
base: pre-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.13.0
current_version = 0.12.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we go down to 0.12.3 from 0.13.0?

commit = True
tag = True

Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version in changelog no longer consistent with package version

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
- drop_zero_rate differentiates between FSS and IS;
- faster testing (~3 times faster)
- documentation improvements
- abc427e fixing many deprecation warnings; updated geopandas, pandas, numpy, pyvista libs;
- read_csv dtype configuration improvements;
- fix many deprecation warnings
- updated dependencies: geopandas, pandas, numpy, pyvista libs
- read_csv dtype configuration improvements
- many old functions are deprecated/migrated to new filter package
- refactor dataframe dtypes
- standardise participation functions API and return columns;
- standardise participation functions API and return columns
- refactor `solvis.inversion_solution` package to `solvis.solution` and collect modules into packages
- new packages `solvis.solution.inversion_solution` and `solvis.solution.fault_system_solution`

## Added
- new filter package providing classes for filtering solutions
Expand All @@ -21,6 +24,10 @@
- a simple rupture grouping algorithm (can this be a different type of filter??);
- `pandera` library for dataframe model validations and better docs

## Removed
- deprecated `solvis.solvis` functions removed.
- deprecated `solvis.inversion_solution.*` functions/methods removed.

## [0.12.3] 2024-07-04
bump version to verify new pypi workflow

Expand Down
1 change: 0 additions & 1 deletion docs/api/inversion_solution/composite_solution.md

This file was deleted.

44 changes: 0 additions & 44 deletions docs/api/inversion_solution/dataframe_models.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/inversion_solution/fault_system_solution.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/inversion_solution/fault_system_solution_file.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/inversion_solution/index.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/api/inversion_solution/inversion_solution.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/inversion_solution/named_fault.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/inversion_solution/solution_surfaces_builder.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/inversion_solution/typing.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/api/solution/composite_solution.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the log var member of the module is in the docs. Could be suppressed to improve doc readability? This happens in other module doc pages, as well.

image

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.composite_solution
44 changes: 44 additions & 0 deletions docs/api/solution/dataframe_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
::: solvis.solution.dataframe_models
options:
inherited_members: false
members: false

::: solvis.solution.dataframe_models.FaultSectionSchemaBase
options:
members: false

::: solvis.solution.dataframe_models.FaultSectionSchema
options:
members: false

::: solvis.solution.dataframe_models.FaultSectionRuptureRateSchema
options:
members: false

::: solvis.solution.dataframe_models.FaultSectionWithSolutionSlipRate
options:
members: false

::: solvis.solution.dataframe_models.ParentFaultParticipationSchema
options:
members: false

::: solvis.solution.dataframe_models.RuptureSectionSchema
options:
members: false

::: solvis.solution.dataframe_models.RuptureSectionsWithRuptureRatesSchema
options:
members: false

::: solvis.solution.dataframe_models.RupturesWithRuptureRatesSchema
options:
members: false

::: solvis.solution.dataframe_models.SectionParticipationSchema
options:
members: false

::: solvis.solution.dataframe_models.RuptureRateSchema
options:
members: false
13 changes: 13 additions & 0 deletions docs/api/solution/fault_system_solution/fault_system_solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
::: solvis.solution.fault_system_solution.fault_system_solution
<!-- options:
members: false

::: solvis.solution.fault_system_solution.FaultSystemSolution
options:
inherited_members: false
members_order: alphabetical
filters:
- "![A-Z]+"
- "!set_props"
- "!^_"
group_by_category: false -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WARNING string in this module is formatted poorly by mkdocs. Wonder if it can be suppressed from showing up (not necessary for docs), perhaps by being explicit about what members of the module to document.
image

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.fault_system_solution.fault_system_solution_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
::: solvis.solution.fault_system_solution.fault_system_solution_model
options:
members: false

::: solvis.solution.fault_system_solution.fault_system_solution_model.FaultSystemSolutionModel
options:
inherited_members: true
filters:
- "!^_[^_]"
- "!^get_" # Deprecated function signatures
members_order: alphabetical
group_by_category: false
1 change: 1 addition & 0 deletions docs/api/solution/fault_system_solution/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.fault_system_solution
1 change: 1 addition & 0 deletions docs/api/solution/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution
1 change: 1 addition & 0 deletions docs/api/solution/inversion_solution/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.inversion_solution
3 changes: 3 additions & 0 deletions docs/api/solution/inversion_solution/inversion_solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: solvis.solution.inversion_solution.inversion_solution


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments about the fault_system_solution_file.md

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
::: solvis.inversion_solution.inversion_solution_file
::: solvis.solution.inversion_solution.inversion_solution_file
<!-- options:
docstring_options:
ignore_init_summary: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
::: solvis.inversion_solution.inversion_solution_operations
::: solvis.solution.inversion_solution.inversion_solution_model
options:
members: false

::: solvis.inversion_solution.inversion_solution_operations.InversionSolutionOperations
::: solvis.solution.inversion_solution.inversion_solution_model.InversionSolutionModel
options:
inherited_members: false
filters:
Expand All @@ -11,7 +11,7 @@
members_order: alphabetical
group_by_category: false

::: solvis.inversion_solution.inversion_solution_operations.CompositeSolutionOperations
::: solvis.solution.inversion_solution.inversion_solution_model.CompositeSolutionModel
options:
inherited_members: false
members_order: alphabetical
1 change: 1 addition & 0 deletions docs/api/solution/named_fault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.named_fault
1 change: 1 addition & 0 deletions docs/api/solution/solution_surfaces_builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.solution_surfaces_builder
1 change: 1 addition & 0 deletions docs/api/solution/typing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: solvis.solution.typing
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ A typical Solvis investigation starts with reading an archive into a solution ob

Depending on the data type, you will need to use one of:

- [`FaultSystemSolution.from_archive(instance_or_path)`][solvis.inversion_solution.fault_system_solution.FaultSystemSolution.from_archive]
- [`InversionSolution.from_archive(instance_or_path)`][solvis.inversion_solution.inversion_solution.InversionSolution.from_archive]
- [`CompositeSolution.from_archive(instance_or_path, slt)`][solvis.inversion_solution.composite_solution.CompositeSolution.from_archive]
- [`FaultSystemSolution.from_archive(instance_or_path)`][solvis.solution.fault_system_solution.FaultSystemSolution.from_archive]
- [`InversionSolution.from_archive(instance_or_path)`][solvis.solution.inversion_solution.InversionSolution.from_archive]
- [`CompositeSolution.from_archive(instance_or_path, slt)`][solvis.solution.composite_solution.CompositeSolution.from_archive]

Composite solutions require selecting an NSHM model version (usually 1.0.4), and constructing a
solution from its source logic tree.
Expand Down
34 changes: 22 additions & 12 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ nav:
- rupture_id_filter: api/filter/rupture_id_filter.md
- subsection_id_filter: api/filter/subsection_id_filter.md
- chainable_set_base: api/filter/chainable_set_base.md
- inversion_solution:
- api/inversion_solution/index.md
- Dataframe Models: api/inversion_solution/dataframe_models.md
- Inversion Solution: api/inversion_solution/inversion_solution.md
- Fault System Solution: api/inversion_solution/fault_system_solution.md
- Composite Solution: api/inversion_solution/composite_solution.md
- Supporting modules:
- api/inversion_solution/fault_system_solution_file.md
- api/inversion_solution/inversion_solution_file.md
- api/inversion_solution/inversion_solution_operations.md
- api/inversion_solution/solution_surfaces_builder.md
- api/inversion_solution/typing.md
- solution:
- api/solution/index.md
- composite_solution: api/solution/composite_solution.md
- fault_system_solution:
- api/solution/fault_system_solution/index.md
- api/solution/fault_system_solution/fault_system_solution.md
- api/solution/fault_system_solution/fault_system_solution_file.md
- api/solution/fault_system_solution/fault_system_solution_model.md
- inversion_solution:
- api/solution/inversion_solution/index.md
- api/solution/inversion_solution/inversion_solution.md
- api/solution/inversion_solution/inversion_solution_file.md
- api/solution/inversion_solution/inversion_solution_model.md
- dataframe_models: api/solution/dataframe_models.md
- solution_surfaces_builder: api/solution/solution_surfaces_builder.md
- typing: api/solution/typing.md
- config [module]: api/solvis/config.md
- geometry [module]: api/solvis/geometry.md
- solvis [module]: api/solvis/solvis.md
Expand Down Expand Up @@ -104,6 +108,12 @@ plugins:
annotations_path: source
# show_source: true

extensions:
- pydantic: {schema: true}
- solvis/dochelper/extension.py:DynamicDocstrings:
object_paths: [solvis.solution.inversion_solution.InversionSolution]


extra:
social:
- icon: fontawesome/brands/github
Expand Down
Loading
Loading