Skip to content

Commit

Permalink
fixing a specific Ubuntu version for integrity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-g committed Jan 26, 2023
1 parent 66ab71d commit fcb5b7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
ref:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
Expand Down
22 changes: 11 additions & 11 deletions vatic/model_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __copy__(self):
return VaticModelData(copy(self._data))

def __deepcopy__(self, memo):
return VaticModelData(deepcopy(self._data))
return VaticModelData(deepcopy(self._data, memo))

def clone_in_service(self) -> VModelData:
"""Returns a version of this grid without out-of-service elements."""
Expand All @@ -69,15 +69,14 @@ def elements(self,
**element_args) -> Iterator[tuple[str, dict]]:
"""Retrieves grid elements that match a set of criteria.
Args
----
element_type Which type of element to search within, e.g. 'bus',
'generator', 'load', 'branch', etc.
element_args A set of element property values, all of which must
be present in an element's data entry and equal to
the given value for the element's entry to be
returned. e.g. generator_type='renewable'
bus='Chifa'
Arguments
---------
element_type Which type of element to search within, e.g. 'bus',
'generator', 'load', 'branch', etc.
element_args A set of element property values, all of which must be
present in an element's data entry and equal to the
given value for the element's entry to be returned.
e.g. generator_type='renewable' bus='Chifa'
"""
if element_type not in self._data['elements']:
Expand Down Expand Up @@ -115,10 +114,11 @@ def attributes(self, element_type: str, **element_args) -> dict:

return attr_dict

def get_system_attr(self, attr: str, default: Any = None) -> Any:
def get_system_attr(self, attr: str, default: Optional[Any] = None) -> Any:
if attr in self._data['system']:
return self._data['system'][attr]

# throw error if the attribute is missing and no default value is given
elif default is None:
raise ModelError("This model does not include the system-level "
"attribute `{}`!".format(attr))
Expand Down

0 comments on commit fcb5b7b

Please sign in to comment.