Skip to content

Commit 5095494

Browse files
syntronadeas31
andauthored
Reorder imports (#344)
* [ModelicaSystemDoE] add class * [__init__] add class ModelicaSystemDoE * [test_ModelicaSystemDoE] add test * [ModelicaSystemDoE] add docstrings * [ModelicaSystemDoE] define dict keys as constants * [ModelicaSystemDoE] build model after all structural parameters are defined * [ModelicaSystemDoE] cleanup prepare() / rename variables * [ModelicaSystemDoE] cleanup simulate() / rename variables * [ModelicaSystemDoE] cleanup get_solutions() / rename variables * [test_ModelicaSystemDoE] update test * [ModelicaSystemDoE] add example to show the usage * add pandas as new dependency (use in ModelicaSystemDoE) * [test_ModelicaSystemDoE] fix mypy * add pandas to requirements in pyproject.toml * [ModelicaSystemDoE] rename class constants * [ModelicaSystemDoE] remove dependency on pandas * no need to add aditional requirements * hint how to use pandas in the docstrings * update test to match code changes * [ModelicaSystemDoE.simulate] fix percent of tasks left * [ModelicaSystemDoE.prepare] do not convert all non-structural parameters to string * [ModelicaSystemDoE] update set parameter expressions for str and bool * [ModelicaSystemDoE] rename class constants * [ModelicaSystemDoE] fix bool comparison * [ModelicaSystemDoE] remove unused code * [ModelicaSystemDoE] fix rebase fallout * [ModelicaSystemDoE] fix rebase fallout * [ModelicaSystemDoE] cleanup & extend & document dict key constants * remove DICT_RESULT_FILENAME * add comment * add DICT_ID_STRUCTURE and DICT_ID_NON_STRUCTURE * rename param_simple => param_non_structure * [ModelicaSystemDoE] ensure any double quote in string variables is escaped * [ModelicaSystemDoE] replace pathlib by OMCPath * [ModelicaSystem/ModelicaSystemDoE] improve session handling * add ModelicaSystem.session() - returns _getconn * add ModelicaSystemDoE.session() - returns _mod.session() reasoning: * do not access private variables of a class * limit chain access to (sub)data * [ModelicaSystemDoE] fix path to resultfile it does not exists at this point thus, resolve() and absolute() will fail * [ModelicaSystemDoE] rename variables & cleanup * [ModelicaSystemDoE] update variable handling / remove variables not needed * [ModelicaSystemDoe] do not limit to OMCProcessLocal * [test_ModelicaSystemDoE] update test definition for local/docker/WSL * [OMCSession] reorder imports * [ModelicaSystem] reorder imports --------- Co-authored-by: Adeel Asghar <[email protected]>
1 parent f5ec079 commit 5095494

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

OMPython/ModelicaSystem.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import itertools
3838
import logging
3939
import numbers
40-
import numpy as np
4140
import os
4241
import queue
4342
import textwrap
@@ -46,8 +45,16 @@
4645
import warnings
4746
import xml.etree.ElementTree as ET
4847

49-
from OMPython.OMCSession import (OMCSessionException, OMCSessionRunData, OMCSessionZMQ,
50-
OMCProcess, OMCProcessLocal, OMCPath)
48+
import numpy as np
49+
50+
from OMPython.OMCSession import (
51+
OMCSessionException,
52+
OMCSessionRunData,
53+
OMCSessionZMQ,
54+
OMCProcess,
55+
OMCProcessLocal,
56+
OMCPath,
57+
)
5158

5259
# define logger using the current module name as ID
5360
logger = logging.getLogger(__name__)

OMPython/OMCSession.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
import os
4343
import pathlib
4444
import platform
45-
import psutil
46-
import pyparsing
4745
import re
4846
import shutil
4947
import signal
@@ -56,6 +54,9 @@
5654
import warnings
5755
import zmq
5856

57+
import psutil
58+
import pyparsing
59+
5960
# TODO: replace this with the new parser
6061
from OMPython.OMTypedParser import om_parser_typed
6162
from OMPython.OMParser import om_parser_basic

0 commit comments

Comments
 (0)