Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCore-Python-Common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSCore-Python-Common
Compare revisions
a5fa7272a27c3c0fbfe54d95a7b0b59f1fb4ca73 to d6cb821ddd1c6f7f8fb3840028d0be4464d286ec
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
VIPS/vipscore-python-common
Select target project
No results found
d6cb821ddd1c6f7f8fb3840028d0be4464d286ec
Select Git revision
Swap
Target
VIPS/vipscore-python-common
Select target project
VIPS/vipscore-python-common
1 result
a5fa7272a27c3c0fbfe54d95a7b0b59f1fb4ca73
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
added namespace to get/set value of Result class
· e61b732e
Tor-Einar Skog
authored
2 years ago
e61b732e
bump version 0.2.2 -> 0.2.3
· d6cb821d
Tor-Einar Skog
authored
2 years ago
d6cb821d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
pyproject.toml
+2
-2
2 additions, 2 deletions
pyproject.toml
src/vipscore_common/entities.py
+4
-4
4 additions, 4 deletions
src/vipscore_common/entities.py
tests/test_entities.py
+2
-2
2 additions, 2 deletions
tests/test_entities.py
with
9 additions
and
9 deletions
README.md
View file @
d6cb821d
...
...
@@ -8,7 +8,7 @@ This is the source code for the module that contains the common data models and
# From local path, if you've cloned the Git repo
pip3
install
/home/foo/vipscore-python-common/
# From GitLab
pip3
install
git+https://gitlab.nibio.no/VIPS/vipscore-python-common.git@v0.2.
2
pip3
install
git+https://gitlab.nibio.no/VIPS/vipscore-python-common.git@v0.2.
3
```
...where the version is specified after the
`@`
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
View file @
d6cb821d
...
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name
=
"vipscore_common"
version
=
"0.2.
2
"
version
=
"0.2.
3
"
description
=
"Tools for the VIPSCore-Python web services and its models"
readme
=
"README.md"
authors
=
[
{
name
=
"Tor-Einar Skog"
,
email
=
"tor-einar.skog@nibio.no"
}
]
...
...
@@ -27,7 +27,7 @@ requires-python = ">=3.9"
dev
=
[
"bumpver"
,
"pytest"
]
[tool.bumpver]
current_version
=
"0.2.
2
"
current_version
=
"0.2.
3
"
version_pattern
=
"MAJOR.MINOR.PATCH"
commit_message
=
"bump version {old_version} -> {new_version}"
commit
=
true
...
...
This diff is collapsed.
Click to expand it.
src/vipscore_common/entities.py
View file @
d6cb821d
...
...
@@ -73,14 +73,14 @@ class Result(BaseModel):
if
v
is
not
None
and
not
isinstance
(
v
,
Point
)
and
not
isinstance
(
v
,
Polygon
):
raise
ValueError
(
"
%s is not a
"
%
v
)
def
set_value
(
self
,
key
,
value
):
def
set_value
(
self
,
namespace
,
key
,
value
):
temp_all_values
=
json
.
loads
(
self
.
all_values
)
temp_all_values
[
key
]
=
value
temp_all_values
[
"
%s.%s
"
%
(
namespace
,
key
)
]
=
value
self
.
all_values
=
json
.
dumps
(
temp_all_values
)
def
get_value
(
self
,
key
):
def
get_value
(
self
,
namespace
,
key
):
temp_all_values
=
json
.
loads
(
self
.
all_values
)
return
temp_all_values
.
get
(
key
)
return
temp_all_values
.
get
(
"
%s.%s
"
%
(
namespace
,
key
)
)
def
set_all_values
(
self
,
values_dict
):
self
.
all_values
=
json
.
dumps
(
values_dict
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_entities.py
View file @
d6cb821d
...
...
@@ -11,7 +11,7 @@ class TestEntities(unittest.TestCase):
valid_time_start
=
datetime
.
fromisoformat
(
"
2015-03-01T00:00:00+01:00
"
),
# valid_time_start
valid_time_end
=
None
,
warning_status
=
2
,
all_values
=
json
.
dumps
({
"
TM
"
:
2
})
all_values
=
json
.
dumps
({
"
WEATHER.
TM
"
:
2
})
)
r
=
Result
(
...
...
@@ -20,7 +20,7 @@ class TestEntities(unittest.TestCase):
warning_status
=
2
)
r
.
set_value
(
"
TM
"
,
2
)
r
.
set_value
(
"
WEATHER
"
,
"
TM
"
,
2
)
def
test_weather_elements
(
self
):
self
.
assertEquals
(
"
TM
"
,
WeatherElements
.
TEMPERATURE_MEAN
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.