Skip to content

Commit

Permalink
Version 3.3.2
Browse files Browse the repository at this point in the history
Updated pyproject.toml

Added github workflows.
  • Loading branch information
DanPorter committed Nov 21, 2024
1 parent a8ae0dc commit e43784d
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code CI

on:
push:
pull_request:

jobs:
dist:
runs-on: "ubuntu-latest"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build sdist and wheel
run: pipx run build

- name: Upload sdist and wheel as artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

pypi:
# upload to PyPI and make a release on every tag
if: github.ref_type == 'tag'
needs: [dist]

runs-on: ubuntu-latest
permissions:
# this permission is mandatory for trusted publishing To PyPI
id-token: write
# Specify the GitHub Environment to publish to
environment: release

steps:
# download sdist and wheel from dist job
- uses: actions/download-artifact@v3

# publish to PyPI using trusted publishing
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Run Tests

on:
push:
pull_request:

jobs:
build:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies
run: python -m pip install .

- name: Install pytest
run: python -m pip install pytest

- name: Dans_Diffraction Version
run: python -c "import Dans_Diffraction; print(Dans_Diffraction.module_info())"

- name: Run tests
run: python -m pytest
3 changes: 3 additions & 0 deletions Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ $ ipython -i --matplotlib tk ./example_plot_powder.py
|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| example_build_crystal.py | Build your very own crystal structure, using lattice parameters and atomic coordinates |
| 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 |
| example_cell_basis.py | Select different cell basis options, requires Dans_Diffraction >V3.3 |
| example_cell_sliders.py | Plot different cell basis options, requires Dans_Diffraction >V3.3 |
| 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 |
| example_complex_neutron_scattering.py | Calculate neutron scattering from isotopes using complex neutron scattering lengths |
| example_crysalispro_cuts.py | Example Read recirpocal space cuts from CrysAlisPro |
| 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 |
| 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). |
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools >= 61.0", "wheel", "numpy", "matplotlib"]
requires = ["setuptools >= 61.0", "wheel", "pytest", "numpy", "matplotlib"]
build-backend = "setuptools.build_meta"

[project]
name = "Dans_Diffraction"
version = "3.3.0"
dynamic = ['version']
dependencies = [
"numpy",
"matplotlib",
Expand Down Expand Up @@ -44,3 +44,6 @@ dansdiffraction = "Dans_Diffraction:start_gui"

[project.gui-scripts]
dansdiffraction = "Dans_Diffraction:start_gui"

[tool.setuptools.dynamic]
version = {attr = "Dans_Diffraction.__version__"}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def readme():
setup(
name='Dans_Diffraction',
packages=['Dans_Diffraction', 'Dans_Diffraction.tkgui'],
version='3.2.1',
version='3.3.2',
description='Generate diffracted intensities from crystals',
long_description_content_type='text/markdown',
long_description=readme(),
Expand Down

0 comments on commit e43784d

Please sign in to comment.