Skip to content

Commit

Permalink
Update core.py (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
modelonrobinandersson authored and PeterMeisrimelModelon committed Feb 29, 2024
1 parent 7960021 commit 5b84da8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/common/core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (C) 2010-2022 Modelon AB
# Copyright (C) 2010-2024 Modelon AB
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -149,7 +149,7 @@ def _exec_algorithm(self, module, algorithm, options):
Exception if algorithm is not a subclass of
common.algorithm_drivers.AlgorithmBase.
"""
from pyfmi.algorithm_drivers import AlgorithmBase
from pyfmi.common.algorithm_drivers import AlgorithmBase

if isinstance(algorithm, str):
module = __import__(module, globals(), locals(), [algorithm], 0)
Expand Down Expand Up @@ -182,7 +182,7 @@ def _exec_simulate_algorithm(self,
Exception if algorithm is not a subclass of
common.algorithm_drivers.AlgorithmBase.
"""
from pyfmi.algorithm_drivers import AlgorithmBase
from pyfmi.common.algorithm_drivers import AlgorithmBase

if isinstance(algorithm, str):
module = __import__(module, globals(), locals(), [algorithm], 0)
Expand Down
2 changes: 1 addition & 1 deletion src/pyfmi/master.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import scipy.optimize as spopt

import pyfmi.fmi as fmi
from pyfmi.common.algorithm_drivers import OptionBase, InvalidAlgorithmOptionException, AssimuloSimResult
from pyfmi.common.io import ResultHandlerFile, ResultHandlerDummy, ResultHandlerBinaryFile
from pyfmi.common.io import get_result_handler
from pyfmi.common.core import TrajectoryLinearInterpolation, TrajectoryUserFunction
from pyfmi.fmi cimport FMUModelCS2
cimport fmil_import as FMIL
Expand Down
5 changes: 3 additions & 2 deletions tests/test_fmi_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from pyfmi import testattr, Master
from pyfmi.fmi import FMUException, FMUModelCS2, FMUModelME2
from pyfmi.tests.test_util import Dummy_FMUModelCS2
from pyfmi.common.io import ResultHandler
from pyfmi.common.algorithm_drivers import UnrecognizedOptionError

file_path = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -265,8 +266,8 @@ def get_result(self):

res = master.simulate(options=opts)

assert res[models[0]]._result_data == None, "Result is not none"
assert res[models[1]]._result_data == None, "Result is not none"
assert res[models[0]]._result_data is None, "Result is not none"
assert res[models[1]]._result_data is None, "Result is not none"

@testattr(stddist = True)
def test_basic_simulation_with_block_initialization(self):
Expand Down

0 comments on commit 5b84da8

Please sign in to comment.