-
Notifications
You must be signed in to change notification settings - Fork 0
Update tutorials, workflows, and project configuration #60
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
Conversation
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
2 similar comments
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces significant updates to documentation, tutorials, CI/CD workflows, and project configuration, focusing on improving the development experience and documentation quality for the EasyDiffraction library.
Key changes include:
- Conversion of Python tutorial scripts to Jupyter notebooks using Jupytext for better documentation integration
- Enhancement of CI/CD workflows with new automation features including security scanning, PR validation, and PyPI publishing
- Application of comprehensive code formatting and quality improvements using Ruff, YAPF, and Prettier across the codebase
Reviewed Changes
Copilot reviewed 142 out of 161 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
tutorials/*.py | Convert tutorial scripts to Jupytext format with installation checks for notebook compatibility |
tutorials/*.ipynb | Generate corresponding Jupyter notebooks with clean metadata and numbered cell IDs |
tools/update_spdx-headers.py | Add utility for managing SPDX license headers across source files |
tools/run_notebooks.sh | Increase notebook execution timeout for better CI reliability |
tools/create_mkdocs-yml.py | Apply code formatting improvements and better import organization |
tests/unit_tests/*.py | Comprehensive code formatting updates using modern Python style guidelines |
# !pip install 'easydiffraction[visualization]' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented pip install command should either be uncommented to be functional or removed if not intended for use. Consider using a conditional installation approach or providing clear instructions in comments.
# !pip install 'easydiffraction[visualization]' | |
# If running in a notebook, install using IPython magic; otherwise, instruct the user. | |
try: | |
from IPython import get_ipython | |
ipython = get_ipython() | |
if ipython is not None: | |
ipython.run_line_magic('pip', "install 'easydiffraction[visualization]'") | |
except Exception: | |
print("Please install 'easydiffraction[visualization]' manually using pip.") |
Copilot uses AI. Check for mistakes.
project.analysis.aliases.add( | ||
label='biso_Co1', | ||
param_uid=project.sample_models['cosio'].atom_sites['Co1'].b_iso.uid | ||
param_uid=project.sample_models['cosio'].atom_sites['Co1'].b_iso.uid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Trailing comma is now added consistently. This is good practice for Python function calls and improves version control diffs.
Copilot uses AI. Check for mistakes.
|
||
echo "\033[0;33m:::::: Run Jupyter notebooks\033[0m" | ||
pytest --nbmake examples/ --ignore-glob='examples/*emcee*' --nbmake-timeout=300 --color=yes -n=auto | ||
pytest --nbmake examples/ --ignore-glob='examples/*emcee*' --nbmake-timeout=600 --color=yes -n=auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doubling the timeout from 300 to 600 seconds may indicate performance issues in the notebooks. Consider investigating if notebooks can be optimized rather than just increasing timeout limits.
pytest --nbmake examples/ --ignore-glob='examples/*emcee*' --nbmake-timeout=600 --color=yes -n=auto | |
pytest --nbmake examples/ --ignore-glob='examples/*emcee*' --nbmake-timeout=300 --color=yes -n=auto |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR introduces updates to documentation, tutorials, and CI/CD workflows, including:
Tutorials & Documentation
CI/CD Workflows
Project Configuration & Code Quality
pyproject.toml
configuration and dependencies.download_from_repository()
utility.