diff --git a/.DS_Store b/.DS_Store index 2ea8e72..5e1d48e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/config.json b/config.json index d2db83b..4a26339 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,7 @@ "values": ["Blue", "Orange", "Purple", "Red", "Yellow"], "trait_path": "./trait-layers/backgrounds", "filename": ["blue", "orange", "purple", "red", "yellow"], - "weights": [20,20,20,20,20] + "weights": [20.0,20.0,20.0,20.0,20.0] }, { "name": "Foreground", @@ -36,4 +36,4 @@ "baseURI": ".", "name": "NFT #", "description": "This is a description for this NFT series." -} \ No newline at end of file +} diff --git a/requirements.txt b/requirements.txt index 0760fc2..97a82e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ pytest-env pytest-cov alive-progress toml +autoflake diff --git a/src/common/validate.py b/src/common/validate.py index 91dae8f..8c758a8 100644 --- a/src/common/validate.py +++ b/src/common/validate.py @@ -85,10 +85,10 @@ def validate_config(config: dict) -> bool: ) for j, weight in enumerate(layer["weights"]): - if not isinstance(weight, int): + if not isinstance(weight, int) and not isinstance(weight, float): raise ConfigValidationError( - 'config["layers"][{}]["{}"][{}]: Invalid layer weight: \'{}\'. Expected type: {}'.format( - i, required_key[0], j, weight, int + 'config["layers"][{}]["{}"][{}]: Invalid layer weight: \'{}\'. Expected type: {} or {}'.format( + i, required_key[0], j, weight, int, float ) ) diff --git a/trait-layers/.DS_Store b/trait-layers/.DS_Store index 02d26bc..127f040 100644 Binary files a/trait-layers/.DS_Store and b/trait-layers/.DS_Store differ