Skip to content
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

V2: Add all notebooks to test #840

Merged
merged 8 commits into from May 24, 2024
Merged

Conversation

hwpang
Copy link
Contributor

@hwpang hwpang commented Apr 24, 2024

Description

Currently when a notebook test fails, CI doesn't complain. I will work on debugging this in this PR.

Example / Current workflow

n/a

Bugfix / Desired workflow

n/a

Questions

n/a

Relevant issues

#798

Checklist

  • linted with flake8?
  • (if appropriate) unit tests added?

@hwpang hwpang added this to the v2.0.1 milestone Apr 24, 2024
@hwpang hwpang linked an issue Apr 24, 2024 that may be closed by this pull request
@shihchengli
Copy link
Contributor

Is there any update for this PR? I looked at the test results, and it seems this CI would work. There are two notebooks that failed to run. One seems due to an outdated import, and the other one failed because of a matplotlib import error. Can you install this package in the CI when running the tests on those examples? We can wait for #834 to be merged and run the tests again.

@hwpang hwpang changed the title V2: Make CI complain when notebook tests fail V2: Add all notebooks to test May 23, 2024
@hwpang
Copy link
Contributor Author

hwpang commented May 23, 2024

With the -v verbose tag, I was able to make the notebook test fails CI. After adding all the notebooks to CI, there are some bugs found.

mpnn_fingerprints notebook is now failing as it uses matplotlib, but chemprop env doesn't come with matplotlib. @shihchengli What do you think we should do? Should we add matplotlib to chemprop env? Or should we remove the plotting examples?

extra_features_from_featurizer notebook is also now failing due to cannot import name 'MoleculeFeaturizer' from 'chemprop.featurizers' error. I assumed that it intends to import SimpleMoleculeMolGraphFeaturizer, so I changed that. However, after fixing that, now the notebook fails with the following error during initialization of the MorganFingerprintMoleculeFeaturizer. @kevingreenman @KnathanM do you two know how to fix this?

mf = MorganFingerprintMoleculeFeaturizer()
morgan = mf(utils.make_mol(smis[0], keep_h=False, add_h=False))
morgan.shape, morgan
>>>
TypeError                                 Traceback (most recent call last)
Cell In[8], [line 1](vscode-notebook-cell:?execution_count=8&line=1)
----> [1](vscode-notebook-cell:?execution_count=8&line=1) mf = MorganFingerprintMoleculeFeaturizer()
      [2](vscode-notebook-cell:?execution_count=8&line=2) morgan = mf(utils.make_mol(smis[0], keep_h=False, add_h=False))
      [3](vscode-notebook-cell:?execution_count=8&line=3) morgan.shape, morgan

File <string>:6, in __init__(self, atom_featurizer, bond_featurizer, extra_atom_fdim, extra_bond_fdim, fp_size)

TypeError: MorganFingerprintMoleculeFeaturizer.__post_init__() takes 1 positional argument but 3 were given

@shihchengli
Copy link
Contributor

As matplotlib is widely used in visualization, I am fine with including it as a dependency. If other devs do not want to include it as a dependency because we never use it in the other parts, we can consider removing the figures from the notebooks or installing it additionally during testing. As for the featurization issues, I suggest you wait until the PR #834 is finished, which should be able to resolve these issues.

@hwpang hwpang requested a review from shihchengli May 24, 2024 17:30
@hwpang
Copy link
Contributor Author

hwpang commented May 24, 2024

@shihchengli I install matplotlib before the notebook test. I also talked to @KnathanM to figure out a way to fix the featurizer notebook. Could you review and approve? I will uncomment the unit tests after reviews.

@shihchengli shihchengli enabled auto-merge (squash) May 24, 2024 18:27
@shihchengli shihchengli disabled auto-merge May 24, 2024 18:29
@shihchengli shihchengli enabled auto-merge (squash) May 24, 2024 18:30
@shihchengli shihchengli merged commit 66f41fa into chemprop:main May 24, 2024
13 checks passed
@hwpang hwpang deleted the v2/fix_nb_test branch May 24, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: CI doesn't complain when notebooks fail
2 participants