Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
BOXMOX Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MBEES
BOXMOX Python Package
Commits
b4c6f8fb
Commit
b4c6f8fb
authored
7 years ago
by
Christoph.Knote
Browse files
Options
Downloads
Patches
Plain Diff
Stupid data fix
parent
9d1dec7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boxmox/data.py
+13
-3
13 additions, 3 deletions
boxmox/data.py
with
13 additions
and
3 deletions
boxmox/data.py
+
13
−
3
View file @
b4c6f8fb
...
...
@@ -108,7 +108,7 @@ class InputFile17:
self
.
timeVar
=
hdr
[
0
]
self
.
time
=
[
x
[
0
]
for
x
in
dmp
]
ntime
=
1
self
.
anc
=
{
hdr
[
i
]:
[
x
[
i
]
for
x
in
dmp
]
for
i
in
range
(
ntime
,
ntime
+
nanc
)
}
self
.
anc
=
{
hdr
[
i
]:
[
x
[
i
]
for
x
in
dmp
]
for
i
in
range
(
ntime
,
ntime
+
nanc
)
}
self
.
_data
=
{
hdr
[
i
]:
[
x
[
i
]
for
x
in
dmp
]
for
i
in
range
(
ntime
+
nanc
,
len
(
dmp
[
0
]))
}
def
__str__
(
self
):
...
...
@@ -140,7 +140,12 @@ class InputFile17:
line
=
[
xtime
]
+
[
self
.
anc
[
key
][
itime
]
for
key
in
anc_names
]
+
[
self
.
_data
[
key
][
itime
]
for
key
in
data_names
]
f
.
write
(
'
'
.
join
(
'
{0:e}
'
.
format
(
x
)
for
x
in
line
)
+
'
\n
'
)
else
:
data_line
=
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
self
.
anc
[
x
]))
for
x
in
self
.
anc
.
keys
()
)
+
'
'
+
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
self
.
_data
[
x
]))
for
x
in
self
.
keys
()
)
+
'
\n
'
def
_data_fix
(
key
):
if
isinstance
(
self
.
_data
[
x
],
list
):
return
self
.
_data
[
x
][
0
]
else
:
return
self
.
_data
[
x
]
data_line
=
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
self
.
anc
[
x
]))
for
x
in
self
.
anc
.
keys
()
)
+
'
'
+
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
_data_fix
(
x
)))
for
x
in
self
.
keys
()
)
+
'
\n
'
if
not
self
.
time
is
None
:
data_line
=
'
{0:e}
'
.
format
(
float
(
self
.
time
))
+
'
'
+
data_line
f
.
write
(
data_line
)
...
...
@@ -227,7 +232,12 @@ class InputFileOrig:
f
.
write
(
'
'
.
join
(
'
{0:e}
'
.
format
(
x
)
for
x
in
line
)
+
'
\n
'
)
else
:
f
.
write
(
'
{0:s}
'
.
format
(
'
'
.
join
(
column_names
))
+
'
\n
'
)
f
.
write
(
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
self
.
_data
[
x
]))
for
x
in
self
.
keys
()
)
+
'
\n
'
)
def
_data_fix
(
key
):
if
isinstance
(
self
.
_data
[
x
],
list
):
return
self
.
_data
[
x
][
0
]
else
:
return
self
.
_data
[
x
]
f
.
write
(
'
'
.
join
(
'
{0:e}
'
.
format
(
float
(
_data_fix
(
x
)))
for
x
in
self
.
keys
()
)
+
'
\n
'
)
def
__init__
(
self
,
fpath
=
None
):
#: Time format (0: constant, 1: seconds since start, 2: hour of diurnal cycle)
...
...
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