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

Remove CanonicalEnsemble and SemigrandEnsemble + some minor fixes #257

Merged
merged 4 commits into from
Sep 3, 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
4 changes: 2 additions & 2 deletions smol/cofe/extern/ewald.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_ewald_structure(structure):
inds[i] = len(ewald_sites)
ewald_sites.append(PeriodicSite(spec, site.frac_coords, site.lattice))
ewald_inds.append(inds)
ewald_inds = np.array(ewald_inds, dtype=np.int)
ewald_inds = np.array(ewald_inds, dtype=int)
ewald_structure = Structure.from_sites(ewald_sites)

return ewald_structure, ewald_inds
Expand Down Expand Up @@ -124,7 +124,7 @@ def get_ewald_occu(occu, num_ewald_sites, ewald_inds):
# i_inds = i_inds[i_inds != -1]
# just make b_inds one longer than it needs to be and don't return
# the last value
b_inds = np.zeros(num_ewald_sites + 1, dtype=np.bool)
b_inds = np.zeros(num_ewald_sites + 1, dtype=bool)
b_inds[i_inds] = True
return b_inds[:-1]

Expand Down
2 changes: 1 addition & 1 deletion smol/cofe/space/clusterspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def occupancy_from_structure(
if site_mapping is None:
site_mapping = self.structure_site_mapping(supercell, structure)

occu = [] # np.zeros(len(self.supercell_structure), dtype=np.int)
occu = [] # np.zeros(len(self.supercell_structure), dtype=int)

for i, allowed_species in enumerate(get_allowed_species(supercell)):
# rather than starting with all vacancies and looping
Expand Down
2 changes: 1 addition & 1 deletion smol/cofe/space/orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def bit_combos(self):
all_combos = []
for bit_combo in product(*self.bits):
if not any(np.array_equal(bit_combo, bc) for bc in chain(*all_combos)):
bit_combo = np.array(bit_combo, dtype=np.int_)
bit_combo = np.array(bit_combo, dtype=int)
new_bits = np.unique(bit_combo[self.cluster_permutations], axis=0)
all_combos.append(new_bits)
self._bit_combos = tuple(all_combos)
Expand Down
4 changes: 2 additions & 2 deletions smol/cofe/wrangling/wrangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def remove_properties(self, *property_keys):
for entry in self._entries:
del entry.data["properties"][key]
except KeyError:
warnings.warn(f"Propertiy {key} does not exist.", RuntimeWarning)
warnings.warn(f"Property {key} does not exist.", RuntimeWarning)

def remove_entry(self, entry):
"""Remove a given structure and associated data."""
Expand Down Expand Up @@ -877,7 +877,7 @@ def as_dict(self):
"@class": self.__class__.__name__,
"_subspace": self._subspace.as_dict(),
"_entries": [entry.as_dict() for entry in self._entries],
"_ind_sets": jsanitize(self._ind_sets), # jic for np.int's
"_ind_sets": jsanitize(self._ind_sets), # jic for int's
"metadata": self.metadata,
}
return wrangler_dict
15 changes: 5 additions & 10 deletions smol/moca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@
Monte Carlo simulations using Cluster Expansion Hamiltonians.
"""

from smol.moca.ensemble import Ensemble
from smol.moca.processor.composite import CompositeProcessor
from smol.moca.processor.ewald import EwaldProcessor
from smol.moca.processor.expansion import ClusterExpansionProcessor
from smol.moca.sampler.container import SampleContainer

from .ensemble.canonical import CanonicalEnsemble
from .ensemble.ensemble import Ensemble
from .ensemble.semigrand import SemiGrandEnsemble
from .processor.composite import CompositeProcessor
from .processor.ewald import EwaldProcessor
from .processor.expansion import ClusterExpansionProcessor
from .sampler.sampler import Sampler
from smol.moca.sampler.sampler import Sampler

__all__ = [
"ClusterExpansionProcessor",
"EwaldProcessor",
"CompositeProcessor",
"Ensemble",
"CanonicalEnsemble",
"SemiGrandEnsemble",
"Sampler",
"SampleContainer",
]
File renamed without changes.
1 change: 0 additions & 1 deletion smol/moca/ensemble/__init__.py

This file was deleted.

254 changes: 0 additions & 254 deletions smol/moca/ensemble/base.py

This file was deleted.

Loading