Skip to content

Commit

Permalink
aligned with original v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengp0 committed Nov 21, 2024
1 parent 7d75bff commit 8512d85
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/pydisagg/ihme/splitter/age_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ def columns(self) -> list[str]:
def val_fields(self) -> list[str]:
return ["val"]

def apply_prefix(self) -> dict[str, str]:
rename_map = {}
for field in self.val_fields:
new_field_val = self.prefix + (field_val := getattr(self, field))
rename_map[field_val] = new_field_val
setattr(self, field, new_field_val)
return rename_map

def remove_prefix(self) -> None:
for field in self.val_fields:
setattr(self, field, getattr(self, field).removeprefix(self.prefix))


class AgePatternConfig(Schema):
by: list[str]
Expand Down Expand Up @@ -171,9 +159,11 @@ def parse_pattern(

# Validate for NaN values
validate_nonan(pattern, name)
validate_positive(
pattern, [self.pattern.val_sd], name, strict=positive_strict
)

# Validate for negative values in val_sd
validate_positive(pattern, [self.pattern.val_sd], name, strict=False)

# Validate interval correctness
validate_interval(
pattern,
self.pattern.age_lwr,
Expand Down

0 comments on commit 8512d85

Please sign in to comment.