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

create nb_client for load_history. #1166

Open
wants to merge 5 commits into
base: code_interpreter
Choose a base branch
from

Conversation

orange-crow
Copy link
Contributor

@orange-crow orange-crow commented Apr 9, 2024

Features

  • 对保存的nb进行预处理:剔除运行报错的code cell
  • 为load_history创建 nb_client
  • 载入code.ipynb并执行代码,通过执行notebook来重载历史代码中的变量

Result

code.ipynb : code.pdf
load_history效果例子:

  from nbformat.v4 import new_code_cell
  save_dir = "./tests/private"
  plan, nb, nb_client = load_history(save_dir)
  nb['cells'].append(new_code_cell("new_data = data[0]\nprint(new_data)"))
  output_cell = nb_client.execute()
  print(nb.cells[-1])

image

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 82.37%. Comparing base (8b371ea) to head (c748836).
Report is 22 commits behind head on code_interpreter.

Files Patch % Lines
metagpt/utils/recovery_util.py 0.00% 20 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           code_interpreter    #1166      +/-   ##
====================================================
- Coverage             82.45%   82.37%   -0.09%     
====================================================
  Files                   223      223              
  Lines                 13214    13240      +26     
====================================================
+ Hits                  10896    10906      +10     
- Misses                 2318     2334      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orange-crow orange-crow changed the title create nb_client for nb load_history. create nb_client for load_history. Apr 9, 2024
@geekan geekan requested a review from garylin2099 April 9, 2024 07:44
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.

None yet

2 participants