Skip to content

Commit

Permalink
Formatting and update the binder related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zhubonan committed Apr 27, 2023
1 parent 238d9b0 commit ba29592
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Test with pytest
shell: bash -el {0}
run: |
pytest
pytest
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
*.egg-info
*.pyc
*.bak
*.bak
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -42,7 +42,7 @@ build_docker:
services:
- docker:dind
before_script:
- echo '0. Installing dependencies...'
- echo '0. Installing dependencies...'
- apk add --no-cache pigz python3
- python3 -m venv venv
- . venv/bin/activate
Expand Down
47 changes: 41 additions & 6 deletions .pre-commit-config.yaml
@@ -1,9 +1,44 @@
exclude: '^(doc)|(cookiecutters)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: trailing-whitespace
exclude: (example)
- id: end-of-file-fixer
exclude: (example)
- id: check-yaml
exclude: (example)
args: ['--unsafe']
- id: check-json
exclude: (example)
- id: check-added-large-files
exclude: (example|tests/test_data/PROCAR.mgo)
- id: double-quote-string-fixer
exclude: (example)
- id: forbid-new-submodules
exclude: (example)

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.9

- repo: local
hooks:
# yapf = yet another python formatter
- id: yapf
name: yapf
entry: yapf
language: system
- id: pylint
name: pylint
entry: pylint
types: [python]
args: ["-i"]
language: system
exclude: |
(?x)(
^tutorials/|
^examples/|
^tests
)
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,7 +6,7 @@ airsspy
A package to help working with the Ab initio Random Structure Searching ([AIRSS](https://www.mtg.msm.cam.ac.uk/Codes/AIRSS))
using Atomic simulation environment ([ase](https://wiki.fysik.dtu.dk/ase/)).
Supports building a search seed for AIRSS in a interactive python environments.
One of the important steps for performing a successful search with AIRSS is to have sensible seed for generating
One of the important steps for performing a successful search with AIRSS is to have sensible seed for generating
random structures, which are subsequently relaxed using the method of choice.
In general, AIRSS only relies on a few simple parameters to generate random structure, such as numbers of atoms,
numbers of species and cell volume.
Expand All @@ -15,7 +15,7 @@ tedious or impossible job to do.
ASE has a suite of tools for manipulate atomic structure which can be very helpful for building structures,
and here, for building search seeds.

AIRSS is a open source code licensed under GPLv2,
AIRSS is a open source code licensed under GPLv2,
this package does not contain any source code of AIRSS nor links to it.


Expand Down Expand Up @@ -97,6 +97,6 @@ Limitations
-----------

Due to the lack of `timeout` argument of `Popen.communicate` in python 2.7,
communication with the `buildcell` is not available. Hence, direct generation and
retrieval of the random structure are not supported in python. However, it is
communication with the `buildcell` is not available. Hence, direct generation and
retrieval of the random structure are not supported in python. However, it is
still possible to write the seed out and call the program externally.
4 changes: 2 additions & 2 deletions airsspy/build.py
Expand Up @@ -71,7 +71,7 @@ def generate(self, timeout=10, write_cell=None):

# Write the output from buildcell
if write_cell:
with open(write_cell + ".cell", "w") as output:
with open(write_cell + ".cell", "w", encoding="utf-8") as output:
output.write(self.bc_out)

# Process the result
Expand All @@ -80,7 +80,7 @@ def generate(self, timeout=10, write_cell=None):
parser.parse()
cellout = CellInput()
for k, value in parser.get_dict().items():
cellout.__setitem__(k, value)
cellout[k] = value

cell = cellout.get_cell()
elements, positions, _ = cellout.get_positions()
Expand Down
2 changes: 1 addition & 1 deletion airsspy/common.py
Expand Up @@ -23,4 +23,4 @@


class BuildcellError(RuntimeError):
"""Exception for not been able to build the random cell"""
"""Exception for not been able to build the random cell"""
10 changes: 0 additions & 10 deletions apt.txt

This file was deleted.

8 changes: 8 additions & 0 deletions binder/environment.yml
@@ -0,0 +1,8 @@
name: airsspy
channels:
- conda-forge
dependencies:
- airss
- ase
- pip:
- castepinput
72 changes: 0 additions & 72 deletions cryan_patch

This file was deleted.

58 changes: 0 additions & 58 deletions postBuild

This file was deleted.

22 changes: 22 additions & 0 deletions pyproject.toml
@@ -0,0 +1,22 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"


[project]
name = "airsspy"
version = "0.1.4"
description = "A wrapper for using AIRSS with python and ase."
authors = [{name = "Bonan Zhu", email = "zhubonan@outlook.com"}]
readme = "README.md"
license = {file = "LICENSE"}

dependencies = ['ase~=3.17', 'castepinput~=0.1']

[project.urls]
"Homepage" = "https://github.com/zhubonan/airsspy"

[project.optional-dependencies]

testing = ['pytest']
"pre-commit" = ['pre-commit']
25 changes: 13 additions & 12 deletions setup.py
Expand Up @@ -20,9 +20,10 @@
###########################################################################

from setuptools import setup, find_packages
version = '0.1.4'

if __name__ == '__main__':
version = "0.1.4"

if __name__ == "__main__":
from os import path
import os

Expand All @@ -31,24 +32,24 @@
long_description = fh.read()

setup(
name='airsspy',
name="airsspy",
version=version,
url='https://github.com/zhubonan/airsspy',
url="https://github.com/zhubonan/airsspy",
packages=find_packages(),
install_requires=[
'ase~=3.17',
'castepinput~=0.1',
"ase~=3.17",
"castepinput~=0.1",
],
description='A wrapper for using AIRSS with python and ase.',
description="A wrapper for using AIRSS with python and ase.",
extras_require={
'testing': ['pytest'],
"testing": ["pytest"],
"pre-commit": [
"pre-commit>=1,<2",
"black",
]
],
},
maintainer='Bonan Zhu',
maintainer_email='zhubonan@outlook.com',
maintainer="Bonan Zhu",
maintainer_email="zhubonan@outlook.com",
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
)
30 changes: 0 additions & 30 deletions spglib_makefile

This file was deleted.

Binary file removed symmol.zip
Binary file not shown.

0 comments on commit ba29592

Please sign in to comment.