From 92f89f0624e9f9df660ba17b2b02c25b756e82a5 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 8 May 2023 09:56:26 -0700 Subject: [PATCH] v2023.5.8 update CHANGES.rst fix shadowed python built-ins sort pyproject.toml arrays alphabetically --- CHANGES.rst | 104 +++++++++++++++++++++++++++++++++ pymatgen/symmetry/maggroups.py | 31 +++++----- pyproject.toml | 18 +++--- 3 files changed, 129 insertions(+), 24 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index b3280deac4f..d678ffe7f6f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,110 @@ Change log ========== +v2023.5.8 +--------- +* PR #2959 from @materialsproject dependabot/github_actions/pypa/cibuildwheel-2.12.3 + Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.11.4 to 2.12.3. +
+ Release notes +

Sourced from pypa/cibuildwheel's releases.

+
+

v2.12.3

+
    +
  • 🐛 Fix an import error when running on Python 3.7. (#1479)
  • +
+

v2.12.2

+
    +
  • 🐛 Fix a bug that caused an extra empty config-setting to be passed to the backend when CIBW_BUILD_FRONTEND is set to build. (#1474)
  • +
  • 🐛 Fix a crash that occurred when overwriting an existing wheel on Windows. (#1464)
  • +
  • 🛠 Pinned version updates, including CPython 3.10.11, 3.11.3, pip 23.1 and wheel 0.40.0.
  • +
+

v2.12.1

+
    +
  • 🐛 Fix a bug that prevented the use of CIBW_CONFIG_SETTINGS with the 'pip' build backend. (#1430)
  • +
+

v2.12.0

+
    +
  • ✨ Adds support for PyPy arm64 wheels. This means that you can build PyPy wheels for Apple Silicon machines. Cross-compilation is not supported for these wheels, so you'll have to build on an Apple Silicon machine. (#1372)
  • +
  • 🛠 Pinned version updates, including PyPy to v7.3.11 and setuptools to 66.0.0.
  • +
+
+
+
+ Changelog +

Sourced from pypa/cibuildwheel's changelog.

+
+

v2.12.3

+

19 April 2023

+
    +
  • 🐛 Fix an import error when running on Python 3.7. (#1479)
  • +
+

v2.12.2

+

18 April 2023

+
    +
  • 🐛 Fix a bug that caused an extra empty config-setting to be passed to the backend when CIBW_BUILD_FRONTEND is set to build. (#1474)
  • +
  • 🐛 Fix a crash that occurred when overwriting an existing wheel on Windows. (#1464)
  • +
  • 🛠 Pinned version updates, including CPython 3.10.11, 3.11.3, pip 23.1 and wheel 0.40.0.
  • +
+

v2.12.1

+

11 March 2023

+
    +
  • 🐛 Fix a bug that prevented the use of CIBW_CONFIG_SETTINGS with the 'pip' build backend. (#1430)
  • +
+

v2.12.0

+

16 Jan 2023

+
    +
  • ✨ Adds support for PyPy arm64 wheels. This means that you can build PyPy wheels for Apple Silicon machines. Cross-compilation is not supported for these wheels, so you'll have to build on an Apple Silicon machine. (#1372)
  • +
  • 🛠 Pinned version updates, including PyPy to v7.3.11 and setuptools to 66.0.0.
  • +
+
+
+
+ Commits + +
+
+ [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pypa/cibuildwheel&package-manager=github_actions&previous-version=2.11.4&new-version=2.12.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) + Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. + [//]: # (dependabot-automerge-start) + [//]: # (dependabot-automerge-end) + --- +
+ Dependabot commands and options +
+ You can trigger Dependabot actions by commenting on this PR: + - `@dependabot rebase` will rebase this PR + - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it + - `@dependabot merge` will merge this PR after your CI passes on it + - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it + - `@dependabot cancel merge` will cancel a previously requested merge and block automerging + - `@dependabot reopen` will reopen this PR if it is closed + - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually + - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) + - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) + - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) +
+* PR #2935 from @materialsproject pandas-v2-fixes + Closes #2914. + Replace calls to df.append() with pd.concat() and df.iteritems() with df.items(). +* PR #2925 from @jmmshn master + ## Allow proper versioning for forked repos + I'm not 100% sure how the current version numbering is updated for `pymatgen` but it's not able to update the number properly for forks. The forks seem to keep a much older version number (from before the forking) + This creates problems if you have the forked repo as a dependency in a requirement.txt file. + This should fix that issue. + v2023.3.23 ---------- * Misc bug fixes. diff --git a/pymatgen/symmetry/maggroups.py b/pymatgen/symmetry/maggroups.py index 0a66d1068f9..c1edce59760 100644 --- a/pymatgen/symmetry/maggroups.py +++ b/pymatgen/symmetry/maggroups.py @@ -11,6 +11,7 @@ from fractions import Fraction import numpy as np +from git import Sequence from monty.design_patterns import cached_class from pymatgen.core.lattice import Lattice @@ -32,7 +33,7 @@ class MagneticSpaceGroup(SymmetryGroup): Representation of a magnetic space group. """ - def __init__(self, id, setting_transformation="a,b,c;0,0,0"): + def __init__(self, label, setting_transformation="a,b,c;0,0,0"): """ Initializes a MagneticSpaceGroup from its Belov, Neronova and Smirnova (BNS) number supplied as a list or its label supplied @@ -106,14 +107,14 @@ def __init__(self, id, setting_transformation="a,b,c;0,0,0"): # retrieve raw data db = sqlite3.connect(MAGSYMM_DATA) c = db.cursor() - if isinstance(id, str): - id = "".join(id.split()) # remove any white space - c.execute("SELECT * FROM space_groups WHERE BNS_label=?;", (id,)) - elif isinstance(id, list): - c.execute("SELECT * FROM space_groups WHERE BNS1=? AND BNS2=?;", (id[0], id[1])) - elif isinstance(id, int): + if isinstance(label, str): + label = "".join(label.split()) # remove any white space + c.execute("SELECT * FROM space_groups WHERE BNS_label=?;", (label,)) + elif isinstance(label, list): + c.execute("SELECT * FROM space_groups WHERE BNS1=? AND BNS2=?;", (label[0], label[1])) + elif isinstance(label, int): # OG3 index is a 'master' index, going from 1 to 1651 - c.execute("SELECT * FROM space_groups WHERE OG3=?;", (id,)) + c.execute("SELECT * FROM space_groups WHERE OG3=?;", (label,)) raw_data = list(c.fetchone()) # Jones Faithful transformation @@ -132,10 +133,10 @@ def __init__(self, id, setting_transformation="a,b,c;0,0,0"): def _get_point_operator(idx): """Retrieve information on point operator (rotation matrix and Seitz label).""" - hex = self._data["bns_number"][0] >= 143 and self._data["bns_number"][0] <= 194 + is_hex = self._data["bns_number"][0] >= 143 and self._data["bns_number"][0] <= 194 c.execute( "SELECT symbol, matrix FROM point_operators WHERE idx=? AND hex=?;", - (idx - 1, hex), + (idx - 1, is_hex), ) op = c.fetchone() op = { @@ -281,7 +282,7 @@ def _parse_transformation(b): db.close() @classmethod - def from_og(cls, id): + def from_og(cls, label: Sequence[int] | str) -> MagneticSpaceGroup: """ Initialize from Opechowski and Guccione (OG) label or number. @@ -291,12 +292,12 @@ def from_og(cls, id): """ db = sqlite3.connect(MAGSYMM_DATA) c = db.cursor() - if isinstance(id, str): - c.execute("SELECT BNS_label FROM space_groups WHERE OG_label=?", (id,)) - elif isinstance(id, list): + if isinstance(label, str): + c.execute("SELECT BNS_label FROM space_groups WHERE OG_label=?", (label,)) + elif isinstance(label, list): c.execute( "SELECT BNS_label FROM space_groups WHERE OG1=? and OG2=? and OG3=?", - (id[0], id[1], id[2]), + (label[0], label[1], label[2]), ) bns_label = c.fetchone()[0] db.close() diff --git a/pyproject.toml b/pyproject.toml index c4723730329..cfb9d254e96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] requires = [ # pin NumPy version used in the build + "Cython>=0.29.23", "oldest-supported-numpy", "setuptools>=65.0.0", - "Cython>=0.29.23", ] build-backend = "setuptools.build_meta" @@ -29,9 +29,10 @@ select = [ "B", # flake8-bugbear "C40", # flake8-comprehensions "D", # pydocstyle - "E", # pycodestyle + "E", # pycodestyle error "F", # pyflakes "I", # isort + "PD", # pandas-vet "PIE", # flake8-pie "PL", # pylint "PT", # flake8-pytest-style @@ -40,9 +41,8 @@ select = [ "SIM", # flake8-simplify "TID", # tidy imports "UP", # pyupgrade - "W", # pycodestyle + "W", # pycodestyle warning "YTT", # flake8-2020 - "PD", # pandas-vet ] ignore = [ "B018", # Found useless expression. Either assign it to a variable or remove it. @@ -89,15 +89,15 @@ relative_files = true [tool.coverage.report] exclude_lines = [ - "pragma: no cover", + "@deprecated", "def __repr__", + "if 0:", + "if __name__ == .__main__.:", "if self.debug:", "if settings.DEBUG", + "pragma: no cover", "raise AssertionError", "raise NotImplementedError", - "if 0:", - "if __name__ == .__main__.:", - "@deprecated", "show_plot", ] @@ -108,7 +108,7 @@ explicit_package_bases = true no_implicit_optional = false [[tool.mypy.overrides]] -module = ["tabulate.*", "requests.*"] +module = ["requests.*", "tabulate.*"] ignore_missing_imports = true [tool.codespell]