Skip to content

Commit

Permalink
Fix typo, remove redundent code and replace __import__ (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwsch authored Mar 30, 2024
1 parent 6d26f16 commit acc3899
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions micro_manager/micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import numpy as np
import logging
import time
import importlib
from copy import deepcopy
from typing import Dict
from warnings import warn
Expand Down Expand Up @@ -71,8 +72,6 @@ def __init__(self, config_file: str) -> None:
self._rank,
self._size)

micro_file_name = self._config.get_micro_file_name()

self._macro_mesh_name = self._config.get_macro_mesh_name()

# Data names of data written to preCICE
Expand Down Expand Up @@ -309,9 +308,9 @@ def _initialize(self) -> None:
self._micro_sims = [None] * self._local_number_of_sims # DECLARATION

micro_problem = getattr(
__import__(
importlib.import_module(
self._config.get_micro_file_name(),
fromlist=["MicroSimulation"]),
"MicroSimulation"),
"MicroSimulation")

# Create micro simulation objects
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_read_write_data_from_precice(self):
self.assertListEqual(data["macro-vector-data"].tolist(),
fake_data["macro-vector-data"].tolist())

def test_solve_mico_sims(self):
def test_solve_micro_sims(self):
"""
Test if the internal function _solve_micro_simulations works as expected.
"""
Expand Down

0 comments on commit acc3899

Please sign in to comment.