Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raven-administration
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
raven
raven-administration
Commits
47f1afec
Commit
47f1afec
authored
1 year ago
by
Christoffer Stoll
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' into 'master'
#32
: datetime.utcfromtimestamp converts to local timezone and dst becomes an... See merge request
!6
parents
ece2e8da
e5a97ee8
No related branches found
No related tags found
2 merge requests
!18
Master
,
!6
#32: datetime.utcfromtimestamp converts to local timezone and dst becomes an...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/core/data/processing/filling.py
+3
-4
3 additions, 4 deletions
api/core/data/processing/filling.py
api/core/eea/eea_utils.py
+1
-1
1 addition, 1 deletion
api/core/eea/eea_utils.py
client/src/helpers/utils.js
+1
-1
1 addition, 1 deletion
client/src/helpers/utils.js
with
5 additions
and
6 deletions
api/core/data/processing/filling.py
+
3
−
4
View file @
47f1afec
...
...
@@ -21,8 +21,7 @@ class Filling:
continue
scaled_value
=
-
9900
if
values
.
scaled_value
.
iloc
[
0
]
!=
None
else
None
tz
=
values
.
end_position
.
iloc
[
0
].
strftime
(
'
%z
'
)
tz
=
"
{0}:{1}
"
.
format
(
tz
[:
-
2
],
tz
[
-
2
:])
tz
=
values
.
end_position
.
iloc
[
0
].
tz
dates
=
values
.
end_position
.
apply
(
lambda
x
:
x
.
timestamp
()).
unique
()
from_time
=
int
(
dates
.
min
()
if
ts_to_epoch
==
None
else
dates
.
min
()
if
ts_to_epoch
>
dates
.
min
()
else
ts_to_epoch
)
to_time
=
int
(
dates
.
max
()
if
ts_to_epoch
==
None
else
dates
.
max
()
if
ts_to_epoch
<
dates
.
max
()
else
ts_from_epoch
if
ts_from_epoch
>
dates
.
max
()
else
dates
.
max
())
...
...
@@ -35,8 +34,8 @@ class Filling:
for
m
in
missing_dates
:
v
=
{
"
sampling_point_id
"
:
key
,
"
begin_position
"
:
pd
.
to_datetime
(
datetime
.
utc
fromtimestamp
(
m
).
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
tz
,
format
=
"
%Y-%m-%dT%H:%M:%S%Z
"
),
"
end_position
"
:
pd
.
to_datetime
(
datetime
.
utc
fromtimestamp
(
m
+
ts_timestep
).
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
+
tz
,
format
=
"
%Y-%m-%dT%H:%M:%S%Z
"
),
"
begin_position
"
:
pd
.
to_datetime
(
datetime
.
fromtimestamp
(
m
-
ts_timestep
,
tz
=
tz
)
),
"
end_position
"
:
pd
.
to_datetime
(
datetime
.
fromtimestamp
(
m
,
tz
=
tz
)
),
"
value
"
:
-
9900
,
"
verification_flag
"
:
3
,
"
validation_flag
"
:
-
1
,
...
...
This diff is collapsed.
Click to expand it.
api/core/eea/eea_utils.py
+
1
−
1
View file @
47f1afec
...
...
@@ -6,4 +6,4 @@ class EeaUtils:
@staticmethod
def
local_datetime
():
now
=
datetime
.
now
(
tz
=
tzlocal
())
# current date and time
return
now
.
strftime
(
"
%Y-%m-%d
,
%H:%M:%S%z
"
)
return
now
.
strftime
(
"
%Y-%m-%d
T
%H:%M:%S%z
"
)
This diff is collapsed.
Click to expand it.
client/src/helpers/utils.js
+
1
−
1
View file @
47f1afec
...
...
@@ -106,4 +106,4 @@ export const filterList = (q, list, exclude_list) => {
});
};
export
const
version
=
"
3.0.
5
"
;
export
const
version
=
"
3.0.
7
"
;
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