mesa_cli 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mesa +6 -9
- metadata +22 -40
- data/README.md +0 -202
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1490ea242a1e356a69f33c5e8706c3b32cf44f19
|
4
|
+
data.tar.gz: d48c3310e40c0d549239516004bef8bf57318adc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c5dc05c1de7f1c75aded345f8cfdae11b9f8cb186b643161ec1a568aceb9de495acd6a4ea5cab3ad4aff4808864421b86aefe7fdfe04e18d2a411e9d4c74e8e
|
7
|
+
data.tar.gz: 02a0b3b088b5f5763bcdb8b10f09d1c54d05ec8fc9732fbef7b6ada2868bf8ad0bae310211f8015facd4fa0b624699958e11f9b5d9429a7ea1778923012d7f7d
|
data/bin/mesa
CHANGED
@@ -4,11 +4,14 @@ require "fileutils"
|
|
4
4
|
begin
|
5
5
|
require "mesa_script"
|
6
6
|
$use_mesascript = true
|
7
|
-
rescue LoadError
|
7
|
+
rescue LoadError, TypeError
|
8
8
|
$use_mesascript = false
|
9
9
|
end
|
10
10
|
|
11
|
-
ALL_POSSIBLE_SCRIPTS = {
|
11
|
+
ALL_POSSIBLE_SCRIPTS = {
|
12
|
+
"bash" => [".bash_profile", ".bashrc"],
|
13
|
+
"zsh" => [".zshenv", ".zshrc"]
|
14
|
+
}
|
12
15
|
|
13
16
|
class MyCLI < Thor
|
14
17
|
desc "version", "Display the version number of currently installed MESA."
|
@@ -263,11 +266,6 @@ class MyCLI < Thor
|
|
263
266
|
fixed_this_one = adjust_script(script, dir_name, shell)
|
264
267
|
have_fixed = fixed_this_one unless have_fixed
|
265
268
|
end
|
266
|
-
|
267
|
-
# add MESA_DIR assignment if none are present, favoring .bash_profile
|
268
|
-
unless (have_fixed or login_scripts.empty?)
|
269
|
-
script = login_scripts[0]
|
270
|
-
end
|
271
269
|
end
|
272
270
|
|
273
271
|
desc "rates REACTION [OUTFILE]", "Calculate and output out reaction rates"
|
@@ -401,7 +399,7 @@ class MyCLI < Thor
|
|
401
399
|
def adjust_script(script, dir_name, shell="bash")
|
402
400
|
have_fixed = false
|
403
401
|
case shell
|
404
|
-
when
|
402
|
+
when %w{bash zsh}
|
405
403
|
# read in script to array of strings
|
406
404
|
contents = IO.readlines(script)
|
407
405
|
|
@@ -415,7 +413,6 @@ class MyCLI < Thor
|
|
415
413
|
|
416
414
|
# adjust MESA_DIR location and document changes
|
417
415
|
lines_to_fix.reverse.each do |i|
|
418
|
-
line = contents[i]
|
419
416
|
contents[i].sub!(/=.*/, "=#{dir_name}")
|
420
417
|
contents.insert(i, '# ' + "Changed MESA_DIR to #{dir_name} on " +
|
421
418
|
"#{Time.now.ctime} from mesa install script.\n")
|
metadata
CHANGED
@@ -1,81 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mesa_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Wolf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: mesa_script
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.1.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.1.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.19'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
41
|
-
description:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
Any individual subcommand is documented by typing `mesa help` followed by
|
51
|
-
the name of the subcommand, for instance,
|
52
|
-
|
53
|
-
mesa help new
|
54
|
-
|
55
|
-
will give information about what the `new` command does. For detailed
|
56
|
-
instructions, see the readme on the github page at
|
57
|
-
|
58
|
-
https://github.com/wmwolf/mesa_cli
|
59
|
-
email: wmwolf@physics.ucsb.edu
|
40
|
+
version: '0.19'
|
41
|
+
description: MESA CLI is a command-line interface for doing several tasks with Modules
|
42
|
+
for Experiments in Stellar Astrophysics (MESA; mesa.sourceforge.net). This package
|
43
|
+
includes one executable, `mesa`. Actions are performed by entering `mesa` followed
|
44
|
+
by various subcommands. A list of available subcommands can be displayed by entering
|
45
|
+
mesa help Any individual subcommand is documented by typing `mesa help` followed
|
46
|
+
by the name of the subcommand, for instance, mesa help new will give information
|
47
|
+
about what the `new` command does. For detailed instructions, see the readme on
|
48
|
+
the github page at https://github.com/wmwolf/mesa_cli
|
49
|
+
email: wmwolf@asu.edu
|
60
50
|
executables:
|
61
51
|
- mesa
|
62
52
|
extensions: []
|
63
53
|
extra_rdoc_files: []
|
64
54
|
files:
|
65
|
-
- README.md
|
66
55
|
- bin/mesa
|
67
|
-
homepage:
|
56
|
+
homepage: http://wmwolf.github.io/mesa_cli/
|
68
57
|
licenses:
|
69
58
|
- MIT
|
70
59
|
metadata: {}
|
71
|
-
post_install_message:
|
72
|
-
Thanks for installing mesa_cli!
|
73
|
-
|
74
|
-
To learn more about how to use the mesa command line tool and to keep up to
|
75
|
-
date with its features, check out the README at the project homepage:
|
76
|
-
|
77
|
-
https://github.com/wmwolf/mesa_cli
|
78
|
-
|
60
|
+
post_install_message:
|
79
61
|
rdoc_options: []
|
80
62
|
require_paths:
|
81
63
|
- lib
|
@@ -83,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
65
|
requirements:
|
84
66
|
- - ">="
|
85
67
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
68
|
+
version: 1.8.6
|
87
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
70
|
requirements:
|
89
71
|
- - ">="
|
@@ -91,8 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
73
|
version: '0'
|
92
74
|
requirements: []
|
93
75
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.6.
|
76
|
+
rubygems_version: 2.6.13
|
95
77
|
signing_key:
|
96
78
|
specification_version: 4
|
97
|
-
summary:
|
79
|
+
summary: Command line tools for manipulating MESA.
|
98
80
|
test_files: []
|
data/README.md
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
mesa_cli
|
2
|
-
========
|
3
|
-
|
4
|
-
Command line tools for use with open source MESA stellar evolution code.
|
5
|
-
|
6
|
-
I don't think this tool is done yet, but I wanted to get it out there. So far
|
7
|
-
requires ruby, MesaScript, thor, and a working mesa directory accessed by
|
8
|
-
`$MESA_DIR`.
|
9
|
-
|
10
|
-
## Installation ##
|
11
|
-
|
12
|
-
### Rubygems Installation
|
13
|
-
|
14
|
-
Enter
|
15
|
-
|
16
|
-
gem install mesa_cli
|
17
|
-
|
18
|
-
or if that doesn't work, enter
|
19
|
-
|
20
|
-
sudo gem install mesa_cli
|
21
|
-
|
22
|
-
into your terminal. You should be done now!
|
23
|
-
|
24
|
-
### Manual Installation
|
25
|
-
|
26
|
-
If, for some reason, the rubygems installation doesn't work, you may clone this
|
27
|
-
repository and install the single file `mesa` (located in `mesa_cli/bin/mesa`)
|
28
|
-
as detailed below.
|
29
|
-
|
30
|
-
1. Make sure you have Ruby 1.8.7 or higher (1.9.3 recommended)
|
31
|
-
2. Install [mesascript](http://wmwolf.github.io/MesaScript/).
|
32
|
-
3. Install the Thor gem via
|
33
|
-
|
34
|
-
sudo gem install thor
|
35
|
-
|
36
|
-
4. Place `mesa` file in your path
|
37
|
-
|
38
|
-
|
39
|
-
## Usage
|
40
|
-
|
41
|
-
To get quick information, type `mesa help` to list the commands and see what
|
42
|
-
they do. For detailed information on a particular command, type `mesa help
|
43
|
-
command` to learn about an individual command (replacing the word "command"
|
44
|
-
with the actual subcommand name). Brief summaries of commands are below.
|
45
|
-
|
46
|
-
### default
|
47
|
-
|
48
|
-
To use, just type
|
49
|
-
|
50
|
-
mesa default NAMELIST_NAME
|
51
|
-
|
52
|
-
where namelist name is the name of a MESA star namelist, like `star_job`,
|
53
|
-
`controls`, or `pgstar`.
|
54
|
-
|
55
|
-
This command will open the proper defaults file for the corresponding namelist
|
56
|
-
using whatever editor your system has set in the `EDITOR` variable. For
|
57
|
-
instance,
|
58
|
-
|
59
|
-
mesa default star_job
|
60
|
-
|
61
|
-
will open `$MESA_DIR/star/defaults/star_job.defaults` in vim or whatever default editor you've set up.
|
62
|
-
|
63
|
-
### install
|
64
|
-
|
65
|
-
To use, just type
|
66
|
-
|
67
|
-
mesa install VERSION_NUMBER [DIR_NAME] --shell=MYSHELL
|
68
|
-
|
69
|
-
This will do a fresh checkout of mesa (version number given by VERSION_NUMBER)
|
70
|
-
into a directory (named DIR_NAME, default is mesa-rXXXX, where XXXX is the
|
71
|
-
version number). After the checkout, mesa will install, and your login scripts
|
72
|
-
will be updated to point MESA_DIR to this new installation directory.
|
73
|
-
|
74
|
-
By default, the shell is assumed to be bash, so `~/.bash_profile` and
|
75
|
-
`~/.bashrc` will be checked for instances of `MESA_DIR=` in these files, which
|
76
|
-
are then updated to point to the new installation path. If no such assignments
|
77
|
-
are found, one will be added to `~/.bash_profile` (if that file does not
|
78
|
-
exist, it will be added to `~/.bashrc`, if it exists). There is a `--shell=`
|
79
|
-
option, but it is currently useless since there is only one shell option.
|
80
|
-
|
81
|
-
Currently there is no support for the C shell, but this will be an feature in a future version. For a basic installation with no mucking around of shell scripts, add the `--basic` or `-b` flag.
|
82
|
-
|
83
|
-
Some examples:
|
84
|
-
|
85
|
-
mesa install 9999
|
86
|
-
|
87
|
-
will download and install mesa revision 9999 into a directory named
|
88
|
-
`mesa-r9999` in the current directory. It will then try to find the files
|
89
|
-
`~/.bash_profile` and `~/.bashrc`. If it finds them, it will first try to
|
90
|
-
update any lines conatining `MESA_DIR=` to point them to the new,
|
91
|
-
fully-qualified path to `mesa-r9999`. If no such lines are added, it will add
|
92
|
-
the appropriate line (`export MESA_DIR=/PATH/TO/mesa-r9999`) at the end of one
|
93
|
-
of those scripts, preferring `~/.bash_profile`.
|
94
|
-
|
95
|
-
mesa install $HOME/mesa_installations/my_latest_mesa 9999
|
96
|
-
|
97
|
-
will download and install mesa revision 9999 into the directory
|
98
|
-
`$HOME/mesa_installations/my_latest_mesa`. Then it will set `MESA_DIR` in
|
99
|
-
login scripts as in the previous example.
|
100
|
-
|
101
|
-
mesa install 9999 -b
|
102
|
-
|
103
|
-
will download and install mesa revision 9999 into a directory named
|
104
|
-
`mesa-r9999` in the current directory. It will not attempt to change login
|
105
|
-
scripts.
|
106
|
-
|
107
|
-
mesa install $HOME/mesa_installations/my_latest_mesa 9999 -b
|
108
|
-
|
109
|
-
will download and install mesa revision 9999 into the directory
|
110
|
-
`$HOME/mesa_installations/my_latest_mesa`. It will not attempt to change login
|
111
|
-
scripts.
|
112
|
-
|
113
|
-
### new
|
114
|
-
|
115
|
-
To use, just type
|
116
|
-
|
117
|
-
mesa new DIR_NAME
|
118
|
-
|
119
|
-
where `DIR_NAME` is the name of a new MESA work directory.
|
120
|
-
|
121
|
-
This makes a copy of `$MESA_DIR/star/work` into a directory with the name
|
122
|
-
chosen. With no name (i.e. just typing `mesa new`), the directory will just be
|
123
|
-
called work. The `inlist_project` will be renamed to `inlist_DIR_NAME`. If
|
124
|
-
MesaScript is available, the main `inlist` file will be pointed to the newly-
|
125
|
-
renamed `inlist_project`, and a MesaScript version of the new `inlist_project`
|
126
|
-
will be made that compiles to `inlist_project`.
|
127
|
-
|
128
|
-
The `-s` or `--simple` option will just copy the work directory and rename the
|
129
|
-
directory only. No renaming of inlists or creation of MesaScript files will be
|
130
|
-
done.
|
131
|
-
|
132
|
-
The `-p` or `--pgstar` option will also point the main `inlist` file to the
|
133
|
-
newly-named `inlist_project` file for the `pgstar` namelist instead of the
|
134
|
-
default `inlist_pgstar`.
|
135
|
-
|
136
|
-
### point
|
137
|
-
|
138
|
-
To use, just type
|
139
|
-
|
140
|
-
mesa point INLIST_TO_POINT_TO
|
141
|
-
|
142
|
-
where `INLIST_TO_POINT_TO` is the name of an inlist that you would like your local `inlist` file to point to. Currently this can only allow you to point to one inlist. By default, this will not point to the new inlist for the `pgstar` namelist, but it will for both of the `star_job` and `controls` namelists.
|
143
|
-
|
144
|
-
The `-p` or `--pgstar` option will also point the main `inlist` file to the
|
145
|
-
`INLIST_TO_POINT_TO` file for the `pgstar` namelist.
|
146
|
-
|
147
|
-
|
148
|
-
### rates
|
149
|
-
|
150
|
-
To use, just type
|
151
|
-
|
152
|
-
mesa rates REACTION_NAME OUTFILE
|
153
|
-
|
154
|
-
where `REACTION_NAME` is the name of a reaction found in `$MESA_DIR/data/rates_data/cache`, without the preceding `r_` and optionally specifying `_1`, `_2`, or whatever other option is available. For instance, `c12_pg_n13` is a valid `REACTION_NAME`, as is `c12_pg_n13_1`. If no ending number is specified, `_1` is assumed.
|
155
|
-
|
156
|
-
`OUTFILE` is an optional argument that specifies a file name where the rate data will be written to. If it is omitted, the data is simply written to the standard output.
|
157
|
-
|
158
|
-
### test
|
159
|
-
|
160
|
-
To use, just type
|
161
|
-
|
162
|
-
mesa test TEST_CASE DIR_NAME
|
163
|
-
|
164
|
-
where `TEST_CASE` is the name of a test case in `$MESA_DIR/star/test_suite` and `DIR_NAME` is the name of a directory to be created that will contain a copy of the proper test suite case.
|
165
|
-
|
166
|
-
The second argument is optional, and if omitted, the new directory will have
|
167
|
-
the same name as the original test suite case. If neither argument is given, a
|
168
|
-
list of every file in `$MESA_DIR/star/test_suite` is output. The listing
|
169
|
-
behavior can also be forced by adding the `-l` or `--list` option to the call.
|
170
|
-
|
171
|
-
Work directories made in this way are "de-test-suited" in that calls back to
|
172
|
-
`inlist_test_suite` are deleted along with any other attempts to change the value of `mesa_dir`. All local path definitions (ones using `../../` or the
|
173
|
-
like) will be made fully qualified. For example, `../../../` will be turned
|
174
|
-
into `$MESA_DIR/`. Thus, references to other inlists, like
|
175
|
-
`inlist_massive_defaults` or models, like those found in
|
176
|
-
`$MESA_DIR/data/star_data`, should remain intact. IF THESE EXTERNAL REFERENCES
|
177
|
-
CONTAIN LOCAL PATHS, THINGS WILL BREAK. The only inlist that is strictly barred
|
178
|
-
from this process is `inlist_test_suite` which currently only serves to set
|
179
|
-
the `mesa_dir` via a local path, so references to this inlist are always
|
180
|
-
deleted.
|
181
|
-
|
182
|
-
### version
|
183
|
-
|
184
|
-
To use, just type
|
185
|
-
|
186
|
-
mesa version
|
187
|
-
|
188
|
-
This will just print out the version number of mesa that is currently installed in your MESA_DIR.
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|