Skip to content

backmerge after hotfix #178

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

backmerge after hotfix #178

wants to merge 2 commits into from

Conversation

rozyczko
Copy link
Member

@rozyczko rozyczko commented Jun 12, 2025

Interestingly, there is a large discrepancy between master and develop, despite develop being pushed to master for the 0.4.0 release

rozyczko and others added 2 commits April 4, 2025 19:15
* initial conversion to the new parameter syntax
Remaining issue with unit conversion (deg -> us)
Remaining Descriptor conversion

* added new Descriptors and fixed ruff

* use ruff 0.9, since 0.8.x didn't give good enough info

* rely on `new_param` branch of EXC

* assure exp names are correct

* Update README for logo links and project info

* Add CI workflow for documentation build and deploy

* Update development workflow

* Update docs and improve formatting

* Fix issues after reviewing PR

* assign interface when necessary

* Fix path in mkdocs.yml creation step

* _pd_calib.2theta_offset in parameters for display
proper handling of error format in experiment cif

* minor changes for multiphase

* added optional to some phase params to make possible editing CIF in
place
modified setup for the cryspy job object

* fix offset setup

* added error parser for integers

* fixed reading of errors in phase cif

* tof stuff from new_param_tof

* changes after merging DescriptorAny in EasyCrystallography

* added updated version of dataBlockToCif

* Fixed TOF profile calcs. Fixed typos

* minor fixes and performance impromevents

* fix for multiphase scale issue not being properly set up after fitting

* add fix for exp names, not just tof.
fix phase generation for cases when arguments don't contain atoms/cell
adjusted fitting results

* Added bridge link for intermediate updates
Updated dependency for easyScience

* fixed phase update for multiphase cases

* minor fix for ToF

* fixes for experiment update

---------

Co-authored-by: Andrew Sazonov <[email protected]>
Co-authored-by: Andrew Sazonov <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['enhancement', 'bug', 'chore', 'documentation', 'refactor']

@rozyczko rozyczko added chore Changes to the build process or auxiliary tools and libraries such as documentation generation [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) [priority] high Should be prioritized soon labels Jun 12, 2025
@github-advanced-security
Copy link

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.

Comment on lines +24 to +163
with:
python-version: '3.12'

- name: Upgrade package installer for Python
run: python -m pip install --upgrade pip

# Install MkDocs -- static site generator
# https://www.mkdocs.org
- name: Install MkDocs and its dependencies
run: >
pip install mkdocs mkdocs-material 'mkdocs-autorefs<1.3.0'
mkdocs-jupyter mkdocs-plugin-inline-svg
mkdocs-markdownextradata-plugin mkdocstrings-python

# Install EasyDiffraction Library to run Jupyter notebooks
# Install with the 'charts' and 'docs' extras
- name: Install EasyDiffraction Library and its dependencies
run: pip install 'easydiffraction[charts]'

# Download and add the extra files from the easyscience/assets-docs repository
- name: Get easyscience/assets-docs files
run: |
git clone https://github.com/easyscience/assets-docs.git
cp -R assets-docs/docs/assets/ docs/assets/
cp -R assets-docs/includes/ includes/
cp -R assets-docs/overrides/ overrides/

# Download and add the extra files from the easyscience/assets-branding repository
- name: Get easyscience/assets-branding files
run: |
git clone https://github.com/easyscience/assets-branding.git
mkdir -p docs/assets/images/
cp assets-branding/easydiffraction/logos/ed-logo-2_dark.svg docs/assets/images/
cp assets-branding/easydiffraction/logos/ed-logo-2_light.svg docs/assets/images/
cp assets-branding/easydiffraction/icons/ed-icon_256x256.png docs/assets/images/favicon.png
mkdir -p overrides/.icons/
cp assets-branding/easydiffraction/icons/ed-icon_bw.svg overrides/.icons/easydiffraction.svg
cp assets-branding/easyscience-org/icons/eso-icon_bw.svg overrides/.icons/easyscience.svg

# Copy Jupyter notebooks from the project to the docs folder
# The notebooks are used to generate the documentation
- name:
Copy Jupyter notebooks from ${{ env.NOTEBOOKS_DIR }}/ to docs/${{
env.NOTEBOOKS_DIR }}/
run: cp -R ${{ env.NOTEBOOKS_DIR }}/ docs/${{ env.NOTEBOOKS_DIR }}/

# The following step is needed to avoid the following message during the build:
# "Matplotlib is building the font cache; this may take a moment"
- name: Pre-build site step
run: python -c "import easydiffraction"

# Create the mkdocs.yml configuration file
# The file is created by merging two files:
# - assets-docs/mkdocs.yml - the common configuration (theme, plugins, etc.)
# - docs/mkdocs.yml - the project-specific configuration (project name, TOC, etc.)
- name: Create mkdocs.yml file
run: cat assets-docs/mkdocs.yml docs/mkdocs.yml > mkdocs.yml

# Build the static files
# Input: docs/ directory containing the Markdown files
# Output: site/ directory containing the generated HTML files
- name: Build site with MkDocs
run: |
export JUPYTER_PLATFORM_DIRS=1
mkdocs build

# Set up the Pages action to configure the static files to be deployed
# NOTE: The repository must have GitHub Pages enabled and configured to build using GitHub Actions
# This can be done via https://github.com/easyscience/diffraction-lib/settings/pages
# Select: Build and deploy - Source - GitHub Actions
- name: Setup GitHub Pages
uses: actions/configure-pages@v5

# Upload the static files from the site/ directory to be used in the next job
# This artifact is named github-pages and is a single gzip archive containing a single tar file
# The artifact is then used in the next job by actions/deploy-pages to deploy the static files to GitHub Pages
# Unfortunately, the artifact is not available for download, so extra steps below are needed to do similar things
- name:
Upload built site as artifact for
easyscience.github.io/diffraction-lib (all branches)
uses: actions/upload-pages-artifact@v3
with:
path: site/

# Upload the static files from the site/ directory to be used in the next job
# This extra step is needed to allow the download of the artifact in the next job
# for pushing its content to the branch named 'easydiffraction.org'
- name:
Upload built site as artifact for gh_pages and easydiffraction.org
(master branch)
if: ${{ env.CI_BRANCH == 'master' }}
uses: actions/upload-artifact@v4
with:
name: artifact # name of the artifact (without the extension zip)
path: site/
if-no-files-found: 'error'
compression-level: 0

# Job 2: Deploy the static files
deploy-docs:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the issue, we need to add a permissions block to the build-docs job in the workflow file. This block should explicitly set the permissions required for the job, which in this case is likely limited to contents: read. This ensures that the GITHUB_TOKEN used in the job has only the minimal permissions necessary to complete the tasks.

The changes should be made in the .github/workflows/build-docs.yml file, specifically within the build-docs job definition. No additional imports, methods, or definitions are required.


Suggested changeset 1
.github/workflows/build-docs.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -24,2 +24,4 @@
     runs-on: macos-14 # Use macOS to switch to dark mode for Plotly charts
+    permissions:
+      contents: read
 
EOF
@@ -24,2 +24,4 @@
runs-on: macos-14 # Use macOS to switch to dark mode for Plotly charts
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes to the build process or auxiliary tools and libraries such as documentation generation [priority] high Should be prioritized soon [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant