Skip to content

Commit

Permalink
lint again
Browse files Browse the repository at this point in the history
  • Loading branch information
benjello committed Jun 28, 2024
1 parent 050e488 commit be86433
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ class VectorialAsofDateParameterNodeAtInstant(VectorialParameterNodeAtInstant):

@staticmethod
def build_from_node(node):
parameters.VectorialParameterNodeAtInstant.check_node_vectorisable(node)
VectorialParameterNodeAtInstant.check_node_vectorisable(node)
subnodes_name = node._children.keys()
# Recursively vectorize the children of the node
vectorial_subnodes = tuple([
VectorialAsofDateParameterNodeAtInstant.build_from_node(node[subnode_name]).vector
if isinstance(node[subnode_name], parameters.ParameterNodeAtInstant)
else node[subnode_name]
for subnode_name in subnodes_name
])
])
# A vectorial node is a wrapper around a numpy recarray
# We first build the recarray
recarray = numpy.array(
[vectorial_subnodes],
dtype=[
(subnode_name, subnode.dtype if isinstance(subnode, numpy.recarray) else 'float')
for (subnode_name, subnode) in zip(subnodes_name, vectorial_subnodes)
]
)
]
)
return VectorialAsofDateParameterNodeAtInstant(node._name, recarray.view(numpy.recarray), node._instant_str)

def __getitem__(self, key):
Expand All @@ -45,17 +45,17 @@ def __getitem__(self, key):
name
for name in names
if not name.startswith("before")
]
]
names = [
numpy.datetime64(
"-".join(name[len("after_"):].split("_"))
)
)
for name in names
]
]
conditions = sum([
name <= key
for name in names
])
])
result = values[conditions]

# If the result is not a leaf, wrap the result in a vectorial node.
Expand Down
2 changes: 1 addition & 1 deletion openfisca_core/tools/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def check_variable(
self.test.absolute_error_margin[variable_name],
f"{variable_name}@{period}: ",
self.test.relative_error_margin[variable_name],
)
)

def should_ignore_variable(self, variable_name: str):
only_variables = self.options.get("only_variables")
Expand Down

0 comments on commit be86433

Please sign in to comment.