Skip to content

Commit

Permalink
Merge pull request #22 from jacksund/jacks-edits
Browse files Browse the repository at this point in the history
prep apps for initial merge
  • Loading branch information
SWeav02 authored Dec 22, 2023
2 parents 5e413ad + 8a1f2aa commit 1f6511a
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 203 deletions.
13 changes: 3 additions & 10 deletions docs/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,16 @@ There is one key exception to the rules above -- and that is with `MAJOR`=0 rele
- add `django-simple-history` support to track user changes on specific models
- add `@check_db_conn` decorator to help with database connection closures/timeouts
- add `simmate engine start-schedules` which let's you configure periodic tasks for individual apps (e.g. check a table for updates every 5 minutes). Includes error handling and email alerts. (Note: this a quick alternative to full Prefect system)
- add warren_lab app with Warren Lab preferred VASP settings
- add badelf app with class oriented tools for performing BadELF analyses
- add `simmate-badelf` command for running badelf analysis

**Fixes**

- fix bug where workers incorrectly grab substring tag matches (e.g. a worker submited with the tag `ex` would incorrectly grab jobs like `ex-01` or `ex-02`)

--------------------------------------------------------------------------------

## v0.15.0 (2023.12.21)

**Enhancements**

- add warren_lab app with Warren Lab preferred VASP settings
- add badelf app with class oriented tools for performing BadELF analyses
- add `simmate-badelf` command for running badelf analysis

--------------------------------------------------------------------------------

## v0.14.0 (2023.07.06)

**Enhancements**
Expand Down
1 change: 1 addition & 0 deletions envs/conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies:
- mkdocs-material >=8.4.1, <9.2.7
- mkdocstrings >=0.19.0, <=0.21.2
- mkdocstrings-python >=0.7.1, <0.8.4
- mp-pyrho >=0.3.0, <=0.3.0
- numpy >=1.22.0, <1.24.2
- pandas >=2.0.0, <2.1.4
- plotly >=5.4.0, <5.17.0
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ name="simmate"
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
# https://semver.org/
version="0.15.0"
version="0.14.0"

# Maintainer info
authors = [{name = "Jack D. Sundberg", email = "[email protected]"}]
Expand Down Expand Up @@ -88,12 +88,13 @@ dependencies=[
"toml >=0.10.2, <=0.10.2", # for toml configuration files
"schedule >=1.2.0, <=1.2.0", # for running periodic tasks (prefect alternative)
#
# These are from the MP stack and I want to phase them out over time
# These are from the MP stack and I want to phase them out over time.
# Some of these could be optional, but we add them for convenience.
"pymatgen >=2022.1.9, <2023.5.32",
"pymatgen-analysis-diffusion >=2021.4.29, <=2023.8.15", # pymatgen-diffusion on conda
"matminer >=0.7.6, <0.8.1",
"ase >=3.22.1, <=3.22.1",
"mp-pyrho >=0.3.0",
"mp-pyrho >=0.3.0, <=0.3.0", # for badelf app
]

# optional dependencies that are not installed by default
Expand Down
6 changes: 0 additions & 6 deletions src/simmate/apps/badelf/badelf_tools/chgsum.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 11:20:59 2023
@author: sweav
"""

from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/simmate/apps/badelf/core/badelf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from simmate.apps.badelf.core.partitioning import PartitioningToolkit
from simmate.apps.badelf.core.voxel_assignment import VoxelAssignmentToolkit

# BUG: we shouldn't fully turning off warnings. This should be used within a context.
warnings.filterwarnings("ignore")


Expand Down
6 changes: 0 additions & 6 deletions src/simmate/apps/badelf/core/partitioning.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 9 16:35:48 2023
@author: sweav
"""

import math
from itertools import combinations
Expand Down
20 changes: 0 additions & 20 deletions src/simmate/apps/warren_lab/README.md

This file was deleted.

1 change: 0 additions & 1 deletion src/simmate/apps/warren_lab/command_line/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
6 changes: 0 additions & 6 deletions src/simmate/apps/warren_lab/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 29 11:00:50 2023
@author: sweav
"""

from .badelf import BadElfAnalysis
8 changes: 0 additions & 8 deletions src/simmate/apps/warren_lab/models/badelf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 15:18:45 2023

@author: sweav
"""

from pathlib import Path

Expand All @@ -18,9 +13,6 @@ class BadElfAnalysis(Structure, Calculation):
This table contains results from a BadELF analysis.
"""

class Meta:
app_label = "workflows"

oxidation_states = table_column.JSONField(blank=True, null=True)
"""
A list of calculated oxidation states for each site.
Expand Down
7 changes: 4 additions & 3 deletions src/simmate/configuration/django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@
"simmate.workflows.configs.BaseWorkflowsConfig",
"simmate.apps.configs.VaspConfig",
"simmate.apps.configs.BaderConfig",
"simmate.apps.configs.BadelfConfig",
# "simmate.apps.configs.CleaseConfig",
"simmate.apps.configs.EvolutionConfig",
"simmate.apps.configs.WarrenLabConfig",
# These apps may become defaults in the future:
# "simmate.apps.configs.BadelfConfig",
# "simmate.apps.configs.CleaseConfig",
# "simmate.apps.configs.WarrenLabConfig",
]
APPLICATIONS_YAML = SIMMATE_DIRECTORY / f"{CONDA_ENV}-apps.yaml"
# create the file if it doesn't exist yet
Expand Down
1 change: 0 additions & 1 deletion src/simmate/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .files import (
archive_old_runs,
check_required_files,
chunk_read,
copy_directory,
copy_files_from_directory,
Expand Down
13 changes: 0 additions & 13 deletions src/simmate/utilities/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ def get_directory(directory: Path | str = None) -> Path:
return directory_cleaned.absolute()


def check_required_files(directory: Path, required_files: list):
"""
Checks to make sure that all the files in a folder exist. Otherwise raises
an error.
"""
if not all((directory / file).exists() for file in required_files):
raise Exception(
f"""Make sure your `setup` method directory source is defined correctly.
The following files must exist in the directory where
this task is ran but some are missing: {required_files}"""
)


def copy_files_from_directory(
files_to_copy: list[Path],
directory_old: Path,
Expand Down
2 changes: 1 addition & 1 deletion src/simmate/website/workflows/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.1.5 on 2023-12-20 20:31
# Generated by Django 4.2.6 on 2023-11-19 21:07

import django.db.models.deletion
from django.db import migrations, models
Expand Down
97 changes: 0 additions & 97 deletions src/simmate/website/workflows/migrations/0002_badelfanalysis.py

This file was deleted.

56 changes: 28 additions & 28 deletions src/simmate/workflows/test/test_workflows_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def test_get_workflow_types():
def test_list_of_all_workflows():
assert get_all_workflow_names() == [
# "cluster-expansion.clease.bulk-structure",
"bad-elf-analysis.badelf.badelf",
"bad-elf-analysis.badelf.badelf-hse",
"bad-elf-analysis.badelf.badelf-pbesol",
# "bad-elf-analysis.badelf.badelf",
# "bad-elf-analysis.badelf.badelf-hse",
# "bad-elf-analysis.badelf.badelf-pbesol",
"customized.toolkit.user-config",
"diffusion.vasp.neb-all-paths-mit",
"diffusion.vasp.neb-all-paths-warren-lab",
Expand All @@ -55,9 +55,9 @@ def test_list_of_all_workflows():
"electronic-structure.vasp.matproj-density-of-states-hse",
"electronic-structure.vasp.matproj-full",
"electronic-structure.vasp.matproj-hse-full",
"nested.vasp.warren-lab-relaxation-static-hse-hse",
"nested.vasp.warren-lab-relaxation-static-pbe-hse",
"nested.vasp.warren-lab-relaxation-static-pbe-pbe",
# "nested.vasp.warren-lab-relaxation-static-hse-hse",
# "nested.vasp.warren-lab-relaxation-static-pbe-hse",
# "nested.vasp.warren-lab-relaxation-static-pbe-pbe",
"population-analysis.bader.badelf",
"population-analysis.bader.bader",
"population-analysis.bader.combine-chgcars",
Expand All @@ -82,14 +82,14 @@ def test_list_of_all_workflows():
"relaxation.vasp.quality03",
"relaxation.vasp.quality04",
"relaxation.vasp.staged",
"relaxation.vasp.warren-lab-hse",
"relaxation.vasp.warren-lab-hse-with-wavecar",
"relaxation.vasp.warren-lab-hsesol",
"relaxation.vasp.warren-lab-pbe",
"relaxation.vasp.warren-lab-pbe-metal",
"relaxation.vasp.warren-lab-pbe-with-wavecar",
"relaxation.vasp.warren-lab-pbesol",
"relaxation.vasp.warren-lab-scan",
# "relaxation.vasp.warren-lab-hse",
# "relaxation.vasp.warren-lab-hse-with-wavecar",
# "relaxation.vasp.warren-lab-hsesol",
# "relaxation.vasp.warren-lab-pbe",
# "relaxation.vasp.warren-lab-pbe-metal",
# "relaxation.vasp.warren-lab-pbe-with-wavecar",
# "relaxation.vasp.warren-lab-pbesol",
# "relaxation.vasp.warren-lab-scan",
# "relaxation.vasp.staged-cluster",
"restart.toolkit.automatic",
# "static-energy.vasp.cluster-high-qe",
Expand All @@ -103,14 +103,14 @@ def test_list_of_all_workflows():
"static-energy.vasp.prebadelf-matproj",
"static-energy.vasp.prebader-matproj",
"static-energy.vasp.quality04",
"static-energy.vasp.warren-lab-hse",
"static-energy.vasp.warren-lab-hsesol",
"static-energy.vasp.warren-lab-pbe",
"static-energy.vasp.warren-lab-pbe-metal",
"static-energy.vasp.warren-lab-pbesol",
"static-energy.vasp.warren-lab-prebadelf-hse",
"static-energy.vasp.warren-lab-prebadelf-pbesol",
"static-energy.vasp.warren-lab-scan",
# "static-energy.vasp.warren-lab-hse",
# "static-energy.vasp.warren-lab-hsesol",
# "static-energy.vasp.warren-lab-pbe",
# "static-energy.vasp.warren-lab-pbe-metal",
# "static-energy.vasp.warren-lab-pbesol",
# "static-energy.vasp.warren-lab-prebadelf-hse",
# "static-energy.vasp.warren-lab-prebadelf-pbesol",
# "static-energy.vasp.warren-lab-scan",
"structure-prediction.toolkit.chemical-system",
"structure-prediction.toolkit.fixed-composition",
"structure-prediction.toolkit.new-individual",
Expand Down Expand Up @@ -196,28 +196,28 @@ def test_get_custom_workflow(tmp_path):

def test_get_unique_paramters():
assert get_unique_parameters() == [
"algorithm",
# "algorithm",
"angle_tolerance",
"best_survival_cutoff",
"check_for_covalency",
# "check_for_covalency",
"chemical_system",
# "cluster_diameter",
"command",
"composition",
"compress_output",
"convergence_cutoff",
"cores",
# "cores",
# "convergence_limit",
# "current_generation",
"diffusion_analysis_id",
"directory",
"directory_new",
"directory_old",
"electride_connection_cutoff",
"electride_finder_cutoff",
# "electride_connection_cutoff",
# "electride_finder_cutoff",
"empty_ion",
"empty_sites",
"find_electrides",
# "find_electrides",
"fitness_field",
# "formula_unit",
"input_parameters",
Expand Down

0 comments on commit 1f6511a

Please sign in to comment.