Skip to content

Commit

Permalink
rename make_states
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Jul 19, 2023
1 parent 19ceb72 commit f41c944
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions HARK/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class State(Variable):
yaml_tag: str = "!State"

Check warning on line 33 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L31-L33

Added lines #L31 - L33 were not covered by tests

def assign_values(self, values):
return make_state(values, self.name, self.attrs)
return make_state_array(values, self.name, self.attrs)

Check warning on line 36 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L35-L36

Added lines #L35 - L36 were not covered by tests

def discretize(self, min, max, N, method):

Check warning on line 38 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L38

Added line #L38 was not covered by tests
# linear for now
Expand All @@ -59,9 +59,8 @@ class Action(Variable):
Variable (_type_): _description_
"""

yaml_tag: str = "!Action"

is_optimal: bool = True
yaml_tag: str = "!Action"

Check warning on line 63 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L62-L63

Added lines #L62 - L63 were not covered by tests

def discretize(self, *args, **kwargs):
warn("Actions cannot be discretized.")

Check warning on line 66 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L65-L66

Added lines #L65 - L66 were not covered by tests
Expand Down Expand Up @@ -104,7 +103,7 @@ class Auxilliary(Variable):
yaml_tag: str = "!Auxilliary"

Check warning on line 103 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L101-L103

Added lines #L101 - L103 were not covered by tests


def make_state(
def make_state_array(

Check warning on line 106 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L106

Added line #L106 was not covered by tests
values: np.ndarray,
name: Optional[str] = None,
attrs: Optional[dict] = None,
Expand Down Expand Up @@ -136,7 +135,7 @@ def make_state(
)


def make_states(
def make_states_array(

Check warning on line 138 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L138

Added line #L138 was not covered by tests
values: Union[np.ndarray, list],
names: Optional[list[str]] = None,
attrs: Optional[list[dict]] = None,
Expand All @@ -162,7 +161,8 @@ def make_states(
attrs = attrs or [{}] * values_len

Check warning on line 161 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L160-L161

Added lines #L160 - L161 were not covered by tests

states = [

Check warning on line 163 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L163

Added line #L163 was not covered by tests
make_state(value, name, attr) for value, name, attr in zip(values, names, attrs)
make_state_array(value, name, attr)
for value, name, attr in zip(values, names, attrs)
]

return xr.merge(states)

Check warning on line 168 in HARK/variables.py

View check run for this annotation

Codecov / codecov/patch

HARK/variables.py#L168

Added line #L168 was not covered by tests

0 comments on commit f41c944

Please sign in to comment.