Skip to content

Commit

Permalink
double_perov
Browse files Browse the repository at this point in the history
  • Loading branch information
lld21301 committed Mar 16, 2024
0 parents commit 21a3a5f
Show file tree
Hide file tree
Showing 308 changed files with 65,189 additions and 0 deletions.
116 changes: 116 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
version: 2.1

orbs:
codecov: codecov/[email protected]

workflows:
version: 2
install_and_test:
jobs:
- python_lint
- test_ubuntu
- test_macos

commands:
install_deps_ubuntu:
steps:
- checkout
- restore_cache:
key: conda-ubuntu-{{ checksum ".circleci/config.yml" }}-{{ checksum "env.common.yml" }}-{{ checksum "env.cpu.yml" }}
- run:
name: Install conda and environment
command: |
if [ ! -d "/home/circleci/miniconda" ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p "$HOME"/miniconda
source /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate base
# Conda configuration
conda config --set always_yes yes --set auto_update_conda false
# Update conda
conda update conda
conda install mamba -n base -c conda-forge
# Install ocp conda env
conda create --name ocp-models --clone base
source /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate ocp-models
conda install -c conda-forge conda-merge
conda-merge env.common.yml env.cpu.yml > env.yml
mamba env update -n ocp-models --file env.yml
pip install pytest-cov==4.0.0
fi
- save_cache:
paths:
- /home/circleci/miniconda
key: conda-ubuntu-{{ checksum ".circleci/config.yml" }}-{{ checksum "env.common.yml" }}-{{ checksum "env.cpu.yml" }}
install_deps_macos:
steps:
- checkout
- restore_cache:
key: conda-macos-{{ checksum ".circleci/config.yml" }}-{{ checksum "env.common.yml" }}-{{ checksum "env.cpu.yml" }}
- run:
name: Install conda and environment
command: |
if [[ -d $HOME/miniconda3 ]] ; then
echo "miniconda installed already."
else
curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-MacOSX-x86_64.sh
bash ./miniconda.sh -b
source $HOME/miniconda3/bin/activate
conda config --set always_yes yes --set auto_update_conda false
conda install mamba -n base -c conda-forge
conda create --name ocp-models --clone base
conda activate ocp-models
conda install -c conda-forge conda-merge
conda-merge env.common.yml env.cpu.yml > env.yml
mamba env update -n ocp-models --file env.yml
fi
- save_cache:
paths:
- /Users/distiller/miniconda3
key: conda-macos-{{ checksum ".circleci/config.yml" }}-{{ checksum "env.common.yml" }}-{{ checksum "env.cpu.yml" }}

jobs:
python_lint:
docker:
- image: cimg/python:3.9.13
steps:
- checkout
- run:
name: setup
command: pip install black==22.3.0
- run:
name: run black
command: black . --check

test_ubuntu:
docker:
- image: cimg/python:3.9.13
resource_class: large
steps:
- install_deps_ubuntu
- run:
name: install ocp and run tests
command: |
source /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate ocp-models
pip install -e .
pre-commit install
pytest --cov-report=xml --cov=ocpmodels/ /home/circleci/project/tests
- codecov/upload:
file: coverage.xml

test_macos:
macos:
xcode: "13.4.1"
resource_class: medium
steps:
- install_deps_macos
- run:
name: install ocp and run tests
command: |
source $HOME/miniconda3/bin/activate
conda activate ocp-models
pip install -e .
pre-commit install
pytest tests
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266, E501, E731, W503, F403, F401
max-line-length = 79
max-complexity = 18
select = B,C,E,F,W,T4,B9
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ipynb linguist-documentation
113 changes: 113 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
wandb
data
checkpoints
results
logs
*.traj
experimental

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/source/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# User directories
Local

# .DS_Store
.DS_Store

# VIM swap files
*.swp

# PyCharm
.idea/

# VS Code
.vscode/
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=79
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.8
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
- id: trailing-whitespace
- id: check-added-large-files
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
Loading

0 comments on commit 21a3a5f

Please sign in to comment.