Skip to content

Commit

Permalink
fix adding package_data
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed Oct 28, 2024
1 parent 178fddb commit 532f884
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "https://spdx.org/licenses/MIT",
"codeRepository": "git+https://github.com/matthiasprobst/ssnolib",
"name": "ssnolib",
"version": "1.3.0.1a3",
"version": "1.3.0.1a4",
"description": "Python library for working with the SSNO ontology. ",
"applicationCategory": "Engineering",
"programmingLanguage": [
Expand Down
22 changes: 11 additions & 11 deletions docs/tutorials/StandardName.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
{
"data": {
"text/html": [
"StandardName(id=_:N55134414deef4dd5851c03cd41660ef4, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
"StandardName(id=_:N9d64bfdbc5cd474a8ae55bcdfb7d5624, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
],
"text/plain": [
"StandardName(id=_:N55134414deef4dd5851c03cd41660ef4, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
"StandardName(id=_:N9d64bfdbc5cd474a8ae55bcdfb7d5624, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -99,10 +99,10 @@
{
"data": {
"text/html": [
"StandardName(id=_:N7fa68f99257d47218c90b826dfc8dada, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
"StandardName(id=_:N880ae845e1974859bfe392e285911a88, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
],
"text/plain": [
"StandardName(id=_:N7fa68f99257d47218c90b826dfc8dada, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
"StandardName(id=_:N880ae845e1974859bfe392e285911a88, standardName=x_velocity, unit=http://qudt.org/vocab/unit/M-PER-SEC)"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -140,10 +140,10 @@
"2 validation errors for StandardName\n",
"standard_name\n",
" Field required [type=missing, input_value={'name': 'x_velocity', 'u...ty in x-axis direction'}, input_type=dict]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/missing\n",
" For further information visit https://errors.pydantic.dev/2.9/v/missing\n",
"unit\n",
" Field required [type=missing, input_value={'name': 'x_velocity', 'u...ty in x-axis direction'}, input_type=dict]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/missing\n"
" For further information visit https://errors.pydantic.dev/2.9/v/missing\n"
]
}
],
Expand Down Expand Up @@ -182,7 +182,7 @@
"1 validation error for StandardName\n",
"unit\n",
" Field required [type=missing, input_value={'standard_name': 'x_velo...m/s', 'definition': 123}, input_type=dict]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/missing\n"
" For further information visit https://errors.pydantic.dev/2.9/v/missing\n"
]
}
],
Expand Down Expand Up @@ -211,10 +211,10 @@
"2 validation errors for StandardName\n",
"standard_name\n",
" Value error, Invalid standard name 'X_velocity_' according to the core pattern '^[a-z0-9]+(?:_[a-z0-9]+)*$'. [type=value_error, input_value='X_velocity_', input_type=str]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/value_error\n",
" For further information visit https://errors.pydantic.dev/2.9/v/value_error\n",
"unit\n",
" Field required [type=missing, input_value={'standard_name': 'X_velo...'invalid standard name'}, input_type=dict]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/missing\n"
" For further information visit https://errors.pydantic.dev/2.9/v/missing\n"
]
}
],
Expand Down Expand Up @@ -243,7 +243,7 @@
"1 validation error for StandardName\n",
"unit\n",
" Field required [type=missing, input_value={'standard_name': 'x_velo...'invalid standard name'}, input_type=dict]\n",
" For further information visit https://errors.pydantic.dev/2.7/v/missing\n"
" For further information visit https://errors.pydantic.dev/2.9/v/missing\n"
]
}
],
Expand Down Expand Up @@ -329,7 +329,7 @@
" \"@type\": \"ssno:StandardName\",\n",
" \"ssno:standardName\": \"x_velocity\",\n",
" \"ssno:unit\": \"http://qudt.org/vocab/unit/M-PER-SEC\",\n",
" \"@id\": \"_:N7fa68f99257d47218c90b826dfc8dada\"\n",
" \"@id\": \"_:N880ae845e1974859bfe392e285911a88\"\n",
"}\n"
]
}
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ssnolib
version = 1.3.0.1a3
version = 1.3.0.1a4
author = Matthias Probst
author_email = [email protected]
description = SSNOlib is a Python library for working with the SSNO ontology.
Expand Down Expand Up @@ -33,6 +33,9 @@ install_requires =
[options.package_data]
ssnolib =
templates/*.html
ui/**/*.html
ui/static/*.js
ui/static/css/*.css

[options.extras_require]
test =
Expand Down
3 changes: 2 additions & 1 deletion ssnolib/standard_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def _parse_unit(cls, unit: Union[HttpUrl, str], cfg) -> str:
type="value_error",
loc=("unit",),
input=unit,
ctx={"error": f'your_message Unable to parse: "{unit}" of standard name "{cfg.data["standardName"]}"', }
ctx={"error": f'your_message Unable to parse: "{unit}" of standard name '
f'"{cfg.data["standardName"]}"', }
)
raise ValidationError.from_exception_data(title=cls.__name__, line_errors=[err, ])
else:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_ssno_standard_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def test_instantiating_standard_name(self):
unit="213nlsfh8os")
except pydantic.ValidationError as e:
self.assertEqual(e.errors()[0]['loc'], ('unit', 'unit'))
self.assertEqual(e.errors()[0]['msg'], 'Value error, your_message Unable to parse: "213nlsfh8os" of standard name "x_velocity"')
self.assertEqual(e.errors()[0]['msg'],
'Value error, your_message Unable to parse: "213nlsfh8os" of standard name "x_velocity"')

sn = StandardName(standardName='x_velocity',
description='x component of velocity',
Expand Down

0 comments on commit 532f884

Please sign in to comment.