calphy 1.3.1__tar.gz → 1.3.2__tar.gz

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.
Files changed (34) hide show
  1. {calphy-1.3.1/calphy.egg-info → calphy-1.3.2}/PKG-INFO +1 -1
  2. {calphy-1.3.1 → calphy-1.3.2}/calphy/__init__.py +1 -1
  3. {calphy-1.3.1 → calphy-1.3.2}/calphy/helpers.py +5 -3
  4. {calphy-1.3.1 → calphy-1.3.2}/calphy/input.py +26 -8
  5. {calphy-1.3.1 → calphy-1.3.2}/calphy/phase.py +17 -0
  6. {calphy-1.3.1 → calphy-1.3.2}/calphy/scheduler.py +2 -3
  7. {calphy-1.3.1 → calphy-1.3.2/calphy.egg-info}/PKG-INFO +1 -1
  8. {calphy-1.3.1 → calphy-1.3.2}/setup.py +1 -1
  9. {calphy-1.3.1 → calphy-1.3.2}/LICENSE +0 -0
  10. {calphy-1.3.1 → calphy-1.3.2}/MANIFEST.in +0 -0
  11. {calphy-1.3.1 → calphy-1.3.2}/README.md +0 -0
  12. {calphy-1.3.1 → calphy-1.3.2}/calphy/alchemy.py +0 -0
  13. {calphy-1.3.1 → calphy-1.3.2}/calphy/clitools.py +0 -0
  14. {calphy-1.3.1 → calphy-1.3.2}/calphy/composition_transformation.py +0 -0
  15. {calphy-1.3.1 → calphy-1.3.2}/calphy/errors.py +0 -0
  16. {calphy-1.3.1 → calphy-1.3.2}/calphy/integrators.py +0 -0
  17. {calphy-1.3.1 → calphy-1.3.2}/calphy/kernel.py +0 -0
  18. {calphy-1.3.1 → calphy-1.3.2}/calphy/liquid.py +0 -0
  19. {calphy-1.3.1 → calphy-1.3.2}/calphy/phase_diagram.py +0 -0
  20. {calphy-1.3.1 → calphy-1.3.2}/calphy/queuekernel.py +0 -0
  21. {calphy-1.3.1 → calphy-1.3.2}/calphy/routines.py +0 -0
  22. {calphy-1.3.1 → calphy-1.3.2}/calphy/solid.py +0 -0
  23. {calphy-1.3.1 → calphy-1.3.2}/calphy/splines.py +0 -0
  24. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/SOURCES.txt +0 -0
  25. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/dependency_links.txt +0 -0
  26. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/entry_points.txt +0 -0
  27. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/not-zip-safe +0 -0
  28. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/requires.txt +0 -0
  29. {calphy-1.3.1 → calphy-1.3.2}/calphy.egg-info/top_level.txt +0 -0
  30. {calphy-1.3.1 → calphy-1.3.2}/setup.cfg +0 -0
  31. {calphy-1.3.1 → calphy-1.3.2}/tests/test_helpers.py +0 -0
  32. {calphy-1.3.1 → calphy-1.3.2}/tests/test_integrators.py +0 -0
  33. {calphy-1.3.1 → calphy-1.3.2}/tests/test_options.py +0 -0
  34. {calphy-1.3.1 → calphy-1.3.2}/tests/test_solid_methods.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: calphy
3
- Version: 1.3.1
3
+ Version: 1.3.2
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
@@ -4,7 +4,7 @@ from calphy.solid import Solid
4
4
  from calphy.alchemy import Alchemy
5
5
  from calphy.routines import MeltingTemp
6
6
 
7
- __version__ = "1.3.1"
7
+ __version__ = "1.3.2"
8
8
 
9
9
  def addtest(a,b):
10
10
  return a+b
@@ -46,8 +46,8 @@ class LammpsScript:
46
46
  for line in self.script:
47
47
  fout.write(f'{line}\n')
48
48
 
49
- def create_object(cores, directory, timestep, cmdargs=None,
50
- init_commands=None, script_mode=False):
49
+ def create_object(cores, directory, timestep, cmdargs="",
50
+ init_commands=(), script_mode=False):
51
51
  """
52
52
  Create LAMMPS object
53
53
 
@@ -69,6 +69,8 @@ def create_object(cores, directory, timestep, cmdargs=None,
69
69
  if script_mode:
70
70
  lmp = LammpsScript()
71
71
  else:
72
+ if cmdargs == "":
73
+ cmdargs = None
72
74
  lmp = LammpsLibrary(
73
75
  cores=cores, working_directory=directory, cmdargs=cmdargs
74
76
  )
@@ -79,7 +81,7 @@ def create_object(cores, directory, timestep, cmdargs=None,
79
81
  ["timestep", str(timestep)],
80
82
  ["box", "tilt large"]]
81
83
 
82
- if init_commands is not None:
84
+ if len(init_commands) > 0:
83
85
  #we need to replace some initial commands
84
86
  for rc in init_commands:
85
87
  #split the command
@@ -40,6 +40,7 @@ from pyscal3.core import structure_dict, element_dict, _make_crystal
40
40
  from ase.io import read, write
41
41
  import shutil
42
42
 
43
+ __version__ = "1.3.2"
43
44
 
44
45
  def read_report(folder):
45
46
  """
@@ -95,8 +96,8 @@ class MD(BaseModel, title='MD specific input options'):
95
96
  n_cycles: Annotated[int, Field(default=100, gt=0)]
96
97
  thermostat_damping: Annotated[Union[float, conlist(float, min_length=2, max_length=2)], Field(default=0.1, gt=0)]
97
98
  barostat_damping: Annotated[Union[float, conlist(float, min_length=2, max_length=2)], Field(default=0.1, gt=0)]
98
- cmdargs: Annotated[Union[None, str], Field(default=None)]
99
- init_commands: Annotated[Union[None, List[str]], Field(default=None)]
99
+ cmdargs: Annotated[str, Field(default="")]
100
+ init_commands: Annotated[List, Field(default=[])]
100
101
 
101
102
 
102
103
  class NoseHoover(BaseModel, title='Specific input options for Nose-Hoover thermostat'):
@@ -111,12 +112,12 @@ class Queue(BaseModel, title='Options for configuring queue'):
111
112
  scheduler: Annotated[str, Field(default='local')]
112
113
  cores: Annotated[int, Field(default=1, gt=0)]
113
114
  jobname: Annotated[str, Field(default='calphy')]
114
- walltime: Annotated[Union[str, None], Field(default=None)]
115
- queuename: Annotated[Union[str,None], Field(default=None)]
115
+ walltime: Annotated[str, Field(default="23:59:00")]
116
+ queuename: Annotated[str, Field(default="")]
116
117
  memory: Annotated[str, Field(default="3GB")]
117
- commands: Annotated[Union[List[str],None], Field(default=None)]
118
- options: Annotated[Union[List[str],None], Field(default=None)]
119
- modules: Annotated[Union[List[str],None], Field(default=None)]
118
+ commands: Annotated[List, Field(default=[])]
119
+ options: Annotated[List, Field(default=[])]
120
+ modules: Annotated[List, Field(default=[])]
120
121
 
121
122
  class Tolerance(BaseModel, title='Tolerance settings for convergence'):
122
123
  lattice_constant: Annotated[float, Field(default=0.0002, ge=0)]
@@ -656,4 +657,21 @@ def _convert_legacy_inputfile(file, return_calcs=False):
656
657
  warnings.warn(f'Old style input file calphy < v2 found. Converted input in {outfile}. Please check!')
657
658
  with open(outfile, 'w') as fout:
658
659
  yaml.safe_dump(newdata, fout)
659
- return outfile
660
+ return outfile
661
+
662
+
663
+ def generate_metadata():
664
+ metadata = {}
665
+ metadata["software"] = {}
666
+ metadata["software"]["name"] = "calphy"
667
+ metadata["software"]["doi"] = "10.5281/zenodo.10527452"
668
+ metadata["software"]["version"] = __version__
669
+ metadata["software"]["repository"] = "https://github.com/ICAMS/calphy"
670
+ metadata["software"]["webpage"] = "https://calphy.org/"
671
+
672
+ metadata["files"] = {}
673
+ metadata["files"]["input_file.yml"] = "input file"
674
+ metadata["files"]["report.yaml"] = "results after thermodynamic integration"
675
+ metadata["files"]["input_configuration.data"] = "input atomic configuration"
676
+
677
+ return metadata
@@ -28,11 +28,14 @@ sarath.menon@ruhr-uni-bochum.de/yury.lysogorskiy@icams.rub.de
28
28
  import numpy as np
29
29
  import yaml
30
30
  import copy
31
+ import os
32
+ import shutil
31
33
 
32
34
  import pyscal3.traj_process as ptp
33
35
  from calphy.integrators import *
34
36
  import calphy.helpers as ph
35
37
  from calphy.errors import *
38
+ from calphy.input import generate_metadata
36
39
 
37
40
  class Phase:
38
41
  """
@@ -50,6 +53,20 @@ class Phase:
50
53
  def __init__(self, calculation=None, simfolder=None, log_to_screen=False):
51
54
 
52
55
  self.calc = copy.deepcopy(calculation)
56
+
57
+ #serialise input
58
+ indict = {"calculations": [self.calc.dict()]}
59
+ with open(os.path.join(simfolder, 'input_file.yaml'), 'w') as fout:
60
+ yaml.safe_dump(indict, fout)
61
+
62
+ #serialise input configuration
63
+ shutil.copy(self.calc.lattice, os.path.join(simfolder, 'input_configuration.data'))
64
+
65
+ #write simple metadata
66
+ with open(os.path.join(simfolder, 'metadata.yaml'), 'w') as fout:
67
+ yaml.safe_dump(generate_metadata(), fout)
68
+
69
+
53
70
  self.simfolder = simfolder
54
71
  self.log_to_screen = log_to_screen
55
72
 
@@ -32,7 +32,6 @@ class Local:
32
32
  def __init__(self, options, cores=1, directory=os.getcwd()):
33
33
  self.queueoptions = {"scheduler": "local",
34
34
  "jobname": "tis",
35
- "walltime": None,
36
35
  "queuename": None,
37
36
  "memory": None,
38
37
  "cores": cores,
@@ -92,7 +91,6 @@ class SLURM:
92
91
  self.queueoptions = {"scheduler": "slurm",
93
92
  "jobname": "tis",
94
93
  "walltime": "23:59:00",
95
- "queuename": "shorttime",
96
94
  "memory": "3GB",
97
95
  "cores": cores,
98
96
  "hint": "nomultithread",
@@ -108,7 +106,8 @@ class SLURM:
108
106
  for (key, val) in options.items():
109
107
  if key in self.queueoptions.keys():
110
108
  if val is not None:
111
- self.queueoptions[key] = val
109
+ if val is not "":
110
+ self.queueoptions[key] = val
112
111
  self.maincommand = ""
113
112
 
114
113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: calphy
3
- Version: 1.3.1
3
+ Version: 1.3.2
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
@@ -53,7 +53,7 @@ setup(
53
53
  packages=find_packages(include=['calphy', 'calphy.*']),
54
54
  test_suite='tests',
55
55
  url='https://github.com/ICAMS/calphy',
56
- version='1.3.1',
56
+ version='1.3.2',
57
57
  zip_safe=False,
58
58
  entry_points={
59
59
  'console_scripts': [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes