Pixify and fix plot issue#253
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the project from Conda to Pixi for environment and dependency management, while also fixing plot rendering issues in Jupyter notebooks. The migration consolidates all environment configuration into a single pyproject.toml file and introduces automated workflows for dependency updates and code quality checks.
- Migration from Conda to Pixi with consolidated environment management in
pyproject.toml - Implementation of automated CI/CD workflows for testing, dependency updates, and pre-commit maintenance
- Fix for plot rendering issues in notebooks by properly capturing output in widgets
Reviewed Changes
Copilot reviewed 85 out of 522 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | New Pixi configuration with modular features and environments for scientific computing |
| notebooks/tests/test_imports.py | Import validation test ensuring all required packages are available |
| notebooks/__code/venus_display_nexus_tpx3/main.py | Fixed plot rendering by capturing output in widgets and improved code formatting |
| conda/* and environment.yml files | Removed legacy Conda environment files |
| README.md | Updated documentation with Pixi installation and usage instructions |
| .github/workflows/* | New automated workflows for testing, dependency updates, and pre-commit maintenance |
| .pre-commit-config.yaml | Enhanced pre-commit configuration with additional hooks and Pixi integration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ipython = "*" | ||
|
|
||
| [tool.pixi.feature.jupyter.tasks] | ||
| lab = "jupyter lab --NotebookApp.nbserver_extensions=\"{'jupyterlab':True}\"" |
There was a problem hiding this comment.
The --NotebookApp.nbserver_extensions flag is deprecated in newer JupyterLab versions. Consider using jupyter lab without this flag or use the modern configuration approach with jupyter_server_config.py if specific extensions need to be configured.
| lab = "jupyter lab --NotebookApp.nbserver_extensions=\"{'jupyterlab':True}\"" | |
| lab = "jupyter lab" |
| ax1.set_xlabel("Event Time Offset (micros)") | ||
| ax1.set_ylabel("Counts") | ||
| ax1.set_title("Event Time Offset Histogram") | ||
| plt.tight_layout() |
There was a problem hiding this comment.
The plt.tight_layout() call affects the global matplotlib state, but since plots are being captured within an output widget context, this should be applied to the specific figure instance. Use fig1.tight_layout() instead to avoid potential interference with other plots.
| plt.tight_layout() | |
| fig1.tight_layout() |
| im = ax2.imshow(full_image, cmap="viridis", interpolation="nearest") | ||
| plt.colorbar(im, ax=ax2) | ||
| ax2.set_title(os.path.basename(nexus_full_path)) | ||
| plt.tight_layout() |
There was a problem hiding this comment.
The plt.tight_layout() call affects the global matplotlib state, but since plots are being captured within an output widget context, this should be applied to the specific figure instance. Use fig2.tight_layout() instead to avoid potential interference with other plots.
| plt.tight_layout() | |
| fig2.tight_layout() |
JeanBilheux
left a comment
There was a problem hiding this comment.
Tested a couple of notebook. All the notebooks will be tested over a long period of time but the deployment and launch of the notebooks works perfectly. Plot not being displayed has been fixed as well.
This PR introduces the following changes:
pixito manage the projectTest instructions
pixi installto install all the dependenciespixi run -e dev pre-commit installpixi run labto start the juptyerlab instancevenus_display_nexus_tpx3.ipynbto verify that plot are visible from last cell.Summary [AI]
This pull request modernizes and streamlines environment and dependency management for the project by fully migrating to Pixi, removing legacy Conda configuration files, and introducing robust automation for dependency updates and code quality checks. It also updates the documentation to reflect these changes and enhances pre-commit and CI workflows for better consistency and maintainability.
Migration to Pixi and Dependency Management:
conda/neutron-imaging.yml,conda/neutron-imaging-dev.yml,environment.yml) and the manual setup script (config_conda_env.sh), consolidating all environment management under Pixi. (F4957d57R1, [1] [2] [3].gitattributesentry to treatpixi.lockas a generated YAML file and prevent 3-way merges.Continuous Integration and Automation Improvements:
test-and-deploy.yml) to use Pixi for environment setup, testing, linting, and dependency auditing, replacing Conda-based steps.update-lockfiles.yml: Automates weekly updates of thepixi.lockfile and creates pull requests for dependency updates.pre-commit-autoupdate.yml: Automatically updates pre-commit hooks monthly and creates corresponding pull requests.Pre-commit and Linting Enhancements:
.pre-commit-config.yaml:pixi.lockfrom pre-commit checks and added a custompixi-lock-checkhook..yamllintconfiguration for consistent YAML linting.Documentation Updates:
README.mdto provide clear instructions for using Pixi, including installation, common commands, and updated testing and deployment sections. [1] [2]Miscellaneous:
commit-commentGitHub Action in the deployment workflow.Migration to Pixi and Dependency Management
conda/neutron-imaging.yml,conda/neutron-imaging-dev.yml,environment.yml,config_conda_env.sh). (F4957d57R1, [1] [2] [3].gitattributesrule to treatpixi.lockas a generated file and prevent merge conflicts.CI/CD and Automation
Pre-commit and Linting
pixi.lockand notebooks, and included new YAML/TOML linters and a custom Pixi lockfile check..yamllintconfiguration for YAML style enforcement.Documentation
README.mdto reflect Pixi usage, including installation, commands, and updated testing/deployment instructions. [1] [2]Miscellaneous
commit-commentaction.