Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GeoPEAS
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
Container registry
Model registry
Operate
Environments
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
esde
toar-data
GeoPEAS
Commits
c43e1ade
Commit
c43e1ade
authored
5 years ago
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
climatic serializer can return vector not only for direction queries
parent
514d79a3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
climatic_zones/serializers.py
+22
-10
22 additions, 10 deletions
climatic_zones/serializers.py
with
22 additions
and
10 deletions
climatic_zones/serializers.py
+
22
−
10
View file @
c43e1ade
...
@@ -20,6 +20,7 @@ def get_provenance(obj):
...
@@ -20,6 +20,7 @@ def get_provenance(obj):
Tel. + 44 (0)1248 374518 (direct)
\n
Tel. + 44 (0)1248 374518 (direct)
\n
Tel. + 44 (0)1248 374500 (reception)
\n
Tel. + 44 (0)1248 374500 (reception)
\n
E-mail: katshar@ceh.ac.uk
\n\n
The climate zones are as follows:
\n
E-mail: katshar@ceh.ac.uk
\n\n
The climate zones are as follows:
\n
0 Residual class (water?)
1 Warm Temperate Moist
\n
1 Warm Temperate Moist
\n
2 Warm Temperate Dry
\n
2 Warm Temperate Dry
\n
3 Cool Temperate Moist
\n
3 Cool Temperate Moist
\n
...
@@ -59,7 +60,20 @@ class AggSerializer(BaseSerializer):
...
@@ -59,7 +60,20 @@ class AggSerializer(BaseSerializer):
except
TypeError
:
except
TypeError
:
vlength
=
1
vlength
=
1
# TODO: check units below
# TODO: check units below
for
k
,
v
in
obj
.
items
():
print
(
k
,
v
)
if
vlength
>
1
:
if
vlength
>
1
:
if
obj
[
'
direction
'
]
is
None
:
properties
=
OrderedDict
([
(
'
agg_function
'
,
agg_function
),
(
'
many
'
,
True
),
(
agg_function
,
OrderedDict
([
(
d
,
v
)
for
d
,
v
in
zip
(
range
(
vlength
),
val
)
])),
(
'
units
'
,
'
?
'
),
(
'
radius
'
,
obj
[
'
radius
'
]),
])
else
:
properties
=
OrderedDict
([
properties
=
OrderedDict
([
(
'
agg_function
'
,
agg_function
),
(
'
agg_function
'
,
agg_function
),
(
'
many
'
,
True
),
(
'
many
'
,
True
),
...
@@ -69,8 +83,6 @@ class AggSerializer(BaseSerializer):
...
@@ -69,8 +83,6 @@ class AggSerializer(BaseSerializer):
(
'
units
'
,
'
?
'
),
(
'
units
'
,
'
?
'
),
(
'
radius
'
,
obj
[
'
radius
'
]),
(
'
radius
'
,
obj
[
'
radius
'
]),
])
])
if
obj
[
'
direction
'
]
is
None
:
properties
.
pop
(
'
direction
'
)
else
:
else
:
properties
=
OrderedDict
([
properties
=
OrderedDict
([
(
'
agg_function
'
,
agg_function
),
(
'
agg_function
'
,
agg_function
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment