Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PythonForModelica
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ACS
Public
Power System Simulation and Optimization
PythonForModelica
Commits
5356e423
Commit
5356e423
authored
6 years ago
by
Bichen
Browse files
Options
Downloads
Patches
Plain Diff
- Fix some path errors
parent
2ccb4d35
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Scripts/ModPowerSystemsCI/RunOMSimulationCI.py
+3
-9
3 additions, 9 deletions
Scripts/ModPowerSystemsCI/RunOMSimulationCI.py
with
3 additions
and
9 deletions
Scripts/ModPowerSystemsCI/RunOMSimulationCI.py
+
3
−
9
View file @
5356e423
import
os
import
os
import
sys
import
sys
os
.
chdir
(
r
"
/home/cafi/Desktop/CITest
"
)
sys
.
path
.
append
(
r
"
./python-for-modelica/Py4Mod/py4mod
"
)
sys
.
path
.
append
(
r
"
./python-for-modelica/Py4Mod/py4mod
"
)
from
ModelicaModel
import
ModelicaModel
from
ModelicaModel
import
ModelicaModel
...
@@ -10,11 +10,11 @@ def simulate_modelica(model_name, model_path):
...
@@ -10,11 +10,11 @@ def simulate_modelica(model_name, model_path):
# Initialization
# Initialization
interface
.
createInterface
(
"
OPENMODELICA
"
)
interface
.
createInterface
(
"
OPENMODELICA
"
)
interface
.
loadFile
(
"
/home/cafi/Desktop/CITest/modpowersystems
/ModPowerSystems/package.mo
"
)
interface
.
loadFile
(
"
.
/ModPowerSystems/package.mo
"
)
# Redirection
# Redirection
cwd
=
os
.
getcwd
()
cwd
=
os
.
getcwd
()
wd
=
os
.
path
.
join
(
cwd
,
model_name
)
wd
=
os
.
path
.
join
(
cwd
,
model_name
[
model_name
.
rfind
(
'
.
'
)
+
1
:]
)
if
not
os
.
path
.
exists
(
wd
):
if
not
os
.
path
.
exists
(
wd
):
os
.
makedirs
(
wd
)
os
.
makedirs
(
wd
)
interface
.
changeWorkingDirectory
(
wd
.
replace
(
"
\\
"
,
"
/
"
))
interface
.
changeWorkingDirectory
(
wd
.
replace
(
"
\\
"
,
"
/
"
))
...
@@ -23,9 +23,3 @@ def simulate_modelica(model_name, model_path):
...
@@ -23,9 +23,3 @@ def simulate_modelica(model_name, model_path):
interface
.
buildModel
()
interface
.
buildModel
()
interface
.
simulate
()
interface
.
simulate
()
name
=
'
ModPowerSystems.DynPhasorThreePhase.Examples.BasicCircuits.VoltageSource_RL
'
path
=
'
./modpowersystems
'
simulate_modelica
(
name
,
path
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment