Skip to content

Commit

Permalink
Merge branch 'rc'
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Nov 6, 2022
2 parents be3eca7 + d426421 commit 42cf4f6
Show file tree
Hide file tree
Showing 15 changed files with 258 additions and 181 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## Describe the bug

<!-- A clear and concise description of what the bug is. -->

## To Reproduce

<!--
If you use spglib's Python API, please do not use ASE or Pymatgen's wrapper to make it easier to identify your problem.
The format for crystal structures is shown here: https://spglib.github.io/spglib/python-spglib.html#variables
If spglib returns different results by changing `symprec`, `angle_tolerance`, or `mag_symprec`, please report it too.
-->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

- Python version:
- Spglib's version:

## Additional context

<!-- Add any other context about the problem here. -->
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## Is your feature request related to a problem? Please describe.

<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

## Describe the solution you'd like

<!-- A clear and concise description of what you want to happen. -->

## Describe alternatives you've considered

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
78 changes: 78 additions & 0 deletions .github/workflows/pypi-wheel-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Spglib PyPI Wheel builds for linux

on:
push:
branches:
- rc
- master

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
with:
package-dir: python
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: |
pip install numpy
cd python
sh pre-build-script.sh
python setup.py sdist
cd ..
- uses: actions/upload-artifact@v3
with:
path: python/dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Publish package to TestPyPI
if: startsWith(github.ref, 'refs/heads/rc')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/heads/master')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
84 changes: 0 additions & 84 deletions .github/workflows/pypi-wheels-win-mac.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/pypi-wheels.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ set(SOURCES ${PROJECT_SOURCE_DIR}/src/arithmetic.c
${PROJECT_SOURCE_DIR}/src/spin.c
${PROJECT_SOURCE_DIR}/src/symmetry.c)

# avoid One Definition Rule problems
# only available since 3.16.0
# VERSION_GREATER_EQUAL only available since 3.7.0, so let's do it manually
if (NOT CMAKE_MAJOR_VERSION LESS "3")
if (CMAKE_MAJOR_VERSION GREATER "3" OR NOT CMAKE_MINOR_VERSION LESS "16")
set_source_files_properties(
${SOURCES} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
)
endif()
endif()

# Shared library
add_library(symspg SHARED ${SOURCES})

Expand Down
6 changes: 6 additions & 0 deletions admin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Releasing a new Spglib version

1. Update <doc/releases.md>
2. Increment version at <src/version.h>
3. Push the commit to `rc` branch (Github actions publishes the package to TestPyPI automatically)
4. Push the commit to `master` branch (Github actions publishes the package to PyPI automatically)
4 changes: 2 additions & 2 deletions doc/magnetic_symmetry_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
- `tensor_rank=1`
- `with_time_reversal=true`: {math}`1' \circ \mathbf{m} = -\mathbf{m}`
- `is_axial=true`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = (\mathrm{det} \mathbf{R}) \mathbf{R} \mathbf{m}`
- `is_axial=true`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = \mathbf{R} \mathbf{m}`
- `is_axial=false`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = \mathbf{R} \mathbf{m}`
- `with_time_reversal=false`: {math}`1' \circ \mathbf{m} = \mathbf{m}`
- `is_axial=true`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = (\mathrm{det} \mathbf{R}) \mathbf{R} \mathbf{m}`
- `is_axial=true`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = \mathbf{R} \mathbf{m}`
- `is_axial=false`: {math}`(\mathbf{R}, \mathbf{v}) \circ \mathbf{m} = \mathbf{R} \mathbf{m}`

<!-- ### Correspondence
Expand Down
5 changes: 5 additions & 0 deletions doc/releases.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# Summary of releases

## V2.0.2 (6 Nov. 2022)

- Fix segmentation fault in `spgms_get_symmetry_with_site_tensors` with high symprec [[#195]](https://github.com/spglib/spglib/pull/195)
- Fix possible segmentation fault in `get_magnetic_dataset` with high symprec [[#196]](https://github.com/spglib/spglib/pull/196)

## V2.0.1 (31 Aug. 2022)

- Fix magnetic tolerance for judging type-II MSG (#187)
Expand Down
4 changes: 3 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
requires = ["setuptools", "wheel", "numpy"]

[tool.cibuildwheel]
skip = ["pp*", "*-win32", "*-manylinux_i686"]
skip = ["pp*", "*-win32", "*-manylinux_i686", "*-musllinux*"]
manylinux-x86_64-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"
2 changes: 1 addition & 1 deletion src/overlap.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static int check_total_overlap_for_sorted(
search_start = 0;
for (i_orig = 0; i_orig < num_pos; i_orig++) {
/* Permanently skip positions filled near the beginning. */
while (found[search_start]) {
while ((search_start < num_pos) && found[search_start]) {
search_start++;
}

Expand Down
Loading

0 comments on commit 42cf4f6

Please sign in to comment.