Skip to content

Conversation

@janbridley
Copy link
Collaborator

@janbridley janbridley commented Jan 25, 2025

Description

__getitem__, get_from_pairs, and get_from_loops now support "?" and "*" wildcards. This functionality is built in to python's fnmatch module, which is used under the hood for these queries. The full unix-style pattern matching is not supported (specifically "[xyz]" and "[!xyz]" patterns), as cif keys commonly contain bracket characters.

Motivation and Context

The box and lattice_vectors properties made an implicit assumption that files used the CIF format for the lookup keys. This assumption is no longer required, as "_cell_length_alpha" and "_cell.length_angle" can now be easily matched with "_cell?length_alpha".

Types of Changes

  • Documentation update
  • Bug fix
  • New feature
  • Breaking change1

1The change breaks (or has the potential to break) existing functionality and should be merged into the breaking branch

Checklist:

  • I am familiar with the Development Guidelines
  • The changes introduced by this pull request are covered by existing or newly introduced tests.
  • I have updated the changelog and added my name to the credits.

@janbridley janbridley marked this pull request as ready for review January 25, 2025 02:54
@janbridley janbridley merged commit 48599b5 into main Jan 25, 2025
8 checks passed
@janbridley janbridley deleted the wildcards branch March 13, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants