Skip to content

Refactor#71

Open
cbouy wants to merge 32 commits intomasterfrom
proper-widget
Open

Refactor#71
cbouy wants to merge 32 commits intomasterfrom
proper-widget

Conversation

@cbouy
Copy link
Owner

@cbouy cbouy commented Nov 5, 2025

Refactor the codebase:

  • The "interactive" widget does not rely on jinja2 templates for creating the javascript code from python anymore. Instead, the Python and Javascript codebases are completely separated and only communicate through the widget data attributes. This makes it easier to understand the code and track typing errors from both sides.
  • Inevitably, some of the dependencies on the JS side have been updated or replaced, leading to further modifications that should not impact end users

TODO:

  • refactor
    • rdkit options through adapter (python and JS adapters?)
    • put dataframe preparation in separate class
    • split classes (molgrid and static?)
    • reorganize utils
  • Add type hints
  • Improve release process with trusted publishing and tags
  • Track usability of the refactored code runs across different "notebook backends" (✔/❌) (and display in docs+README):
    • [✔] Jupyter
    • [✔] VSCode
    • [✔] Marimo
    • [⌛] Streamlit: will depend on PR in streamlit-anywidget: make a separate python package from fork in the meantime?
    • [❓] Google Colab: requires prerelease to test

@cbouy cbouy force-pushed the proper-widget branch 2 times, most recently from f043ab3 to ec2ce45 Compare December 18, 2025 17:17
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 94.55128% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.90%. Comparing base (3b8b3db) to head (a0f4f67).

Files with missing lines Patch % Lines
mols2grid/io.py 96.02% 6 Missing ⚠️
mols2grid/molgrid.py 90.62% 6 Missing ⚠️
mols2grid/__init__.py 83.33% 2 Missing ⚠️
mols2grid/typeshed.py 71.42% 2 Missing ⚠️
mols2grid/select.py 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   90.86%   91.90%   +1.04%     
==========================================
  Files           8       11       +3     
  Lines         558      729     +171     
==========================================
+ Hits          507      670     +163     
- Misses         51       59       +8     

☔ 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.

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.

1 participant