Closed atravitz closed 3 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@atravitz I think it's a great simple example to show how pandas can be used with signac together. But when I run the notebook files up to 202, I get the keyerror that doc.V doesn't exist. From running previous notebooks before 202, I have doc.V_liq and doc.V_gas, not doc.V. Did I miss something somewhere?
@atravitz I think it's a great simple example to show how pandas can be used with signac together. But when I run the notebook files up to 202, I get the keyerror that doc.V doesn't exist. From running previous notebooks before 202, I have doc.V_liq and doc.V_gas, not doc.V. Did I miss something somewhere?
I just saw that the same thing was caught by the integration test. I just ran it successfully on notebooks 103 and 202. V_liq
and V_gas
could have been from an older example
I am currently addressing issues with the "projects" CI in a separate branch and noticed that the "notebooks" CI is failing for the pandas example on that branch. Therefore, I am working on finishing this PR and fixing the notebooks CI. I am pushing changes to address the following issues. I will iterate until CI passes, then merge this PR.
df = df.sort_values("sp.p")
to account for the sorting, or else the plot line is drawn in a random order.The CI issue with not finding doc.V
is because of notebook 104 -- the van der Waals approximations with parameters a
and b
updates the original state points from notebook 103 to include a=0
and b=0
, and relabels doc.V
to doc.V_gas
. We always execute the notebooks in alphabetical order, so it isn't possible to make notebook 202 depend on 103 (without the modifications from 104).
I spent some time trying to untangle the data space modifications in notebooks 103 and 104, but it seems to me that the better solution would be to make this "advanced" notebook self-contained and eliminate the dependency on notebooks 103/104. The fastest way to do that is to create a separate project and plot a function or two. I'm going to make that change, while retaining the overall style of this PR and try to keep it as simple as possible.
In the interest of fixing the failing CI, I will merge this as soon as CI passes for the notebooks.
There was a previous pandas example notebook but it used the old api that required manually creating a dataframe from a signac index. We now have
to_dataframe()
and I'm rewriting the example to make use of this.