Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rbaxdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Peter Schubert
rbaxdf
Commits
36cf7219
Commit
36cf7219
authored
2 years ago
by
Peter Schubert
Browse files
Options
Downloads
Patches
Plain Diff
value info in targets sheet corrected
parent
beeecd08
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rbaxdf/model/rba_macromolecules.py
+10
-2
10 additions, 2 deletions
rbaxdf/model/rba_macromolecules.py
rbaxdf/model/rba_model.py
+3
-0
3 additions, 0 deletions
rbaxdf/model/rba_model.py
with
13 additions
and
2 deletions
rbaxdf/model/rba_macromolecules.py
+
10
−
2
View file @
36cf7219
...
...
@@ -53,9 +53,17 @@ class RbaMacromolecules:
tree
.
write
(
file_name
)
def
to_df
(
self
):
if
len
(
self
.
components
)
>
0
:
df_comp
=
pd
.
DataFrame
([
item
.
to_dict
()
for
item
in
self
.
components
.
values
()])
else
:
df_comp
=
pd
.
DataFrame
(
columns
=
[
'
component
'
,
'
name
'
,
'
type
'
,
'
weight
'
])
df_comp
.
set_index
(
'
component
'
,
inplace
=
True
)
if
len
(
self
.
macromolecules
)
>
0
:
df_mm
=
pd
.
DataFrame
([
item
.
to_dict
()
for
item
in
self
.
macromolecules
.
values
()])
else
:
df_mm
=
pd
.
DataFrame
(
columns
=
[
'
id
'
,
'
compartment
'
])
df_mm
.
set_index
(
'
id
'
,
inplace
=
True
)
cols
=
[
'
compartment
'
]
+
df_comp
.
index
.
to_list
()
df
=
pd
.
concat
((
df_comp
.
T
,
df_mm
)).
reindex
(
columns
=
cols
)
...
...
This diff is collapsed.
Click to expand it.
rbaxdf/model/rba_model.py
+
3
−
0
View file @
36cf7219
...
...
@@ -81,9 +81,12 @@ class RbaModel:
for
idx
,
row
in
m_dict
[
'
densities
'
].
iterrows
():
first_value
=
row
[
'
targetValue
'
].
split
(
'
=
'
)[
1
]
m_dict
[
'
densities
'
].
at
[
idx
,
'
value_info
'
]
=
self
.
parameters
.
get_value_info
(
first_value
)
# we temporarily create a unique index for table update
m_dict
[
'
targets
'
].
reset_index
(
inplace
=
True
)
for
idx
,
row
in
m_dict
[
'
targets
'
].
iterrows
():
first_value
=
row
[
'
targetValue
'
].
split
(
'
=
'
)[
1
]
m_dict
[
'
targets
'
].
at
[
idx
,
'
value_info
'
]
=
self
.
parameters
.
get_value_info
(
first_value
)
m_dict
[
'
targets
'
].
set_index
(
'
targetGroup
'
,
inplace
=
True
)
with
pd
.
ExcelWriter
(
xlsx_name
)
as
writer
:
for
name
,
df
in
m_dict
.
items
():
...
...
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