Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 21, 2024
1 parent 1772b0d commit 0b36c67
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,13 +1017,18 @@ def from_file(
params = inspect.signature(model.__init__).parameters

# Filter for missing parameters excluding kwargs
missing_params = {k: v for k, v in params.items() if
k not in model.__dict__.keys() and v.name != "self" and v.kind != v.VAR_KEYWORD}
missing_params = {
k: v
for k, v in params.items()
if k not in model.__dict__.keys()
and v.name != "self"
and v.kind != v.VAR_KEYWORD
}

# Assign missing attributes
for k, v in missing_params.items():
setattr(model, k, v)

# Update any parameters if necessary, such as
# extra_sympy_mappings:
model.set_params(**pysr_kwargs)
Expand Down

0 comments on commit 0b36c67

Please sign in to comment.