Skip to content
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

Change ASE from submodule to pip #179

Merged
merged 5 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ase/ -e .[test]
pip install -e .[test]
- name: Test the source code
run: |
pytest --ci tests/ -m 'not (tutorials or espresso)' --cov-config=.coveragerc --cov=./koopmans/ --cov-report=xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ase/ -e .[test]
pip install -e .[test]
- name: Test the tutorials
run: |
pytest --ci tests/ -m tutorials
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "ase"]
path = ase
url = ../../elinscott/ase_koopmans
[submodule "quantum_espresso/q-e"]
path = quantum_espresso/q-e
url = https://gitlab.com/QEF/q-e.git
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ espresso: configure_4 espresso_4 configure_7 espresso_7 espresso_utils

workflow:
python3 -m pip install --upgrade pip
python3 -m pip install -e . -e ase/
python3 -m pip install -e .

clean: clean_espresso clean_tests

Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ Directories
-----------
This repository contains...

| ``ase/`` a fork of ASE that manages reading and writing of ``Quantum ESPRESSO``
| ``bin/`` executables (N.B. this directory does not need to be added to ``$PATH``)
| ``docs/`` documentation (see https://koopmans-functionals.org/)
| ``koopmans/`` source code of the workflow manager
| ``quantum_espresso/`` modified versions of ``Quantum ESPRESSO`` that contain implementations of the Koopmans functionals
| ``pseudos/`` pseudopotentials
| ``requirements/`` python dependencies
| ``tests/`` test suite
| ``workflows/`` source code of the workflow manager
| ``tutorials/`` tutorials

Installation
------------
Expand Down Expand Up @@ -75,7 +76,7 @@ Finally, install the python workflow manager, either via ``make workflow``, or
.. code-block:: bash

python3 -m pip install --upgrade pip
python3 -m pip install -e . -e ase/
python3 -m pip install -e .

Running
-------
Expand Down
1 change: 0 additions & 1 deletion ase
Submodule ase deleted from 4481cc
4 changes: 2 additions & 2 deletions koopmans/workflows/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from ase.spectrum.band_structure import BandStructure
from ase.spectrum.doscollection import GridDOSCollection
from ase.spectrum.dosdata import GridDOSData

from koopmans import calculators, settings, utils
from koopmans.bands import Bands
from koopmans.commands import ParallelCommandWithPostfix
Expand Down Expand Up @@ -1310,7 +1311,6 @@ def get_version(module):
def header():

koopmans_version = get_version(os.path.dirname(__file__))
ase_version = get_version(ase)
qe_version = get_version((calculators.bin_directory / 'pw.x').resolve().parents[2])

header = [r" _",
Expand All @@ -1322,7 +1322,7 @@ def header():
"",
" Koopmans spectral functional calculations with Quantum ESPRESSO",
"",
f" {koopmans_version}, using {qe_version} and ASE v{ase_version}",
f" {koopmans_version}, using {qe_version} and ase-koopmans v{ase.__version__}",
"",
" Written by Edward Linscott, Riccardo De Gennaro, and Nicola Colonna",
""]
Expand Down
Empty file removed requirements/pip_requirements.txt
Empty file.
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pybtex>=0.24
spglib>=1.9
upf-to-json>=0.9.5
hypothesis>=6.0.0
ase-koopmans==0.1.0
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: utf-8
# Distributed under the terms of the MIT License.

from glob import glob
import os
from glob import glob
from typing import Dict

from setuptools import find_packages, setup
Expand All @@ -14,16 +14,13 @@
with open('requirements/requirements.txt', 'r') as f:
requirements = [line.strip() for line in f.readlines()]

with open('requirements/pip_requirements.txt', 'r') as f:
requirements += [line.strip() for line in f.readlines()]

with open('requirements/test_requirements.txt', 'r') as f:
requirements += [line.strip() for line in f.readlines()]

extra_requirements: Dict[str, str] = dict(all=[])
req_files = glob('requirements/*.txt')
for _file in req_files:
if _file not in ['requirements/requirements.txt', 'requirements/pip_requirements.txt']:
if _file not in ['requirements/requirements.txt']:
with open(_file, 'r') as f:
subreq = _file.split('/')[-1].split('_')[0]
extra_requirements[subreq] = [line.strip() for line in f.readlines()]
Expand Down