diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 145edb8..78cbb4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/grainlearning/dynamic_systems.py b/grainlearning/dynamic_systems.py index c5ad339..0e9e3e8 100644 --- a/grainlearning/dynamic_systems.py +++ b/grainlearning/dynamic_systems.py @@ -179,7 +179,7 @@ def __init__( #### Uncertainty #### self.sigma_min = 1.0e-6 - + self.sigma_max = sigma_max self.sigma_tol = sigma_tol @@ -383,7 +383,7 @@ class IODynamicSystem(DynamicSystem): :param inv_obs_weight: Inverse of the observation weight, defaults to None, optional :param param_data: Parameter data, defaults to None, optional :param sim_data: Simulation data, defaults to None, optional - :param sim_data_files: List pf simulation data files (num_samples), defaults to None, optional + :param sim_data_files: List of simulation data files (num_samples), defaults to None, optional """ def __init__( @@ -428,7 +428,7 @@ def __init__( param_names ) # TODO: reuse initialization from base class - + ##### Parameters ##### self.num_params = len(param_names) diff --git a/grainlearning/inference.py b/grainlearning/inference.py index 69a0a90..ab2b0c2 100644 --- a/grainlearning/inference.py +++ b/grainlearning/inference.py @@ -66,8 +66,6 @@ def __init__( self.ess = None - - @classmethod def from_dict(cls: Type["SMC"], obj: dict): """Initialize the class using a dictionary style diff --git a/grainlearning/sampling.py b/grainlearning/sampling.py index 2d7e1da..0c05edd 100644 --- a/grainlearning/sampling.py +++ b/grainlearning/sampling.py @@ -91,8 +91,8 @@ class GaussianMixtureModel: def __init__( self, - max_num_components=0, - weight_concentration_prior: float = 0.2, + max_num_components = 0, + weight_concentration_prior: float = 0.0, covariance_type: str = "tied", n_init: int = 1, tol: float = 1.0e-5, @@ -106,7 +106,7 @@ def __init__( """ Initialize the Gaussian Mixture Model class""" self.max_num_components = max_num_components - if weight_concentration_prior is None: + if not weight_concentration_prior: self.weight_concentration_prior = 1.0 / max_num_components else: self.weight_concentration_prior = weight_concentration_prior diff --git a/pyproject.toml b/pyproject.toml index 62b67f8..e12fae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,13 +12,17 @@ license = "GPLv2" homepage = "https://grainlearning.readthedocs.io/" repository = "https://github.com/GrainLearning/grainLearning" keywords = ["Bayesian inference", "Uncertainty quantification", "Non-parametric Gaussian mixture", "DEM", "Constitutive modeling", "Granular materials"] +packages = [ + { include = "grainlearning"} +] [tool.poetry.dependencies] -python = ">=3.8,<3.11" +python = ">=3.8,<3.12" numpy = "^1.23.2" scipy = "^1.9.1" scikit-learn = "^1.1.3" matplotlib = "^3.6.0" +seaborn = '^0.12.2' Sphinx = {version = "^5.1.1", optional = true} sphinx-autodoc-typehints = {version = "^1.19.2", optional = true} @@ -30,13 +34,12 @@ prospector = {version = "^1.7.6", optional = true, extras = ["with_pyroma"]} pyroma = {version = "^4.0", optional = true} h5py = {version ="^3.7.0", optional = true} wandb = {version ="^0.13.4", optional = true} -tensorflow = {version ="2.10.0", optional = true} +tensorflow = {version ="^2.10.0", optional = true} ipykernel = {version = "*", optional = true} -seaborn = {version = '^0.12.2', optional = true} [tool.poetry.extras] docs = ["Sphinx", "sphinx-autodoc-typehints", "sphinx-mdinclude", "sphinx-rtd-theme"] -dev = ["pytest", "pytest-cov", "prospector", "pyroma", "h5py"] +dev = ["pytest", "pytest-cov", "prospector", "pyroma", "h5py", "tensorflow", "wandb"] rnn = ["wandb", "tensorflow"] tutorials = ["ipykernel"] visuals = ["seaborn"] @@ -44,7 +47,3 @@ visuals = ["seaborn"] [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" - -packages = [ - { include = "grainlearning"} -]