Skip to content

Commit

Permalink
Resolved pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders2303 committed Nov 26, 2024
1 parent a0db1ca commit cffe433
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _create_branch_node_list(self, terminal_node: str) -> List[str]:
current_parents = [terminal_node]
while len(current_parents) > 0:
# Find all indexes matching the current parents
children_indices = set([i for i, x in enumerate(parents_array) if x in current_parents])
children_indices = {i for i, x in enumerate(parents_array) if x in current_parents}

# Find all children of the current parents
children = nodes_array[list(children_indices)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def create_sumvec_from_datatype_nodename_and_keyword(
try:
if keyword == "WELSPECS":
datatype_ecl = WELL_DATATYPE_VECTOR_MAP[datatype]
elif keyword in TreeType._member_names_:
elif keyword in [t.value for t in TreeType]:
datatype_ecl = GROUPTYPE_DATATYPE_VECTORS_MAP[TreeType[keyword]][datatype]
except KeyError as exc:
error = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ async def fetch_and_initialize_async(self) -> None:
# Get all vectors of interest existing in the summary data
vectors_of_interest = _utils.get_all_vectors_of_interest_for_tree(group_tree_df_model)
vectors_of_interest = vectors_of_interest & self._all_vectors
# TODO: do we need to return to a list?

# Has any water injection or gas injection vectors among vectors of interest
has_wi_vectors = False
Expand Down Expand Up @@ -886,8 +885,8 @@ def _get_data_for_summary_vector_info(
"""Extracts and formats whatever data is available for a given summary vector. If the name is not present in the summary, a list of NaN values is given instead"""
if sumvec_name in summary_col_set:
return smry_for_grouptree_sorted_by_date[sumvec_name].to_numpy().round(2)
else:
return list([np.nan] * number_of_dates)

return list([np.nan] * number_of_dates)


def _is_valid_node_type(node_classification: NodeClassification, valid_node_types: set[NodeType]) -> bool:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from pydantic import BaseModel


from typing import Dict, List, Literal
from pydantic import BaseModel


class NetworkNode(BaseModel):
Expand Down

0 comments on commit cffe433

Please sign in to comment.