Skip to content

Commit

Permalink
Clean up pylint warnings and fix doc issues
Browse files Browse the repository at this point in the history
Fixes include:
- Copying config files from tests to docs
- Refactor sparse matrix aggregation code
- Add docstrings
- Refactor surface writing functions
- Fix minor issue causing numpy to complain
  • Loading branch information
vegardkv committed Jun 29, 2022
1 parent a5c5428 commit f22ba40
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 232 deletions.
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@
REQUIREMENTS_DOCS = setupx.parse_requirements("requirements/requirements_docs.txt")
REQUIREMENTS_EXTRAS = {"tests": REQUIREMENTS_TESTS, "docs": REQUIREMENTS_DOCS}

HC_FUNCTION = "grid3d_hc_thickness=xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness:main"
AVG_FUNCTION = "grid3d_average_map=xtgeoapp_grd3dmaps.avghc.grid3d_average_map:main"
AGG_FUNCTION = "grid3d_aggregate_map=xtgeoapp_grd3dmaps.avghc.grid3d_aggregate_map:main"
MIG_FUNCTION = "grid3d_migration_time=xtgeoapp_grd3dmaps.avghc.grid3d_migration_time:main"
HC_FUNCTION = (
"grid3d_hc_thickness=xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness:main"
)
AVG_FUNCTION = (
"grid3d_average_map=xtgeoapp_grd3dmaps.avghc.grid3d_average_map:main"
)
AGG_FUNCTION = (
"grid3d_aggregate_map=xtgeoapp_grd3dmaps.aggregate.grid3d_aggregate_map:main"
)
MIG_FUNCTION = (
"grid3d_migration_time=xtgeoapp_grd3dmaps.aggregate.grid3d_migration_time:main"
)


def src(anypath):
Expand Down
6 changes: 6 additions & 0 deletions src/xtgeoapp_grd3dmaps/aggregate/_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=missing-class-docstring
"""
Configuration for the `aggregate` module. Starting from `RootConfig`, it is possible to
deduce mandatory and optional parameters, as well as default values for whatever is not
Expand All @@ -9,6 +10,9 @@


class AggregationMethod(Enum):
"""
Enum representing the available aggregation methods for `grid3d_aggregate_map`
"""
MAX = "max"
MIN = "min"
MEAN = "mean"
Expand Down Expand Up @@ -65,6 +69,7 @@ class ComputeSettings:

def __post_init__(self):
if isinstance(self.aggregation, str):
# pylint: disable=no-member
self.aggregation = AggregationMethod(self.aggregation.lower())
if self.all is False and self.zone is False:
raise ValueError(
Expand All @@ -74,6 +79,7 @@ def __post_init__(self):

@dataclass
class MapSettings:
# pylint: disable=too-many-instance-attributes
xori: Optional[float] = None
xinc: Optional[float] = None
yori: Optional[float] = None
Expand Down
Loading

0 comments on commit f22ba40

Please sign in to comment.