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

nbdev_update creates a new cell, instead of updating the original code #775

Closed
BirkhoffG opened this issue Aug 6, 2022 · 5 comments · Fixed by #934
Closed

nbdev_update creates a new cell, instead of updating the original code #775

BirkhoffG opened this issue Aug 6, 2022 · 5 comments · Fixed by #934
Labels
bug Something isn't working

Comments

@BirkhoffG
Copy link

nbdev_update does not work as intended. It will create a new code cell, instead of updating the original code.

My use case:

  • python_module
    • a.py
    • b.py
    • ...
  • nbs
    • a.ipynb
    • b.ipynb
    • ...

If I make changes in a.py, and run nbdev_update, it will create a new code cell in a.ipynb, rather than updating code in this notebook.

version: 2.1.1

@hamelsmu
Copy link
Member

hamelsmu commented Aug 6, 2022

Thanks for reporting this. I'm getting a different error: the code gets updated into the same cell, but it becomes a markdown cell without any directives.

@BirkhoffG do you mind sharing a repo or minimal example

@BirkhoffG
Copy link
Author

Hi @hamelsmu, here is my repo:
https:/BirkhoffG/counternet_jax

To reproduce the error:

  1. make some changes in CounterNetTrainingModule in cfnet/training_module.py.
  2. cd cfnet
  3. nbdev_update training_module.py

@jph00 jph00 added the bug Something isn't working label Aug 7, 2022
@hamelsmu
Copy link
Member

hamelsmu commented Aug 24, 2022

@BirkhoffG I believe your project is a nbdev v1 repo. Have you tried migrating this project to nbdev v2 yet? Here is a migration guide: https://nbdev.fast.ai/migrating.html

Can you please try that and let us know if that helps?

@BirkhoffG
Copy link
Author

Yes, at the time I reported the bug, I was using the v2 nbdev. I manually downgrade to v1 for now as this bug persists.

The snyc module in v2 seems to have some problems (e.g., #769), so I downgrade to v1 for now.

@BirkhoffG
Copy link
Author

@BirkhoffG I believe your project is a nbdev v1 repo. Have you tried migrating this project to nbdev v2 yet? Here is a migration guide: https://nbdev.fast.ai/migrating.html

Can you please try that and let us know if that helps?

Yes, at the time I reported the bug, I was using the v2 nbdev. I manually downgrade to v1 for now as this bug persists.

The snyc module in v2 seems to have some problems (e.g., #769), so I downgrade to v1 for now.

To replicate the issue reported, go to the refactor branch, which is using nbdev v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants