calphy 1.4.5__py3-none-any.whl → 1.4.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
calphy/scheduler.py CHANGED
@@ -3,14 +3,14 @@ calphy: a Python library and command line interface for automated free
3
3
  energy calculations.
4
4
 
5
5
  Copyright 2021 (c) Sarath Menon^1, Yury Lysogorskiy^2, Ralf Drautz^2
6
- ^1: Max Planck Institut für Eisenforschung, Dusseldorf, Germany
6
+ ^1: Max Planck Institut für Eisenforschung, Dusseldorf, Germany
7
7
  ^2: Ruhr-University Bochum, Bochum, Germany
8
8
 
9
- calphy is published and distributed under the Academic Software License v1.0 (ASL).
10
- calphy is distributed in the hope that it will be useful for non-commercial academic research,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
+ calphy is published and distributed under the Academic Software License v1.0 (ASL).
10
+ calphy is distributed in the hope that it will be useful for non-commercial academic research,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
12
  calphy API is published and distributed under the BSD 3-Clause "New" or "Revised" License
13
- See the LICENSE FILE for more details.
13
+ See the LICENSE FILE for more details.
14
14
 
15
15
  More information about the program can be found in:
16
16
  Menon, Sarath, Yury Lysogorskiy, Jutta Rogal, and Ralf Drautz.
@@ -25,25 +25,26 @@ import subprocess as sub
25
25
  import os
26
26
  import stat
27
27
 
28
+
28
29
  class Local:
29
30
  """
30
31
  Local submission script
31
32
  """
33
+
32
34
  def __init__(self, options, cores=1, directory=os.getcwd()):
33
- self.queueoptions = {"scheduler": "local",
34
- "jobname": "tis",
35
- "queuename": None,
36
- "memory": None,
37
- "cores": cores,
38
- "hint": None,
39
- "directory": directory,
40
- "options": [],
41
- "commands": [],
42
- "modules": [],
43
- "header": "#!/bin/bash"
44
-
45
- }
46
- for (key, val) in options.items():
35
+ self.queueoptions = {
36
+ "scheduler": "local",
37
+ "jobname": "tis",
38
+ "queuename": None,
39
+ "memory": None,
40
+ "cores": cores,
41
+ "hint": None,
42
+ "directory": directory,
43
+ "options": [],
44
+ "commands": [],
45
+ "header": "#!/bin/bash",
46
+ }
47
+ for key, val in options.items():
47
48
  if key in self.queueoptions.keys():
48
49
  if val is not None:
49
50
  self.queueoptions[key] = val
@@ -60,14 +61,10 @@ class Local:
60
61
  fout.write(self.queueoptions["header"])
61
62
  fout.write("\n")
62
63
 
63
- #now write modules
64
- for module in self.queueoptions["modules"]:
65
- fout.write("module load %s\n" %module)
66
-
67
- #now finally commands
64
+ # now finally commands
68
65
  for command in self.queueoptions["commands"]:
69
- fout.write("%s\n" %command)
70
- fout.write("%s > %s 2> %s\n" %(self.maincommand, jobout, joberr))
66
+ fout.write("%s\n" % command)
67
+ fout.write("%s > %s 2> %s\n" % (self.maincommand, jobout, joberr))
71
68
  self.script = outfile
72
69
 
73
70
  def submit(self):
@@ -77,41 +74,42 @@ class Local:
77
74
  st = os.stat(self.script)
78
75
  os.chmod(self.script, st.st_mode | stat.S_IEXEC)
79
76
  cmd = [self.script]
80
- proc = sub.Popen(cmd, stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE)
77
+ proc = sub.Popen(cmd, stdin=sub.PIPE, stdout=sub.PIPE, stderr=sub.PIPE)
81
78
  return proc
82
79
 
80
+
83
81
  class SLURM:
84
82
  """
85
83
  Slurm class for writing submission script
86
84
  """
85
+
87
86
  def __init__(self, options, cores=1, directory=os.getcwd()):
88
87
  """
89
88
  Create class
90
89
  """
91
- self.queueoptions = {"scheduler": "slurm",
92
- "jobname": "tis",
93
- "queuename": None,
94
- "walltime": "23:59:00",
95
- "memory": "3GB",
96
- "cores": cores,
97
- "hint": "nomultithread",
98
- "directory": directory,
99
- "options": [],
100
- "commands": [ "uss=$(whoami)",
101
- "find /dev/shm/ -user $uss -type f -mmin +30 -delete",
102
- ],
103
- "modules": [],
104
- "header": "#!/bin/bash"
105
-
106
- }
107
- for (key, val) in options.items():
90
+ self.queueoptions = {
91
+ "scheduler": "slurm",
92
+ "jobname": "tis",
93
+ "queuename": None,
94
+ "walltime": "23:59:00",
95
+ "memory": "3GB",
96
+ "cores": cores,
97
+ "hint": "nomultithread",
98
+ "directory": directory,
99
+ "options": [],
100
+ "commands": [
101
+ "uss=$(whoami)",
102
+ "find /dev/shm/ -user $uss -type f -mmin +30 -delete",
103
+ ],
104
+ "header": "#!/bin/bash",
105
+ }
106
+ for key, val in options.items():
108
107
  if key in self.queueoptions.keys():
109
108
  if val is not None:
110
109
  if val != "":
111
110
  self.queueoptions[key] = val
112
111
  self.maincommand = ""
113
112
 
114
-
115
113
  def write_script(self, outfile):
116
114
  """
117
115
  Write the script file
@@ -123,28 +121,24 @@ class SLURM:
123
121
  fout.write(self.queueoptions["header"])
124
122
  fout.write("\n")
125
123
 
126
- #write the main header options
127
- fout.write("#SBATCH --job-name=%s\n" %self.queueoptions["jobname"])
128
- fout.write("#SBATCH --time=%s\n" %self.queueoptions["walltime"])
124
+ # write the main header options
125
+ fout.write("#SBATCH --job-name=%s\n" % self.queueoptions["jobname"])
126
+ fout.write("#SBATCH --time=%s\n" % self.queueoptions["walltime"])
129
127
  if self.queueoptions["queuename"] is not None:
130
- fout.write("#SBATCH --partition=%s\n"%self.queueoptions["queuename"])
131
- fout.write("#SBATCH --ntasks=%s\n" %str(self.queueoptions["cores"]))
132
- fout.write("#SBATCH --mem-per-cpu=%s\n"%self.queueoptions["memory"])
133
- fout.write("#SBATCH --hint=%s\n" %self.queueoptions["hint"])
134
- fout.write("#SBATCH --chdir=%s\n" %self.queueoptions["directory"])
128
+ fout.write("#SBATCH --partition=%s\n" % self.queueoptions["queuename"])
129
+ fout.write("#SBATCH --ntasks=%s\n" % str(self.queueoptions["cores"]))
130
+ fout.write("#SBATCH --mem-per-cpu=%s\n" % self.queueoptions["memory"])
131
+ fout.write("#SBATCH --hint=%s\n" % self.queueoptions["hint"])
132
+ fout.write("#SBATCH --chdir=%s\n" % self.queueoptions["directory"])
135
133
 
136
- #now write extra options
134
+ # now write extra options
137
135
  for option in self.queueoptions["options"]:
138
- fout.write("#SBATCH %s\n" %option)
136
+ fout.write("#SBATCH %s\n" % option)
139
137
 
140
- #now write modules
141
- for module in self.queueoptions["modules"]:
142
- fout.write("module load %s\n" %module)
143
-
144
- #now finally commands
138
+ # now finally commands
145
139
  for command in self.queueoptions["commands"]:
146
- fout.write("%s\n" %command)
147
- fout.write("%s > %s 2> %s\n" %(self.maincommand, jobout, joberr))
140
+ fout.write("%s\n" % command)
141
+ fout.write("%s > %s 2> %s\n" % (self.maincommand, jobout, joberr))
148
142
 
149
143
  self.script = outfile
150
144
 
@@ -152,40 +146,41 @@ class SLURM:
152
146
  """
153
147
  Submit the job
154
148
  """
155
- cmd = ['sbatch', self.script]
156
- proc = sub.Popen(cmd, stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE)
149
+ cmd = ["sbatch", self.script]
150
+ proc = sub.Popen(cmd, stdin=sub.PIPE, stdout=sub.PIPE, stderr=sub.PIPE)
157
151
  print(f'submitting {self.queueoptions["jobname"]}')
158
152
  proc.communicate()
159
153
  return proc
160
154
 
161
155
 
162
-
163
156
  class SGE:
164
157
  """
165
158
  Slurm class for writing submission script
166
159
  """
160
+
167
161
  def __init__(self, options, cores=1, directory=os.getcwd()):
168
162
  """
169
163
  Create class
170
164
  """
171
- self.queueoptions = {"scheduler": "sge",
172
- "jobname": "tis",
173
- "walltime": "23:59:00",
174
- "queuename": None,
175
- "memory": "3GB",
176
- "system": "smp",
177
- "commands": [],
178
- "modules": [],
179
- "options": ["-j y",
180
- "-R y",
181
- "-P ams.p",
182
- ],
183
- "cores": cores,
184
- "hint": None,
185
- "directory": directory,
186
- "header": "#!/bin/bash"
187
- }
188
- for (key, val) in options.items():
165
+ self.queueoptions = {
166
+ "scheduler": "sge",
167
+ "jobname": "tis",
168
+ "walltime": "23:59:00",
169
+ "queuename": None,
170
+ "memory": "3GB",
171
+ "system": "smp",
172
+ "commands": [],
173
+ "options": [
174
+ "-j y",
175
+ "-R y",
176
+ "-P ams.p",
177
+ ],
178
+ "cores": cores,
179
+ "hint": None,
180
+ "directory": directory,
181
+ "header": "#!/bin/bash",
182
+ }
183
+ for key, val in options.items():
189
184
  if key in self.queueoptions.keys():
190
185
  if val is not None:
191
186
  self.queueoptions[key] = val
@@ -195,40 +190,40 @@ class SGE:
195
190
  """
196
191
  Write the script file
197
192
  """
193
+ jobout = ".".join([outfile, "out"])
194
+ joberr = ".".join([outfile, "err"])
195
+
198
196
  with open(outfile, "w") as fout:
199
197
  fout.write(self.queueoptions["header"])
200
198
  fout.write("\n")
201
199
 
202
- #write the main header options
203
- fout.write("#$ -N %s\n" %self.queueoptions["jobname"])
204
- fout.write("#$ -l h_rt=%s\n" %self.queueoptions["walltime"])
205
- fout.write("#$ -l qname=%s\n"%self.queueoptions["queuename"])
206
- fout.write("#$ -pe %s %s\n" %( self.queueoptions["system"], str(self.queueoptions["cores"])))
207
- fout.write("#$ -l h_vmem=%s\n"%self.queueoptions["memory"])
208
- fout.write("#$ -cwd %s\n" %self.queueoptions["directory"])
209
-
210
- #now write extra options
200
+ # write the main header options
201
+ fout.write("#$ -N %s\n" % self.queueoptions["jobname"])
202
+ fout.write("#$ -l h_rt=%s\n" % self.queueoptions["walltime"])
203
+ fout.write("#$ -l qname=%s\n" % self.queueoptions["queuename"])
204
+ fout.write(
205
+ "#$ -pe %s %s\n"
206
+ % (self.queueoptions["system"], str(self.queueoptions["cores"]))
207
+ )
208
+ fout.write("#$ -l h_vmem=%s\n" % self.queueoptions["memory"])
209
+ fout.write("#$ -cwd %s\n" % self.queueoptions["directory"])
210
+
211
+ # now write extra options
211
212
  for option in self.queueoptions["options"]:
212
- fout.write("#$ %s\n" %option)
213
-
214
- #now write modules
215
- for module in self.queueoptions["modules"]:
216
- fout.write("module load %s\n" %module)
213
+ fout.write("#$ %s\n" % option)
217
214
 
218
- #now finally commands
215
+ # now finally commands
219
216
  for command in self.queueoptions["commands"]:
220
- fout.write("%s\n" %command)
217
+ fout.write("%s\n" % command)
221
218
 
222
- fout.write("%s > %s 2> %s\n" %(self.maincommand, jobout, joberr))
223
-
224
- self.script = outfile
219
+ fout.write("%s > %s 2> %s\n" % (self.maincommand, jobout, joberr))
225
220
 
221
+ self.script = outfile
226
222
 
227
223
  def submit(self):
228
224
  """
229
225
  Submit the job
230
226
  """
231
- cmd = ['qsub', self.script]
232
- proc = sub.Popen(cmd, stdin=sub.PIPE,stdout=sub.PIPE,stderr=sub.PIPE)
227
+ cmd = ["qsub", self.script]
228
+ proc = sub.Popen(cmd, stdin=sub.PIPE, stdout=sub.PIPE, stderr=sub.PIPE)
233
229
  return proc
234
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: calphy
3
- Version: 1.4.5
3
+ Version: 1.4.6
4
4
  Summary: free energy calculation for python
5
5
  Home-page: https://github.com/ICAMS/calphy
6
6
  Author: Sarath Menon, Yury Lysogorskiy, Ralf Drautz
@@ -1,25 +1,25 @@
1
- calphy/__init__.py,sha256=ajDpPU1OkfwLqHSjYro8IgKKujLpCZhkszpGfQHA_5U,233
1
+ calphy/__init__.py,sha256=K3G6Hr3pdNGqjHH0ZvD0OGh4ukLTKdlkcm_JLSyCKw8,233
2
2
  calphy/alchemy.py,sha256=IEYLfsJRsjfB0zFfApmxGbYXif7IE6mUY_vjTZoXdII,17236
3
3
  calphy/clitools.py,sha256=ZUr6ZfdopFxWMbrzNT_TQaUA16iPmZ3144oPcwcDazY,4433
4
- calphy/composition_transformation.py,sha256=z3X4fFVoym6QgRDpLBYZ_fM9V0IgJvBq-wITu1nwVmw,17247
4
+ calphy/composition_transformation.py,sha256=S-4H4UDjy_1Ucn6qgAoMaCsDRfNc8zJ5DH4_BqOGAT4,19336
5
5
  calphy/errors.py,sha256=KN47RWTLbg1H_NZMrhCiJCbqjqJScJ1pgQAuzj1-l84,1268
6
- calphy/helpers.py,sha256=goN_n5kceSaevjBilQDgHD5-QZxsQsOwTiWsY00jMcM,8411
7
- calphy/input.py,sha256=3xVoJcbwq3T7y_1drIvg1Erel9dz6y9A4rgNsncEfgw,36225
6
+ calphy/helpers.py,sha256=oPDlnXKoOLP1uwnilDgorKs_FlvunN1-bwChEwDslDE,8608
7
+ calphy/input.py,sha256=gITbf-X-pdPm7pAd8CMOFV6rd4MaiNJFKLOqfG0TfWA,39578
8
8
  calphy/integrators.py,sha256=q5sIJX3nh4c9kmDQJ4Pqhvm38tRWKELoJwm5gW0lqws,21858
9
9
  calphy/kernel.py,sha256=wjSpQ59PN-aqHQ1kvOxTYnP2d3wE1Zx4A9ZhqQFqGlI,6311
10
10
  calphy/liquid.py,sha256=ECF3DxPZv7XHnmQzk_yz1fol-Vsd98lRojTMAR1YS3M,15025
11
11
  calphy/phase.py,sha256=F4GRrEG0IDR6f0rFabQYP7aYBzpKAyxPvol-n7vAj08,53540
12
- calphy/phase_diagram.py,sha256=Yu192y7bhWsj-xQL7ITSBdMHKXJ6I_4gV0cLfdXTOa4,27791
12
+ calphy/phase_diagram.py,sha256=85ZTzyQX_a902wqRJ49MQsQEHZiZAwfHOaruskVhlD4,32417
13
13
  calphy/postprocessing.py,sha256=XxpFGbR8dUoKhGb7GCPEWPA4CWl7ZftuM1cN4tz7-fQ,15164
14
14
  calphy/queuekernel.py,sha256=4GMIYnjMiAPipoLNKP5noYcfeEOI_vCqm84zgokk7Xw,5321
15
15
  calphy/routines.py,sha256=YaVoAbeAbZ3ytAP_A0o5ngkpPiXpc_lk2I0bN3nqhPs,17858
16
- calphy/scheduler.py,sha256=nIxlKKGj8ol_FuYMMtXrQinPGhPlYs2h-JsEGHC7_wY,8666
16
+ calphy/scheduler.py,sha256=U-FQttOHOUiL-qR9gepvdGn1fxbfhZhHezuWdO3Fgyk,7575
17
17
  calphy/solid.py,sha256=zHSqri8roW23hIQ21huxHHJqq3P5EklSj6Z0z9ywfbc,21911
18
18
  calphy/splines.py,sha256=BGwUVz_qXQxUzpUCuZo6CsELcd5JVNWzI-Ttcz22G_E,61627
19
19
  calphy/utils.py,sha256=0UpsYoxjS5N-iGs-cdm0YDMkLF8IHvKO3smXDHrj3eg,3818
20
- calphy-1.4.5.dist-info/licenses/LICENSE,sha256=XIHGB5RZLIhOjjoO1bPf0II-qDbjhP5Cv5HJMRE9v1g,16651
21
- calphy-1.4.5.dist-info/METADATA,sha256=za1qlwUMSyzxwl2bghD8i9HdGRMLKpxslgpkX-jiM2s,4469
22
- calphy-1.4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- calphy-1.4.5.dist-info/entry_points.txt,sha256=KX5dP2iYy9GB4Mo0lbCPAz6jo-8b1Gt9GDmsDFzt9pQ,439
24
- calphy-1.4.5.dist-info/top_level.txt,sha256=w871dhMqPwgjjbifBWdkT9_aOnK1ek4Odrh8UnSG3PE,7
25
- calphy-1.4.5.dist-info/RECORD,,
20
+ calphy-1.4.6.dist-info/licenses/LICENSE,sha256=XIHGB5RZLIhOjjoO1bPf0II-qDbjhP5Cv5HJMRE9v1g,16651
21
+ calphy-1.4.6.dist-info/METADATA,sha256=4gAFxTRF2NTh1I_3Z5zYnotK_Fvdc9PaWPWp2_qotHY,4469
22
+ calphy-1.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ calphy-1.4.6.dist-info/entry_points.txt,sha256=KX5dP2iYy9GB4Mo0lbCPAz6jo-8b1Gt9GDmsDFzt9pQ,439
24
+ calphy-1.4.6.dist-info/top_level.txt,sha256=w871dhMqPwgjjbifBWdkT9_aOnK1ek4Odrh8UnSG3PE,7
25
+ calphy-1.4.6.dist-info/RECORD,,
File without changes