Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements: fix typo in test, remove redundant code and replace __import__ #90

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading