Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-schlipf committed Feb 2, 2024
1 parent b5a4597 commit a40c9ad
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@
# -- Custom extension of Sphinx ----------------------------------------------
from docutils import nodes


# defines an INCAR tag
def tag_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
url = f"https://www.vasp.at/wiki/index.php/{text}"
node = nodes.reference(rawtext, text, refuri=url, **options)
return [node], []


def setup(app):
app.add_role('tag', tag_role)
return
app.add_role("tag", tag_role)
return
2 changes: 1 addition & 1 deletion src/py4vasp/_combine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pathlib
from typing import Dict, List

from py4vasp import exception, calculation
from py4vasp import calculation, exception


def _match_combine_with_refinement(combine_name: str):
Expand Down
6 changes: 4 additions & 2 deletions src/py4vasp/calculation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright © VASP Software GmbH,
# Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
'''Provide refinement functions for a the raw data of a VASP calculation run in the
"""Provide refinement functions for a the raw data of a VASP calculation run in the
current directory.
Usually one is not directly interested in the raw data that is produced but
Expand Down Expand Up @@ -37,8 +37,9 @@ class provides a more flexible interface with which you can determine the source
>>> calc.dos.read()
In the latter example, you can change the path from which the data is extracted.
'''
"""
import importlib

from py4vasp import exception
from py4vasp._util import convert

Expand Down Expand Up @@ -75,6 +76,7 @@ class provides a more flexible interface with which you can determine the source
)
_private = ("dispersion",)


def __getattr__(attr):
if attr in (__all__ + _private):
module = importlib.import_module(f"py4vasp.calculation._{attr}")
Expand Down
6 changes: 3 additions & 3 deletions src/py4vasp/calculation/_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import numpy as np

from py4vasp import calculation, exception, _config
from py4vasp._util import import_, documentation, index, select
from py4vasp import _config, calculation, exception
from py4vasp._util import documentation, import_, index, select
from py4vasp.calculation import _base, _structure

pretty = import_.optional("IPython.lib.pretty")
Expand Down Expand Up @@ -63,7 +63,7 @@ class Density(_base.Refinery, _structure.Mixin):
def __str__(self):
_raise_error_if_no_data(self._raw_data.charge)
grid = self._raw_data.charge.shape[1:]
topology = calculation.topology.from_data(self._raw_data.structure.topology)
topology = calculation.topology.from_data(self._raw_data.structure.topology)
if self._selection == "tau":
name = "Kinetic energy"
elif self.is_nonpolarized():
Expand Down
2 changes: 1 addition & 1 deletion src/py4vasp/calculation/_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from py4vasp import calculation, exception, _config
from py4vasp import _config, calculation, exception
from py4vasp._util import select
from py4vasp.calculation import _base, _structure

Expand Down
2 changes: 1 addition & 1 deletion tests/analysis/test_mlff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
import pytest

from py4vasp import exception, calculation
from py4vasp import calculation, exception
from py4vasp._analysis.mlff import MLFFErrorAnalysis


Expand Down
2 changes: 1 addition & 1 deletion tests/calculation/test_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import pytest

from py4vasp import calculation, exception, raw, _config
from py4vasp import _config, calculation, exception, raw
from py4vasp._third_party.viewer import viewer3d


Expand Down
2 changes: 1 addition & 1 deletion tests/calculation/test_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import pytest

from py4vasp import calculation, exception, raw, _config
from py4vasp import _config, calculation, exception, raw
from py4vasp._third_party.viewer import viewer3d


Expand Down
1 change: 1 addition & 0 deletions tests/calculation/test_repr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright © VASP Software GmbH,
# Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import importlib

from py4vasp import calculation
from py4vasp._util import convert

Expand Down

0 comments on commit a40c9ad

Please sign in to comment.