Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid SEPTREFHUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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 SEPTREFHUM
Commits
93394c81
Commit
93394c81
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Add virtualenv, use of .env and logging
parent
5e1f7cb3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
log/.gitignore
+3
-0
3 additions, 0 deletions
log/.gitignore
requirements.txt
+3
-0
3 additions, 0 deletions
requirements.txt
run_SEPTREFHUM.sh
+38
-0
38 additions, 0 deletions
run_SEPTREFHUM.sh
with
46 additions
and
0 deletions
.gitignore
+
2
−
0
View file @
93394c81
*.nc
*.nc
*.tif
*.tif
*.tif.aux.xml
*.tif.aux.xml
.env
.venv
mapfile/SEPTREFHUM.map
mapfile/SEPTREFHUM.map
This diff is collapsed.
Click to expand it.
log/.gitignore
0 → 100644
+
3
−
0
View file @
93394c81
*
*/
!.gitignore
\ No newline at end of file
This diff is collapsed.
Click to expand it.
requirements.txt
0 → 100644
+
3
−
0
View file @
93394c81
Jinja2
netCDF4
pytz
\ No newline at end of file
This diff is collapsed.
Click to expand it.
run_SEPTREFHUM.sh
0 → 100755
+
38
−
0
View file @
93394c81
#!/bin/bash
# First: Test that we have CDO and GDAL installed
if
!
command
-v
cdo &> /dev/null
then
echo
"ERROR: CDO could not be found. Exiting."
exit
fi
if
!
command
-v
gdal_merge.py &> /dev/null
then
echo
"ERROR: GDAL is either not installed, or not built with Python support. Exiting."
exit
fi
# Defines HOME_DIR
source
.env
# Paths to scripts and requirements
APP_PATH
=
$HOME_DIR
/SEPTREFHUM
LOG_FILE
=
$APP_PATH
/log/SEPTREFHUM.log
REQUIREMENTS
=
$APP_PATH
/requirements.txt
cd
$APP_PATH
# Create and activate the virtual environment
python3
-m
venv .venv
.
.venv/bin/activate
python3
-m
pip
install
--upgrade
pip
pip
install
-r
$REQUIREMENTS
# Run the model
echo
"====
`
date
`
: Running model"
&>>
"
$LOG_FILE
"
python3
$APP_PATH
/SEPTREFHUM.py &>>
"
$LOG_FILE
"
echo
"====
`
date
`
: DONE running model"
&>>
"
$LOG_FILE
"
# Deactivate the virtual environment
deactivate
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