Conversation
PR SummaryThis PR makes extensive updates across multiple Jupyter notebooks to improve the clarity, consistency, and user guidance in the ValidMind notebooks. The primary changes include:
Overall, these updates aim to create a more uniform and intuitive user experience in setting up and documenting models with ValidMind, ensuring that the instructions match the latest UI terminology and workflow changes on the ValidMind Platform. Test Suggestions
|
When vm.init() is called without a document the backend uses the old (bad) behavior where it infers which document to connect to. At this time, we aren't blocking calls without a document specified. That being said, we should have all of our example code specify a document. |
At risk of oversharing this is the code that ends up getting hit when we don't have a document specified |
Awesome, that's how the notebooks are currently after my edit. Can you approve? 🙏🏻 |
Pull Request Description
What and why?
It's now required in ValidMind Library versions >=2.12.0 that a document is selected when copying your code snippet in the ValidMind Platform. Notebooks and notebook templating updated to reflect this functionality:
Notebook templating
The templates in
notebooks/templateshave been updated to reflect the new UX, and the handy templating script updated with role-based / document-type aware mini-template insertion. Previously, the template generator used single, one-size-fits-all mini-templates for "about", "install", and "next steps" sections. Now, the content varies depending on the selected role and document type (Development, Validation, or Monitoring).Role / document type selection flow (
e2e_template.py)select_document()— Prompts the user to pick a role/document type (Developer/Development, Validator/Validation, Developer/Monitoring) and stores it in a module-level_selected_documentvariable.select_install()— Prompts the user to choose between "Installation Only" or "Both Install & Initialize", stored in_selected_install.These selections drive which mini-template notebooks get appended downstream.
Mini-templates reorganized into subdirectories
The previously flat mini-template files have been moved into organized subdirectories, with role-specific variants added:
_about-validmind.ipynbabout-validmind/_about-validmind-developers.ipynb(renamed),_about-validmind-validators.ipynb(new)_install-initialize-validmind.ipynbinstall-validmind/_install-initialize-with-development.ipynb(renamed),_install-initialize-with-validation.ipynb(new),_install-initialize-with-monitoring.ipynb(new),_install-only.ipynb(new)_next-steps.ipynbnext-steps/_next-steps-development.ipynb(renamed),_next-steps-validation.ipynb(new),_next-steps-monitoring.ipynb(new)Refactored append logic
_append_notebook(filepath, relative_path)helper to avoid duplicated notebook-appending code acrossadd_about,add_install, andnext_steps.add_about(),add_install(), andnext_steps()now look up the correct mini-template based on the stored_selected_documentand_selected_installvalues instead of hardcoding a single file.Updated
notebooks/templates/e2e-notebook.ipynbtm.select_document()andtm.select_install()in the interactive notebook workflow.Updated
notebooks/templates/README.mdabout-validmind/,install-validmind/,next-steps/).Updated notebooks
Large-scale content update across ~60+ existing notebooks to standardize initialization instructions, terminology, and formatting
Standardized notebook content across the entire repo
The bulk of the changes (60+ notebooks across
quickstart/,tutorials/,how_to/,use_cases/, andcode_sharing/) apply consistent updates to the "install and initialize" boilerplate sections:Developmentfrom the DOCUMENT drop-down menu").vm.init()code blocks: Replaced hardcoded placeholder credentials (api_host="https://api.prod.validmind.ai/...",api_key="...") with commented-out placeholders (# api_host="...",# api_key="..."), making it clearer these are meant to be filled in via.envfiles.vm.preview_template()calls where missing.How to test
Spot check changed notebooks
Pick some notebooks included the diff to confirm that the new templating instructions reflect the new UX changes outlined in the detailed changelog above.
Run the notebook templating script
To test pull down this PR:
gh pr checkout 486Then run the notebook:
notebooks/templates/e2e-notebook.ipynb.Or call the script that the notebook runs on:
make notebookWhat needs special review?
Important
Some
vm.init()examples already had thedocumentkey inserted but commented out, which isn't correct as far as I understand — it needs to be included explicitly in theinitcall as it has no fallback inapi_client.py:validmind-library/validmind/api_client.py
Line 35 in ef050c0
Someone should confirm that this is the case though, since the docs also tell you to include this explicitly instead of in the
.envfile. 😅Dependencies, breaking changes, and deployment notes
Follow up to validmind/documentation#1211.
Note
Changes to notebooks will be pulled into the
documentationside on the next release publication.Release notes
Covered in #479.
Checklist