glotzerlab / signac-examples

Examples for the signac framework.
https://signac.io/
BSD 3-Clause "New" or "Revised" License
14 stars 8 forks source link

Adding new pandas example #28

Closed atravitz closed 3 years ago

atravitz commented 3 years ago

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.

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

syjlee commented 3 years ago

@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?

cbkerr commented 3 years ago

@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

bdice commented 3 years ago

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.

bdice commented 3 years ago

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.