Skip to content

Commit

Permalink
Merge pull request #33 from bpuchala/2.X_enumerate_superlattices_shape
Browse files Browse the repository at this point in the history
Various for 2.0a9
  • Loading branch information
bpuchala authored Jan 26, 2024
2 parents 0285af4 + 74dac0d commit 5982a81
Show file tree
Hide file tree
Showing 20 changed files with 400 additions and 112 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: x86_64

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist_linux
path: ./wheelhouse/*.whl

build_wheels_macos_x86_64:
name: Build x86_64 wheels on macos-12
runs-on: macos-12

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist_macos
path: ./wheelhouse/*.whl

build_sdist:
name: Build sdist
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -60,7 +60,7 @@ jobs:
- name: upload sdist
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist_sdist
path: dist/*.tar.gz
6 changes: 3 additions & 3 deletions .github/workflows/test-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -29,7 +29,7 @@ jobs:
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-linux-cxx-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -29,7 +29,7 @@ jobs:
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: upload test log
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libcasm-xtal-cxx-test-log
path: build_cxx_test/Testing/Temporary/LastTest.log
8 changes: 4 additions & 4 deletions .github/workflows/test-linux-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -21,14 +21,14 @@ jobs:
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3

- name: checkout libcasm-global
if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: prisms-center/CASMcode_global
path: CASMcode_global
Expand All @@ -47,7 +47,7 @@ jobs:
- name: save libcasm-global cache
id: cache-libcasm-global-save
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: CASMcode_global/dist
key: ${{ steps.cache-libcasm-global-restore.outputs.cache-primary-key }}
8 changes: 4 additions & 4 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -29,7 +29,7 @@ jobs:
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: upload docs
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libcasm-xtal-docs
path: python/doc/_build/html
6 changes: 3 additions & 3 deletions .github/workflows/test-macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: macOS-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: upload libcasm-xtal-macos-latest-x86_64-dist
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libcasm-xtal-macos-latest-x86_64-dist
path: dist
4 changes: 2 additions & 2 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: macOS-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [2.0a9] - X
## [2.0a9] - Unreleased

### Fixed

- Fix CASM::xtal::make_primitive, which was not copying unique_names. This also fixes the output of libcasm.xtal.make_primitive which was losing the occ_dof list as a result.
- Fix JSON output of xtal::BasicStructure site label

### Changed

Expand All @@ -20,10 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add to libcasm.xtal: make_primitive_prim (equivalent to current make_primitive), make_primtive_structure, and make_canonical_structure.
- Add to libcasm.xtal: make_primitive_prim (equivalent to current make_primitive), make_primitive_structure, and make_canonical_structure.
- Add options to the BCC and FCC structure factory functions in libcasm.xtal.structures to make the conventional cubic unit cells.
- Add to libcasm.xtal: StructureAtomInfo namedtuple, and methods sort_structure_by_atom_info, sort_structure_by_atom_type, sort_structure_by_atom_coordinate_frac, and sort_structure_by_atom_coordinate_cart
- Add to libcasm.xtal: substitute_structure_species
- Add to libcasm.xtal.Prim: method labels, constructor parameter `labels`
- Add to libcasm.xtal.Lattice: methods reciprocal, volume, lengths_and_angles, from_lengths_and_angles
- Added `unit_cell`, `diagonal_only`, and `fixed_shape` parameters to libcasm.xtal.enumerate_superlattices.


## [2.0a8] - 2023-11-15

Expand Down
8 changes: 5 additions & 3 deletions include/casm/crystallography/Lattice.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ class Lattice : public Comparisons<CRTPBase<Lattice>> {

Lattice(Eigen::Ref<const Eigen::Vector3d> const &vec1,
Eigen::Ref<const Eigen::Vector3d> const &vec2,
Eigen::Ref<const Eigen::Vector3d> const &vec3, double xtal_tol = TOL,
bool force = false);
Eigen::Ref<const Eigen::Vector3d> const &vec3, double xtal_tol = TOL);

/// Construct Lattice from a matrix of lattice vectors, where lattice vectors
/// are columns
///(e.g., lat_mat is equivalent to coord_trans[FRAC])
Lattice(Eigen::Ref<const Eigen::Matrix3d> const &lat_mat =
Eigen::Matrix3d::Identity(),
double xtal_tol = TOL, bool force = false);
double xtal_tol = TOL);

static Lattice from_lengths_and_angles(std::vector<double> lengths_and_angles,
double xtal_tol = TOL);

/// \brief Construct FCC primitive cell of unit volume
static Lattice fcc(double tol = TOL);
Expand Down
58 changes: 42 additions & 16 deletions python/doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import os

# -- package specific configuration --
project = "libcasm-xtal"
version = "2.0" # The short X.Y version.
release = "2.0a8" # The full version, including alpha/beta/rc tags.
project_desc = "CASM Crystallography"
logo_text = "libcasm-xtal"
github_url = "https://github.com/prisms-center/CASMcode_crystallography/"
pypi_url = "https://pypi.org/project/libcasm-xtal/"
intersphinx_libcasm_packages = [("global", "2.0"), ("configuration", "2.0")]


# -- CASM common configuration ---

# -*- coding: utf-8 -*-
#
# CASM documentation build configuration file, created by
Expand All @@ -12,7 +27,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os

# -- General configuration ------------------------------------------------

Expand All @@ -35,8 +49,7 @@

# if LIBCASM_LOCAL_PYDOCS env variable is set, create local docs
pydocs_path = os.environ.get("LIBCASM_LOCAL_PYDOCS", None)
packages = [("global", "2.0"), ("configuration", "2.0")]
for package, vers in packages:
for package, vers in intersphinx_libcasm_packages:
if pydocs_path is None:
url = (
f"https://prisms-center.github.io/CASMcode_pydocs/libcasm/{package}/{vers}/"
Expand Down Expand Up @@ -87,18 +100,14 @@
master_doc = "index"

# General information about the project.
project = "libcasm-xtal"
copyright = "2023, CASM Developers"
author = "CASM Developers"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "2.0"
# The full version, including alpha/beta/rc tags.
release = "2.0a8"


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -132,12 +141,29 @@
html_logo = "_static/small_logo.svg"
html_theme_options = {
"logo": {
"text": "libcasm-xtal",
"text": logo_text,
"image_light": "_static/small_logo.svg",
"image_dark": "_static/small_logo_dark.svg",
},
"pygment_light_style": "xcode",
"pygment_dark_style": "lightbulb",
"icon_links": [
{
# Label for this link
"name": "GitHub",
"url": github_url, # required
"icon": "fa-brands fa-github",
"type": "fontawesome",
},
{
# Label for this link
"name": "PyPI",
"url": pypi_url, # required
"icon": "fa-brands fa-python",
"type": "fontawesome",
},
],
# "primary_sidebar_end": ["primary_sidebar_end"]
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -192,8 +218,8 @@
latex_documents = [
(
master_doc,
"libcasm-xtal.tex",
"libcasm-xtal Documentation",
f"{project}.tex",
f"{project} Documentation",
"CASM Developers",
"manual",
),
Expand All @@ -203,7 +229,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "libcasm-xtal", "libcasm-xtal Documentation", [author], 1)]
man_pages = [(master_doc, f"{project}", f"{project} Documentation", [author], 1)]

# -- Options for Texinfo output -------------------------------------------

Expand All @@ -213,11 +239,11 @@
texinfo_documents = [
(
master_doc,
"libcasm-xtal",
"libcasm-xtal Documentation",
f"{project}",
f"{project} Documentation",
author,
"libcasm-xtal",
"CASM Crystallography",
f"{project}",
project_desc,
"Miscellaneous",
),
]
2 changes: 1 addition & 1 deletion python/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The libcasm-xtal package is the CASM crystallography module. This includes:
About CASM
==========

The libcasm-global package is part of the CASM_ open source software package, which is designed to perform first-principles statistical mechanical studies of multi-component crystalline solids.
The libcasm-xtal package is part of the CASM_ open source software package, which is designed to perform first-principles statistical mechanical studies of multi-component crystalline solids.

CASM is developed by the Van der Ven group, originally at the University of Michigan and currently at the University of California Santa Barbara.

Expand Down
4 changes: 2 additions & 2 deletions python/doc/reference/libcasm/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
..
DO NOT DELETE! This causes _autosummary to generate stub files
libcasm.xtal module
===================
Reference (libcasm-xtal)
========================

.. autosummary::
:toctree: _autosummary
Expand Down
Loading

0 comments on commit 5982a81

Please sign in to comment.