Skip to content

Commit

Permalink
Bump actions/checkout from 3 to 4 (#115)
Browse files Browse the repository at this point in the history
* Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run black

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hofer-Julian <julianhofer@gnome.org>
  • Loading branch information
dependabot[bot] and Hofer-Julian authored Sep 5, 2023
1 parent 6136871 commit 3cde4bf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -19,7 +19,7 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -33,7 +33,7 @@ jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -49,13 +49,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
Expand Down
32 changes: 8 additions & 24 deletions xmipy/xmiwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ def set_int(self, name: str, value: int) -> None:
def initialize(self, config_file: str = "") -> None:
if self._state == State.UNINITIALIZED:
with cd(self.working_directory):
self._execute_function(
self.lib.initialize, config_file.encode()
)
self._execute_function(self.lib.initialize, config_file.encode())
self._state = State.INITIALIZED
else:
raise InputError("The library is already initialized")
Expand Down Expand Up @@ -194,9 +192,7 @@ def get_time_step(self) -> float:
def get_component_name(self) -> str:
len_name = self.get_constant_int("BMI_LENCOMPONENTNAME")
component_name = create_string_buffer(len_name)
self._execute_function(
self.lib.get_component_name, byref(component_name)
)
self._execute_function(self.lib.get_component_name, byref(component_name))
return component_name.value.decode("ascii")

def get_version(self) -> str:
Expand Down Expand Up @@ -544,9 +540,7 @@ def get_grid_type(self, grid: int) -> str:
)
return grid_type.value.decode()

def get_grid_shape(
self, grid: int, shape: NDArray[np.int32]
) -> NDArray[np.int32]:
def get_grid_shape(self, grid: int, shape: NDArray[np.int32]) -> NDArray[np.int32]:
c_grid = c_int(grid)
self._execute_function(
self.lib.get_grid_shape,
Expand All @@ -565,9 +559,7 @@ def get_grid_origin(
) -> NDArray[np.int32]:
raise NotImplementedError

def get_grid_x(
self, grid: int, x: NDArray[np.float64]
) -> NDArray[np.float64]:
def get_grid_x(self, grid: int, x: NDArray[np.float64]) -> NDArray[np.float64]:
c_grid = c_int(grid)
self._execute_function(
self.lib.get_grid_x,
Expand All @@ -576,9 +568,7 @@ def get_grid_x(
)
return x

def get_grid_y(
self, grid: int, y: NDArray[np.float64]
) -> NDArray[np.float64]:
def get_grid_y(self, grid: int, y: NDArray[np.float64]) -> NDArray[np.float64]:
c_grid = c_int(grid)
self._execute_function(
self.lib.get_grid_y,
Expand All @@ -587,9 +577,7 @@ def get_grid_y(
)
return y

def get_grid_z(
self, grid: int, z: NDArray[np.float64]
) -> NDArray[np.float64]:
def get_grid_z(self, grid: int, z: NDArray[np.float64]) -> NDArray[np.float64]:
c_grid = c_int(grid)
self._execute_function(
self.lib.get_grid_z,
Expand Down Expand Up @@ -683,9 +671,7 @@ def solve(self, component_id: int = 1) -> bool:
cid = c_int(component_id)
has_converged = c_int(0)
with cd(self.working_directory):
self._execute_function(
self.lib.solve, byref(cid), byref(has_converged)
)
self._execute_function(self.lib.solve, byref(cid), byref(has_converged))
return has_converged.value == 1

def finalize_solve(self, component_id: int = 1) -> None:
Expand All @@ -709,9 +695,7 @@ def get_var_address(

return var_address.value.decode()

def _execute_function(
self, function: Callable[[Any], int], *args: Any
) -> None:
def _execute_function(self, function: Callable[[Any], int], *args: Any) -> None:
"""
Utility function to execute a BMI function in the kernel and checks its status
"""
Expand Down

0 comments on commit 3cde4bf

Please sign in to comment.