Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.10.1-33-g0f85abf
_commit: v0.10.1-40-g29e2ccf
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/diffraction-app
app_doi: 10.5281/zenodo.18163581
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/backmerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ concurrency:
group: backmerge-master-into-develop
cancel-in-progress: false

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
backmerge:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ on:
- 'false'
- 'true'

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
del-runs:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ concurrency:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Job 1: Run docstring coverage
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ env:
DEVELOP_BRANCH: develop
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
dashboard:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ env:
IS_RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}
GITHUB_REPOSITORY: ${{ github.repository }}
NOTEBOOKS_DIR: tutorials
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Single job that builds and deploys documentation.
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/issues-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
permissions:
issues: write

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
check-labels:
if: github.actor != 'easyscience[bot]'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ permissions:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
lint-format:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
pypi-publish:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ permissions:
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Job 1: Test installation from PyPI on multiple OS
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
draft-release-notes:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ permissions:
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
SOURCE_BRANCH: ${{ inputs.source_branch || 'develop' }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
create-pull-request:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ permissions:
contents: read
security-events: write

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
codeql:
name: Code scanning
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
permissions:
contents: read

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
code-tests-trigger:
runs-on: ubuntu-latest
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
PY_VERSIONS: '3.12 3.14'
PIXI_ENVS: 'py-312-env py-314-env'
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Job 1: Set up environment variables
Expand Down Expand Up @@ -214,7 +217,14 @@ jobs:
# platform-specific deps so this is a no-op on Linux/Windows.
echo "Adding libc++ for macOS (required by diffpy.pdffit2)"
pixi add --platform osx-arm64 libcxx
pixi add --platform osx-64 libcxx

# Doing this in a hacky way, as pixi does not support adding
# dependencies from a custom PyPI index with a CLI command without
# specifying full wheel name.
echo "Adding pycrysfml from custom PyPI index"
echo '' >> pixi.toml
echo '[pypi-dependencies]' >> pixi.toml
echo 'pycrysfml = { version = ">=0.2.1", index = "https://easyscience.github.io/pypi/" }' >> pixi.toml

echo "Looking for wheel in ../dist/py$py_ver/"
ls -l "../dist/py$py_ver/"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/tutorial-tests-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
permissions:
contents: read

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
tutorial-tests-trigger:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tutorial-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ concurrency:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
# Job 1: Test tutorials as scripts and notebooks on multiple OS
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ CMakeLists.txt.user*
.cache/
*.log
*.zip

# ED
# Used to fetch tutorials data during their runtime. Need to have '/' at
# the beginning to avoid ignoring 'data' module in the src/.
/data/
Binary file not shown.
Binary file removed deps/pycrysfml-0.1.6-py312-none-win_amd64.whl
Binary file not shown.
51 changes: 45 additions & 6 deletions docs/docs/tutorials/ed-1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e1c6f514",
"id": "9cc849f9",
"metadata": {
"tags": [
"hide-in-docs"
Expand Down Expand Up @@ -108,6 +108,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Add structure from downloaded CIF\n",
"project.structures.add_from_cif_path(structure_path)"
]
},
Expand Down Expand Up @@ -137,6 +138,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Add experiment from downloaded CIF\n",
"project.experiments.add_from_cif_path(expt_path)"
]
},
Expand All @@ -145,7 +147,7 @@
"id": "11",
"metadata": {},
"source": [
"## Step 4: Perform Analysis"
"## Step 4: Perform Analysis (cryspy)"
]
},
{
Expand All @@ -168,7 +170,7 @@
"outputs": [],
"source": [
"# Show fit results summary\n",
"project.analysis.show_fit_results()"
"project.analysis.display.fit_results()"
]
},
{
Expand All @@ -178,6 +180,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Show defined experiment names\n",
"project.experiments.show_names()"
]
},
Expand All @@ -188,15 +191,16 @@
"metadata": {},
"outputs": [],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
"# Plot measured vs. calculated diffraction patterns\n",
"project.plotter.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "16",
"metadata": {},
"source": [
"## Step 5: Show Project Summary"
"## Step 5: Perform Analysis (crysfml)"
]
},
{
Expand All @@ -206,7 +210,42 @@
"metadata": {},
"outputs": [],
"source": [
"project.summary.show_report()"
"# Change calculation engine from 'cryspy' to 'crysfml'\n",
"project.experiments['hrpt'].show_supported_calculator_types()\n",
"project.experiments['hrpt'].calculator_type = 'crysfml'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"metadata": {},
"outputs": [],
"source": [
"# Start refinement\n",
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"metadata": {},
"outputs": [],
"source": [
"# Show fit results summary\n",
"project.analysis.display.fit_results()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"metadata": {},
"outputs": [],
"source": [
"# Plot measured vs. calculated diffraction patterns\n",
"project.plotter.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
}
],
Expand Down
24 changes: 21 additions & 3 deletions docs/docs/tutorials/ed-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
structure_path = ed.download_data(id=1, destination='data')

# %%
# Add structure from downloaded CIF
project.structures.add_from_cif_path(structure_path)

# %% [markdown]
Expand All @@ -50,10 +51,11 @@
expt_path = ed.download_data(id=2, destination='data')

# %%
# Add experiment from downloaded CIF
project.experiments.add_from_cif_path(expt_path)

# %% [markdown]
# ## Step 4: Perform Analysis
# ## Step 4: Perform Analysis (cryspy)

# %%
# Start refinement. All parameters, which have standard uncertainties
Expand All @@ -65,13 +67,29 @@
project.analysis.display.fit_results()

# %%
# Show defined experiment names
project.experiments.show_names()

# %%
# Plot measured vs. calculated diffraction patterns
project.plotter.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)

# %% [markdown]
# ## Step 5: Show Project Summary
# ## Step 5: Perform Analysis (crysfml)

# %%
project.summary.show_report()
# Change calculation engine from 'cryspy' to 'crysfml'
project.experiments['hrpt'].show_supported_calculator_types()
project.experiments['hrpt'].calculator_type = 'crysfml'

# %%
# Start refinement
project.analysis.fit()

# %%
# Show fit results summary
project.analysis.display.fit_results()

# %%
# Plot measured vs. calculated diffraction patterns
project.plotter.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)
Loading
Loading