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

Use load_defaults rather than missing #134

Merged
merged 3 commits into from
May 17, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Build Package and Test Source Code [Python 3.6, 3.7, 3.8]
name: Build Package and Test Source Code [Python 3.9, 3.10, 3.11, 3.12]

on:
push:
Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout
Expand All @@ -21,7 +21,7 @@ jobs:
persist-credentials: false

- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: paramtools-dev
environment-file: environment.yml
Expand Down
14 changes: 7 additions & 7 deletions paramtools/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ class BaseParamSchema(Schema):
attribute="type",
data_key="type",
)
number_dims = fields.Integer(required=False, missing=0)
number_dims = fields.Integer(required=False, load_default=0)
value = fields.Field(required=True) # will be specified later
validators = fields.Nested(
ValueValidatorSchema(), required=False, missing={}
ValueValidatorSchema(), required=False, load_default={}
)
indexed = fields.Boolean(required=False)

Expand Down Expand Up @@ -580,9 +580,9 @@ class LabelSchema(Schema):
attribute="type",
data_key="type",
)
number_dims = fields.Integer(required=False, missing=0)
number_dims = fields.Integer(required=False, load_default=0)
validators = fields.Nested(
ValueValidatorSchema(), required=False, missing={}
ValueValidatorSchema(), required=False, load_default={}
)


Expand All @@ -594,7 +594,7 @@ class AdditionalMembersSchema(Schema):
attribute="type",
data_key="type",
)
number_dims = fields.Integer(required=False, missing=0)
number_dims = fields.Integer(required=False, load_default=0)

return AdditionalMembersSchema

Expand All @@ -611,13 +611,13 @@ class ParamToolsSchema(Schema):
keys=fields.Str(),
values=fields.Nested(LabelSchema()),
required=False,
missing={},
load_default={},
)
additional_members = fields.Dict(
keys=fields.Str(),
values=fields.Nested(make_additional_members(allowed_types)()),
required=False,
missing={},
load_default={},
)
operators = fields.Nested(OperatorsSchema, required=False)

Expand Down