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

improvement: add Atoms.clone() and remove sites by indices, including in-place #310

Closed
wants to merge 11 commits into from
156 changes: 107 additions & 49 deletions .github/workflows/action_build.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,116 @@
name: JARVIS-Tools github action

on: [push, pull_request]

jobs:
checks:
name: Checks
runs-on: ubuntu-latest
miniconda:
name: Miniconda ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9","3.10"]
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}

- name: Install requirements
run: |
pip install --upgrade pip
pip install pycodestyle flake8 pydocstyle
flake8 --ignore E203,W503 --exclude=examples,tests --statistics --count --exit-zero jarvis
pycodestyle --ignore E203,W503 --exclude=examples,testfiles jarvis
pydocstyle --match-dir=core --match-dir=io --match-dir=io --match-dir=ai --match-dir=analysis --match-dir=db --match-dir=tasks --count jarvis
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: environment.yml
python-version: "3.10"
auto-activate-base: false
- shell: bash -l {0}
run: |
conda info
conda list
- name: Lint
shell: bash -l {0}
run: |
conda install flake8 pycodestyle pydocstyle
flake8 --ignore E203,W503 --exclude=examples,tests --statistics --count --exit-zero jarvis
pycodestyle --ignore E203,W503 --exclude=examples,testfiles jarvis
pydocstyle --match-dir=core --match-dir=io --match-dir=io --match-dir=ai --match-dir=analysis --match-dir=db --match-dir=tasks --count jarvis

- name: Run pytest
shell: bash -l {0}
run: |
conda install pytest coverage codecov
python setup.py develop
coverage run -m pytest
coverage report -m -i
codecov
codecov --token="b61081a0-39de-44a8-8a9c-97d4be82af6d"
rm POSCAR* *.png




# name: JARVIS-Tools github action

# on: [push, pull_request]

# jobs:
# checks:
# name: Checks
# runs-on: ubuntu-latest
# defaults:
# run:
# shell: bash -l {0}
# strategy:
# matrix:
# python-version: ["3.10"]
# steps:
# - uses: actions/checkout@v2
# - name: Setup Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}

# - uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}

# - name: Install requirements
# run: |
# source ~/.bashrc
# echo "begin: PATH=$PATH;"
# find . -type f > before_test_files.txt
# conda env create -f environment.yml
# conda activate my_jarvis
# conda install pandas numpy matplotlib phonopy scikit-learn --quiet
# pip install --upgrade pip
# pip install pycodestyle flake8 pydocstyle coverage pytest codecov qiskit==0.41.1
# flake8 --ignore E203,W503 --exclude=examples,tests --statistics --count --exit-zero jarvis
# pycodestyle --ignore E203,W503 --exclude=examples,testfiles jarvis
# pydocstyle --match-dir=core --match-dir=io --match-dir=io --match-dir=ai --match-dir=analysis --match-dir=db --match-dir=tasks --count jarvis

# #python setup.py develop
# #pip install --upgrade --upgrade-strategy eager -r dev-requirements.txt -e .
# #conda install -c ambermd pytraj
# #pip install numpy scipy matplotlib
# #pip install -r dev-requirements.txt

#python setup.py develop
#pip install --upgrade --upgrade-strategy eager -r dev-requirements.txt -e .
#conda install -c ambermd pytraj
pip install numpy scipy matplotlib
pip install -r dev-requirements.txt
pip install -e .
echo 'CONDA LIST'
conda list

echo 'PIP FREEZE'
pip freeze

#echo 'PYTEST-COV'
#pytest --cov-config=.coveragerc --cov=jarvis -n 2


coverage run -m pytest
coverage report -m -i
codecov
codecov --token="b61081a0-39de-44a8-8a9c-97d4be82af6d"
# git clone https://github.com/QEF/q-e.git
# cd q-e
# ./configure
# make pw
# pip install -e .
# echo 'CONDA LIST'
# conda list

# echo 'PIP FREEZE'
# pip freeze

# #echo 'PYTEST-COV'
# #pytest --cov-config=.coveragerc --cov=jarvis -n 2

# coverage run -m pytest
# coverage report -m -i
# codecov
# codecov --token="b61081a0-39de-44a8-8a9c-97d4be82af6d"
# find . -type f > after_test_files.txt
# #comm -13 <(sort before_test_files.txt) <(sort after_test_files.txt) > new_files.txt
# #cat new_files.txt | xargs rm
# #rm before_test_files.txt after_test_files.txt new_files.txt

# # git clone https://github.com/QEF/q-e.git
# # cd q-e
# # ./configure
# # make pw

# jobs:
# checks:
Expand Down Expand Up @@ -149,4 +207,4 @@ jobs:
# # git clone https://github.com/QEF/q-e.git
# # cd q-e
# # ./configure
# # make pw
# # make pw
80 changes: 44 additions & 36 deletions .github/workflows/deploy_nist_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,48 @@ permissions:
# #- '**'

jobs:
build:
runs-on: ubuntu-latest
miniconda:
name: Miniconda ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python setup.py develop
#python -m pip install -r requirements.txt

- name: Deploy Files
run: |
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
# python jarvis_leaderboard/rebuild.py
mkdocs build
#rm -r /tmp/site
cp -r site /tmp
git fetch
git checkout nist-pages --force
rm -r *
cp -r /tmp/site/* .

echo 'listing'
ls
echo 'listing tmp'
ls /tmp
git add * */*
git commit -m 'Adding files.'
git push origin nist-pages -f
#git commit -a -m "Move"
#git push -f origin nist-pages1
#mkdocs gh-deploy
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: environment.yml
python-version: "3.10"
auto-activate-base: false
- shell: bash -l {0}
run: |
conda info
conda list

- name: Deploy Files
shell: bash -l {0}
run: |
python -m pip install --upgrade pip setuptools
python setup.py develop
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
# python jarvis_leaderboard/rebuild.py
mkdocs build
#rm -r /tmp/site
cp -r site /tmp
git fetch
git checkout nist-pages --force
rm -r *
cp -r /tmp/site/* .

echo 'listing'
ls
echo 'listing tmp'
ls /tmp
git add * */*
git commit -m 'Adding files.'
git push origin nist-pages -f
#git commit -a -m "Move"
#git push -f origin nist-pages1
#mkdocs gh-deploy
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ ENV/
# mypy
.mypy_cache/

.pytest_cache/
.pytest_cache/

# pycharm
.idea

Loading