-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataframe #16
Conversation
thanks, looks good. you could make it cleaner by doing something like parameters = [
"Volumetric stack energy density [Wh.L-1]",
"Gravimetric stack energy density [Wh.kg-1]",
]
names = []
units = []
values = []
for parameter in parameters:
name, unit = parameter.split("[")
names.append(name.strip())
units.append(unit.rstrip(']'))
values.append(stack_ed[parameter])
data = {
"Parameter": names,
"Unit": units,
"Value": values,
} this would require you to have all the values in the units you want in the breakdown dicts, but i think it's cleaner as you don't need to manually specific a name and units separately - they are just taken from the key of the dictionary |
name, unit = parameter.split("[") | ||
names.append(name.strip()) | ||
units.append(unit.rstrip(']')) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this? I don't think you need to have the subheadings as part of the dataframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looks good! Just a couple of minor changes and need to fix the merge conflicts then it's good to go
pybamm_tea/tea.py
Outdated
stack_ed.get("Gravimetric stack energy density [W.h.kg-1]"), | ||
stack_ed.get("Stack average OCP [V]"), | ||
stack_ed.get("Capacity [mA.h.cm-2]"), | ||
10**6 * stack_ed.get("Stack thickness [m]"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add "Stack thickness [um]" and "Stack density [kg.L-1]" to stack_ed
too when you construct it, then you can just do the loop here too
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
==========================================
- Coverage 80.99% 76.09% -4.91%
==========================================
Files 3 3
Lines 321 343 +22
==========================================
+ Hits 260 261 +1
- Misses 61 82 +21
☔ View full report in Codecov by Sentry. |
units = [] | ||
values = [] | ||
for parameter in parameters: | ||
if "[" in parameter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, you could denote no units by "[-]"
No description provided.