Skip to content

Commit eb96eb3

Browse files
author
metofcm
committed
Rose: import.
1 parent f9a3494 commit eb96eb3

File tree

288 files changed

+46497
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+46497
-30
lines changed

.gitignore

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,2 @@
11
*.py[co]
2-
3-
# Packages
4-
*.egg
5-
*.egg-info
6-
dist
7-
build
8-
eggs
9-
parts
10-
bin
11-
var
12-
sdist
13-
develop-eggs
14-
.installed.cfg
15-
16-
# Installer logs
17-
pip-log.txt
18-
19-
# Unit test / coverage reports
20-
.coverage
21-
.tox
22-
23-
#Translations
24-
*.mo
25-
26-
#Mr Developer
27-
.mr.developer.cfg
2+
etc/rose.conf

COPYING

+674
Large diffs are not rendered by default.

INSTALL

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refer to doc/rose-install.html for detail.

README

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
(C) British Crown Copyright 2012 Met Office.
2+
3+
Rose is a framework for managing and running scientific suites.
4+
5+
Rose is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
Rose is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with Rose. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Rose documentation is licensed under the British Open Government
19+
Licence. See doc/rose-terms-of-use.html and
20+
<http://www.nationalarchives.gov.uk/doc/open-government-licence/>
21+
22+
23+
Licences for non-Rose works included in this distribution can be
24+
found in the licences/ directory.
25+
26+
doc/rose-icon.png,
27+
etc/images/rose-icon.png,
28+
etc/images/rose-icon-trim.png,
29+
etc/images/rose-logo.png,
30+
etc/images/rose-splash-logo.png,
31+
etc/images/rosie-icon.png,
32+
etc/images/rosie-icon-trim.png,
33+
etc/metadata/all/etc/images/icon.png:
34+
These icons are all derived from the public domain image at
35+
<http://www.clker.com/clipart-compass-rose-variation.html>.
36+
37+
etc/images/rose-config-edit/gnome_package_system.png:
38+
This icon is part of the GNOME icon theme 2.28.0, licensed under
39+
GPLv2. This theme was developed by:
40+
Ulisse Perusin <[email protected]>
41+
Riccardo Buzzotta <[email protected]>
42+
Josef Vybíral <[email protected]>
43+
Hylke Bons <[email protected]>
44+
Ricardo González <[email protected]>
45+
Lapo Calamandrei <[email protected]>
46+
Rodney Dawes <[email protected]>
47+
Luca Ferretti <[email protected]>
48+
Tuomas Kuosmanen <[email protected]>
49+
Andreas Nilsson <[email protected]>
50+
Jakub Steiner <[email protected]>
51+
52+
etc/images/rose-config-edit/gnome_package_system_*:
53+
These icons are derivative works produced from
54+
etc/images/rose-config-edit/gnome_package_system.png, and are
55+
distributed in their preferred PNG form.
56+
57+
lib/html/external/*:
58+
These directories contain unmodified versions of external software
59+
packages. Licences on usage and re-distribution are included for
60+
each package. Please refer to them for detail.

README.md

-4
This file was deleted.

bin/rose

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------
3+
# (C) British Crown Copyright 2012 Met Office.
4+
#
5+
# This file is part of Rose, a framework for scientific suites.
6+
#
7+
# Rose is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# Rose is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
19+
#-------------------------------------------------------------------------------
20+
# NAME
21+
# rose - environment for running scientific suites and applications
22+
# rosie - revision/organisation of suites for identification/exploration
23+
# rosa - rosie's admin utilities
24+
#
25+
# SYNOPSIS
26+
# # "rose", "rosie" and "rosa" has the following interfaces:
27+
# # Invoke a utility:
28+
# rose UTIL [ARGS ...]
29+
# # Print help and a list of available utilities:
30+
# rose help
31+
# # Print help for list of utilities.
32+
# rose help UTIL ...
33+
# # Print version information.
34+
# rose version
35+
#
36+
# DESCRIPTION
37+
# Simple launcher for utilities in the "rose", "rosie" or "rosa"
38+
# name-spaces. Launch a "rose", "rosie" or "rosa" utility with the given
39+
# ARGS.
40+
#-------------------------------------------------------------------------------
41+
if ${ROSE_DEBUG:-false}; then
42+
set -x
43+
fi
44+
. $(dirname $0)/../lib/bash/rose_init
45+
rose_init
46+
47+
function get_alias() {
48+
local NAME=$1
49+
local ALIAS=$(sed '/^#/d' $ROSE_HOME_BIN/$ROSE_NS-$NAME || true)
50+
if [[ $(wc -l <<<"$ALIAS") == 1 ]] \
51+
&& grep -q "^exec \$(dirname \$0)/$ROSE_NS-.* \"\$@\"\$" <<<"$ALIAS"
52+
then
53+
ALIAS=${ALIAS#"exec \$(dirname \$0)/$ROSE_NS-"}
54+
ALIAS=${ALIAS%' "$@"'}
55+
echo $ALIAS
56+
fi
57+
}
58+
59+
function help_util() {
60+
local NAME=$1
61+
local COMMAND=$ROSE_HOME_BIN/$ROSE_NS-$NAME
62+
if [[ ! -r $COMMAND ]]; then
63+
echo "$1: utility not found." >&2
64+
return 1
65+
fi
66+
local ALIAS=$(get_alias $NAME)
67+
if [[ -n $ALIAS ]]; then
68+
COMMAND=$ROSE_HOME_BIN/$ROSE_NS-$ALIAS
69+
fi
70+
case $(head -1 $COMMAND) in
71+
*bash*)
72+
awk '{
73+
if (/^# NAME/) {
74+
do {print substr($0, 3)} while (getline && !/^#----------/);
75+
}
76+
}' $COMMAND | ${PAGER:-less}
77+
;;
78+
*python*)
79+
$COMMAND --help | ${PAGER:-less} # FIXME: not too pretty at the moment
80+
;;
81+
esac
82+
return
83+
}
84+
85+
#-------------------------------------------------------------------------------
86+
UTIL="help"
87+
if (($# > 0)); then
88+
UTIL=$1
89+
shift 1
90+
fi
91+
92+
case $UTIL in
93+
help)
94+
if (($# == 0)); then
95+
rose_usage
96+
echo
97+
echo "$ROSE_NS provides the following utilities:"
98+
for U in $(cd $ROSE_HOME_BIN && ls $ROSE_NS-*); do
99+
NAME=$(sed "s/^$ROSE_NS-\\(.*\\)\$/\1/" <<<$U)
100+
ALIAS=$(get_alias $NAME)
101+
if [[ -n $ALIAS ]]; then
102+
echo " $NAME"
103+
echo " (=$ALIAS)"
104+
else
105+
echo " $NAME"
106+
sed '1,/^# DESCRIPTION$/d;{s/^# / /;q;}' $ROSE_HOME_BIN/$U
107+
fi
108+
done
109+
exit 0
110+
fi
111+
RC=0
112+
for U in "$@"; do
113+
if [[ $U == 'help' || $U == 'version' ]]; then
114+
continue
115+
fi
116+
help_util $U || RC=$?
117+
done
118+
exit $RC
119+
:;;
120+
version)
121+
awk '{
122+
if (/^# NAME/) {
123+
while (getline && !/^#$/) {
124+
sub(/^# */, "");
125+
print $0;
126+
}
127+
}
128+
}' $0
129+
if [[ -f $ROSE_HOME/etc/rose/version ]]; then
130+
cat $ROSE_HOME/etc/rose/version
131+
fi
132+
echo
133+
echo "Path: $ROSE_HOME"
134+
(cd $ROSE_HOME && (svn info | sed '/^Path: /d') && svn status) 2>/dev/null \
135+
|| true
136+
exit
137+
:;;
138+
esac
139+
140+
COMMAND=$(dirname $0)/$ROSE_NS-$UTIL
141+
if [[ ! -f $COMMAND || ! -x $COMMAND ]]; then
142+
echo "$ROSE_NS: $UTIL: unknown utility. Abort." >&2
143+
echo "Type \"$ROSE_NS help\" for a list of utilities." >&2
144+
exit 1
145+
fi
146+
if (($# > 0)) && [[ $1 == '--help' || $1 == '-h' ]]; then
147+
help_util $UTIL
148+
exit
149+
fi
150+
if [[ ${PATH:-} != *$ROSE_HOME_BIN:* ]]; then
151+
PATH=$ROSE_HOME_BIN:${PATH:-}
152+
export PATH
153+
fi
154+
if [[ ${PYTHONPATH:-} != *$ROSE_HOME/lib/python:* ]]; then
155+
PYTHONPATH=$ROSE_HOME/lib/python:${PYTHONPATH:-}
156+
export PYTHONPATH
157+
fi
158+
ROSE_UTIL=$UTIL
159+
export ROSE_UTIL
160+
exec $COMMAND "$@"

bin/rose-ana

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------
3+
# (C) British Crown Copyright 2012 Met Office.
4+
#
5+
# This file is part of Rose, a framework for scientific suites.
6+
#
7+
# Rose is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# Rose is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
19+
#-------------------------------------------------------------------------------
20+
# NAME
21+
# rose ana
22+
#
23+
# SYNOPSIS
24+
# rose ana FILENAMES
25+
#
26+
# DESCRIPTION
27+
# Run the given test config files through the analysis engine.
28+
#
29+
#
30+
# OPTIONS
31+
# None so far
32+
#-------------------------------------------------------------------------------
33+
exec python -m rose.ana "$@"

bin/rose-app-run

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------
3+
# (C) British Crown Copyright 2012 Met Office.
4+
#
5+
# This file is part of Rose, a framework for scientific suites.
6+
#
7+
# Rose is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# Rose is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
19+
#-------------------------------------------------------------------------------
20+
# NAME
21+
# rose-app-run
22+
#
23+
# SYNOPSIS
24+
# rose app-run [OPTIONS] [--] [COMMAND ...]
25+
#
26+
# DESCRIPTION
27+
# Run an application according to its configuration.
28+
#
29+
# Determine the command to run in this order:
30+
# 1. If COMMAND is specified, invoke the command.
31+
# 2. If the --command-key=KEY option is defined, invoke the command
32+
# specified in [command]KEY.
33+
# 3. If the environment variable ROSE_TASK_NAME is defined and a setting in
34+
# the [command] section has a key matching the value of the environment
35+
# variable, then the value of the setting is used as the command.
36+
# 4. Invoke the command specified in [command]default.
37+
#
38+
# OPTION
39+
# --config=DIR; -C DIR
40+
# Specify the configuration directory of the application. (default=$PWD)
41+
# --command-key=KEY; -c KEY
42+
# Invoke the command specified in [command]KEY.
43+
# --define=[SECTION]KEY=VALUE; -D [SECTION]KEY=VALUE
44+
# Each of this overrides the [SECTION]KEY setting with a given VALUE.
45+
# Can be used to disable a setting using the syntax --define=[SECTION]!KEY
46+
# or even --define=[!SECTION].
47+
# --install-only; -i
48+
# Install files only. Do not invoke the run.
49+
# --new, -N
50+
# Remove all items in $PWD before doing anything. This option only
51+
# works with the --config=DIR option and if $PWD is not DIR.
52+
# --no-overwrite
53+
# Do not overwrite existing files.
54+
# --opt-conf-key=KEY, -O KEY
55+
# Each of this switches on an optional configuration identified by KEY.
56+
# --quiet, -q
57+
# Decrement verbosity.
58+
# --verbose; -v
59+
# Increment verbosity.
60+
#-------------------------------------------------------------------------------
61+
exec python -m rose.run app "$@"

0 commit comments

Comments
 (0)