Skip to content

Add handling for ROOT-flavored C++ notebooks that use the ".C" extension #1384

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

Merged
merged 1 commit into from
Jun 1, 2025

Conversation

sjgardiner
Copy link
Contributor

Recent versions of the ROOT data analysis framework offer a C++ kernel for Jupyter notebooks. The metadata saved by ROOT into these notebooks lists ".C" as the file extension rather than the more standard ".cpp"

This pull request adds handling of this file extension for the C++ language. An example ROOT C++ notebook is included that passes unit tests after the proposed code changes.

Copy link

github-actions bot commented May 4, 2025

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab or Binder:notebook.

Also, the version of Jupytext developed in this PR can be installed with pip:

HATCH_BUILD_HOOKS_ENABLE=true pip install git+https://github.com/sjgardiner/jupytext.git@cpp-root

(this requires nodejs, see more at Developing Jupytext)

@mwouts
Copy link
Owner

mwouts commented May 4, 2025

Thank you @sjgardiner for your PR! I will have a look. Do you think we could add a mention of this in the language.md documentation file? Also, could you add the text counterpart of the notebook (it should be generated by the tests, see https://jupytext.readthedocs.io/en/latest/contributing.html#add-support-for-another-language)

Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.80%. Comparing base (ca731ef) to head (844f6ed).
Report is 3 commits behind head on main.

❌ Your project status has failed because the head coverage (96.76%) is below the target coverage (97.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1384   +/-   ##
=======================================
  Coverage   96.80%   96.80%           
=======================================
  Files          32       32           
  Lines        5001     5003    +2     
=======================================
+ Hits         4841     4843    +2     
  Misses        160      160           
Flag Coverage Δ
external ?
functional ?
integration ?
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mwouts
Copy link
Owner

mwouts commented May 11, 2025

Hi @sjgardiner , I was looking into this PR.

For the avoidance of doubt, can you confirm that the correct file association for ROOT-flavored C++ notebooks is .cpp, not .C which appears in the notebook's language information ?

I will take care of fixing the CI, but we will also need to add a mention of this in language.md, and add the mirror files created by the tests (I can do that if you wish).

@mwouts
Copy link
Owner

mwouts commented May 29, 2025

Hi @sjgardiner , I might be able to cut a new release this week-end, could I have your confirmation on this question? I mean:

For the avoidance of doubt, can you confirm that the correct file association for ROOT-flavored C++ notebooks is .cpp, not .C which appears in the notebook's language information ?

Thank you!

@mwouts mwouts merged commit bbe80bb into mwouts:main Jun 1, 2025
44 of 49 checks passed
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.

2 participants