Skip to content

Commit e43784d

Browse files
committed
Version 3.3.2
Updated pyproject.toml Added github workflows.
1 parent a8ae0dc commit e43784d

File tree

5 files changed

+88
-3
lines changed

5 files changed

+88
-3
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Code CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
dist:
9+
runs-on: "ubuntu-latest"
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Build sdist and wheel
16+
run: pipx run build
17+
18+
- name: Upload sdist and wheel as artifacts
19+
uses: actions/upload-artifact@v3
20+
with:
21+
name: dist
22+
path: dist
23+
24+
pypi:
25+
# upload to PyPI and make a release on every tag
26+
if: github.ref_type == 'tag'
27+
needs: [dist]
28+
29+
runs-on: ubuntu-latest
30+
permissions:
31+
# this permission is mandatory for trusted publishing To PyPI
32+
id-token: write
33+
# Specify the GitHub Environment to publish to
34+
environment: release
35+
36+
steps:
37+
# download sdist and wheel from dist job
38+
- uses: actions/download-artifact@v3
39+
40+
# publish to PyPI using trusted publishing
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
# Deduplicate jobs from pull requests and branch pushes within the same repo.
10+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.11"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Upgrade pip
25+
run: python -m pip install --upgrade pip
26+
27+
- name: Install dependencies
28+
run: python -m pip install .
29+
30+
- name: Install pytest
31+
run: python -m pip install pytest
32+
33+
- name: Dans_Diffraction Version
34+
run: python -c "import Dans_Diffraction; print(Dans_Diffraction.module_info())"
35+
36+
- name: Run tests
37+
run: python -m pytest

Examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ $ ipython -i --matplotlib tk ./example_plot_powder.py
2323
|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2424
| example_build_crystal.py | Build your very own crystal structure, using lattice parameters and atomic coordinates |
2525
| example_calculate_intensities.py | Calculate list of reflections using different methods Makes use of the new scattering functionality in Dans_Diffraction 2.0.0+ Requires Dans_Diffraction version >2.0.0 |
26+
| example_cell_basis.py | Select different cell basis options, requires Dans_Diffraction >V3.3 |
27+
| example_cell_sliders.py | Plot different cell basis options, requires Dans_Diffraction >V3.3 |
2628
| example_coherent_diffraction.py | Simulate coherent diffraction by creating a large crystallite of many unit cells. Use one of two methods to define a random crystallite shape: 1. random distribution of cells around a central point - cells are not always neighboring but creates a nice ellipsoid 2. random walk of cells - each cell has a direct neighbor but the shapes can be very odd Requires Dans_Diffraction version >2.0.0 |
29+
| example_complex_neutron_scattering.py | Calculate neutron scattering from isotopes using complex neutron scattering lengths |
2730
| example_crysalispro_cuts.py | Example Read recirpocal space cuts from CrysAlisPro |
2831
| example_crystal_orientation.py | Set and change the orientation of the crystal Makes use of the new orientation functionality in Dans_Diffraction 2.1.0+ Requires Dans_Diffraction version >2.1.0 |
2932
| example_cxro.py | Simulate the functionality of the CXRO website: https://henke.lbl.gov/optical_constants/ Use formulas from: B.L. Henke, E.M. Gullikson, and J.C. Davis, X-ray interactions: photoabsorption, scattering, transmission, and reflection at E=50-30000 eV, Z=1-92, Atomic Data and Nuclear Data Tables 54 no.2, 181-342 (July 1993). |

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools >= 61.0", "wheel", "numpy", "matplotlib"]
2+
requires = ["setuptools >= 61.0", "wheel", "pytest", "numpy", "matplotlib"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "Dans_Diffraction"
7-
version = "3.3.0"
7+
dynamic = ['version']
88
dependencies = [
99
"numpy",
1010
"matplotlib",
@@ -44,3 +44,6 @@ dansdiffraction = "Dans_Diffraction:start_gui"
4444

4545
[project.gui-scripts]
4646
dansdiffraction = "Dans_Diffraction:start_gui"
47+
48+
[tool.setuptools.dynamic]
49+
version = {attr = "Dans_Diffraction.__version__"}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def readme():
99
setup(
1010
name='Dans_Diffraction',
1111
packages=['Dans_Diffraction', 'Dans_Diffraction.tkgui'],
12-
version='3.2.1',
12+
version='3.3.2',
1313
description='Generate diffracted intensities from crystals',
1414
long_description_content_type='text/markdown',
1515
long_description=readme(),

0 commit comments

Comments
 (0)