Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid ADASMELIAE
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
Models
GRID
Grid ADASMELIAE
Commits
664de416
Commit
664de416
authored
4 months ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Rename variables
parent
8b0d2ce7
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#6011
skipped
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ADASMELIAE.py
+4
-6
4 additions, 6 deletions
ADASMELIAE.py
with
4 additions
and
6 deletions
ADASMELIAE.py
+
4
−
6
View file @
664de416
...
@@ -75,7 +75,6 @@ tm_max = "air_temperature_2m_max"
...
@@ -75,7 +75,6 @@ tm_max = "air_temperature_2m_max"
THRESHOLD
=
15
THRESHOLD
=
15
# Run given command using subprocess.run. Handle logging.
# Run given command using subprocess.run. Handle logging.
def
run_command
(
command
,
stdout
=
subprocess
.
PIPE
):
def
run_command
(
command
,
stdout
=
subprocess
.
PIPE
):
logging
.
debug
(
f
"
{
command
}
"
)
logging
.
debug
(
f
"
{
command
}
"
)
...
@@ -157,8 +156,8 @@ def split_by_date(input_file, prefix):
...
@@ -157,8 +156,8 @@ def split_by_date(input_file, prefix):
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
start_time
=
time
.
time
()
# For logging execution time
script_
start_time
=
time
.
time
()
# For logging execution time
today
=
datetime
.
now
().
date
()
today
=
datetime
.
now
().
date
()
# timezone not included, since we are only interested in the year
cron_run
=
True
cron_run
=
True
# Check if a year argument is provided
# Check if a year argument is provided
...
@@ -166,7 +165,6 @@ if __name__ == "__main__":
...
@@ -166,7 +165,6 @@ if __name__ == "__main__":
year
=
int
(
sys
.
argv
[
1
])
year
=
int
(
sys
.
argv
[
1
])
cron_run
=
False
cron_run
=
False
else
:
else
:
today
=
datetime
.
now
().
date
()
year
=
today
.
year
year
=
today
.
year
# Ensure that model is not run for future year
# Ensure that model is not run for future year
...
@@ -346,7 +344,7 @@ if __name__ == "__main__":
...
@@ -346,7 +344,7 @@ if __name__ == "__main__":
remove_temporary_files
()
remove_temporary_files
()
end_time
=
time
.
time
()
script_
end_time
=
time
.
time
()
logging
.
info
(
logging
.
info
(
f
"
End model
{
model_id
}
- Execution time:
{
'
{:
.
2
f
}
seconds
'
.format(end_time - start_time)
}
"
f
"
End model
{
model_id
}
- Execution time:
{
'
{:
.
2
f
}
seconds
'
.format(
script_
end_time -
script_
start_time)
}
"
)
)
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