Skip to content

[pre-commit.ci] pre-commit autoupdate #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ current_version = 0.0.10-dev
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+(?P<build>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?
serialize =
serialize =
{major}.{minor}.{patch}-{release}+{build}
{major}.{minor}.{patch}+{build}
{major}.{minor}.{patch}-{release}
@@ -12,7 +12,7 @@ serialize =
[bumpversion:part:release]
optional_value = production
first_value = dev
values =
values =
dev
production

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -389,4 +389,4 @@ $RECYCLE.BIN/

# End of https://www.toptal.com/developers/gitignore/api/linux,macos,python,pycharm,windows,vim,visualstudiocode,jupyternotebooks
scratch/
dev/
dev/
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
- id: fix-encoding-pragma
@@ -19,39 +19,39 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/jorisroovers/gitlint
rev: v0.15.1
rev: v0.19.1
hooks:
- id: gitlint

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 6.0.0
hooks:
- id: isort

- repo: https://github.com/ambv/black
rev: 21.9b0
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/pycqa/bandit
rev: 1.7.0
rev: 1.8.2
hooks:
- id: bandit
# Bandit does not need to run on test code
exclude: tests/*

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle

- repo: https://github.com/btford/write-good
rev: v1.0.4
rev: v1.0.8
hooks:
- id: write-good
files: "\\.(rst|md|markdown|mdown|mkdn)$"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
<img alt="Tests" src="https://github.com/kjappelbaum/structuregraph-helpers/workflows/Tests/badge.svg" />
</a>
<a href="https://github.com/cthoyt/cookiecutter-python-package">
<img alt="Cookiecutter template from @cthoyt" src="https://img.shields.io/badge/Cookiecutter-python--package-yellow" />
<img alt="Cookiecutter template from @cthoyt" src="https://img.shields.io/badge/Cookiecutter-python--package-yellow" />
</a>
<a href="https://pypi.org/project/structuregraph_helpers">
<img alt="PyPI" src="https://img.shields.io/pypi/v/structuregraph_helpers" />
@@ -116,7 +116,7 @@ This package was created with [@audreyfeldroy](https://github.com/audreyfeldroy)
<details>
<summary>See developer instrutions</summary>


The final section of the README is for if you want to get involved by making a code contribution.

### ❓ Testing
2 changes: 1 addition & 1 deletion binder/postBuild
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python -m pip install --upgrade .
python -m pip install --upgrade .
2 changes: 1 addition & 1 deletion binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.8
python-3.8
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 changes: 7 additions & 7 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -33,10 +33,10 @@ Hash



Logging
Logging
---------

structuregraph_helpers uses the `loguru <https://loguru.readthedocs.io/en/stable/index.html>`_ for logging.
structuregraph_helpers uses the `loguru <https://loguru.readthedocs.io/en/stable/index.html>`_ for logging.
By default, logging from structuregraph_helpers is disabled to not interfere with your logs.

However, you can easily customize the logging:
@@ -46,17 +46,17 @@ However, you can easily customize the logging:
import sys
from loguru import logger

# enable structuregraph_helpers logging
# enable structuregraph_helpers logging
logger.enable("structuregraph_helpers")

# define the logging level
LEVEL = "INFO || DEBUG || WARNING || etc."

# set the handler
# for logging to stdout
logger.add(sys.stdout, level=LEVEL)
logger.add(sys.stdout, level=LEVEL)
# or for logging to a file
logger.add("my_log_file.log", level=LEVEL, enqueue=True)
logger.add("my_log_file.log", level=LEVEL, enqueue=True)


In many cases, however, you might find it convenient to simply call :py:meth:`~structuregraph_helpers.utils.enable_logging`
@@ -67,4 +67,4 @@ In many cases, however, you might find it convenient to simply call :py:meth:`~s

enable_logging()

which will enable logging with sane defaults (i.e. logging to ``stderr`` for ``INFO`` and ``WARNING`` levels).
which will enable logging with sane defaults (i.e. logging to ``stderr`` for ``INFO`` and ``WARNING`` levels).
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ structuregraph_helpers |release| Documentation
==============================================

:code:`structuregraph_helpers` is a collection of helper functions
that can be useful when working with :code:`pymatgen`'s :code:`StructureGraph`.
that can be useful when working with :code:`pymatgen`'s :code:`StructureGraph`.

.. toctree::
:maxdepth: 2
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -70,9 +70,9 @@ package_dir =
where = src

[options.extras_require]
plotting =
plotting =
plotly
lint =
lint =
isort
black
flake8
@@ -168,4 +168,4 @@ application-import-names =
structuregraph_helpers
tests
per-file-ignores =
tests/*.py:DAR101, D205, D100, DAR101, DAR201, D209, D103
tests/*.py:DAR101, D205, D100, DAR101, DAR201, D209, D103
5 changes: 3 additions & 2 deletions src/structuregraph_helpers/_hasher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""
Code below is taken from networkx.
Code below is taken from networkx.

License:
License:

NetworkX is distributed with the 3-clause BSD license.

1 change: 1 addition & 0 deletions src/structuregraph_helpers/analysis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Helpers for analysing structure graphs."""
from typing import List

1 change: 1 addition & 0 deletions src/structuregraph_helpers/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Command-line interface for StructureGraphHelpers."""
import concurrent.futures
import os
1 change: 1 addition & 0 deletions src/structuregraph_helpers/create.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Helpers for creating graphs."""
import os
from typing import Iterable, Tuple
1 change: 1 addition & 0 deletions src/structuregraph_helpers/delete.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Helpers for deleting parts of graphs."""
from collections import defaultdict
from copy import deepcopy
1 change: 1 addition & 0 deletions src/structuregraph_helpers/hash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Create hash strings for structure graphs.

Note that two LQGs of the same net (crystallographic net)
1 change: 1 addition & 0 deletions src/structuregraph_helpers/plotting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Plotting helpers."""
import plotly.graph_objs as go

1 change: 1 addition & 0 deletions src/structuregraph_helpers/subgraph.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""Extract subgraphs from structure graphs."""
import warnings
from collections import defaultdict
1 change: 1 addition & 0 deletions src/structuregraph_helpers/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import json
import sys
from typing import List
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os

import pytest
1 change: 1 addition & 0 deletions tests/test_analysis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from pymatgen.analysis.graphs import StructureGraph

from structuregraph_helpers.analysis import get_cn, get_dimensionality_larsen, get_leaf_nodes
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os

from click.testing import CliRunner
1 change: 1 addition & 0 deletions tests/test_create.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import networkx as nx
from pymatgen.analysis.graphs import StructureGraph

1 change: 1 addition & 0 deletions tests/test_delete.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import networkx as nx
from pymatgen.analysis.graphs import StructureGraph

1 change: 1 addition & 0 deletions tests/test_hash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from pymatgen.analysis.graphs import StructureGraph
from pymatgen.transformations.standard_transformations import RotationTransformation

1 change: 1 addition & 0 deletions tests/test_subgraph.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import numpy as np
from pymatgen.analysis.graphs import MoleculeGraph
from pymatgen.core import Molecule
Loading