pyALF 2.6.post16__tar.gz → 2.6.post35__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 (39) hide show
  1. pyalf-2.6.post35/PKG-INFO +143 -0
  2. {pyalf-2.6.post16 → pyalf-2.6.post35}/README.md +3 -3
  3. pyalf-2.6.post35/pyALF.egg-info/PKG-INFO +143 -0
  4. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/alf_source.py +2 -2
  5. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/check_common.py +1 -1
  6. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/minimal_ALF_run.py +1 -1
  7. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/simulation.py +64 -6
  8. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyproject.toml +5 -5
  9. pyalf-2.6.post16/PKG-INFO +0 -483
  10. pyalf-2.6.post16/pyALF.egg-info/PKG-INFO +0 -483
  11. {pyalf-2.6.post16 → pyalf-2.6.post35}/LICENSE +0 -0
  12. {pyalf-2.6.post16 → pyalf-2.6.post35}/MANIFEST.in +0 -0
  13. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyALF.egg-info/SOURCES.txt +0 -0
  14. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyALF.egg-info/dependency_links.txt +0 -0
  15. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyALF.egg-info/entry_points.txt +0 -0
  16. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyALF.egg-info/requires.txt +0 -0
  17. {pyalf-2.6.post16 → pyalf-2.6.post35}/pyALF.egg-info/top_level.txt +0 -0
  18. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/__init__.py +0 -0
  19. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/ana.py +0 -0
  20. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/analysis.py +0 -0
  21. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/check_rebin_ipy.py +0 -0
  22. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/check_rebin_tk.py +0 -0
  23. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/check_warmup_ipy.py +0 -0
  24. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/check_warmup_tk.py +0 -0
  25. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/__init__.py +0 -0
  26. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_bin_count.py +0 -0
  27. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_del_bins.py +0 -0
  28. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_postprocess.py +0 -0
  29. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_run.py +0 -0
  30. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_show_obs.py +0 -0
  31. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/cli/alf_test_branch.py +0 -0
  32. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/exceptions.py +0 -0
  33. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/init_layout.py +0 -0
  34. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/lattice.py +0 -0
  35. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/lattices_armv8.4-a.so +0 -0
  36. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/lattices_x86-64.so +0 -0
  37. {pyalf-2.6.post16 → pyalf-2.6.post35}/py_alf/utils.py +0 -0
  38. {pyalf-2.6.post16 → pyalf-2.6.post35}/setup.cfg +0 -0
  39. {pyalf-2.6.post16 → pyalf-2.6.post35}/tests/test_lattice_init.py +0 -0
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyALF
3
+ Version: 2.6.post35
4
+ Summary: Python interface for ALF, plus scripts and Jupyter notebooks.
5
+ Author-email: ALF Collaboration <alf@physik.uni-wuerzburg.de>, Jonas Schwab <jonas.schwab@uni-wuerzburg.de>
6
+ License-Expression: GPL-2.0-or-later
7
+ Project-URL: Documentation, https://alf.physik.uni-wuerzburg.de/pyalf-doc/
8
+ Project-URL: Repository, https://github.com/ALF-QMC/pyALF
9
+ Project-URL: Issues, https://github.com/ALF-QMC/pyALF/issues
10
+ Project-URL: ALF Homepage, https://alf.physik.uni-wuerzburg.de/
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.7
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: f90nml
17
+ Requires-Dist: h5py
18
+ Requires-Dist: ipympl
19
+ Requires-Dist: ipywidgets
20
+ Requires-Dist: matplotlib
21
+ Requires-Dist: numba
22
+ Requires-Dist: numpy
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scipy
25
+ Provides-Extra: gui
26
+ Requires-Dist: tkinter; extra == "gui"
27
+ Provides-Extra: doc
28
+ Requires-Dist: sphinxcontrib-svg2pdfconverter; extra == "doc"
29
+ Requires-Dist: jupyter-book<2.0; extra == "doc"
30
+ Requires-Dist: numpydoc; extra == "doc"
31
+ Requires-Dist: sphinx-argparse; extra == "doc"
32
+ Dynamic: license-file
33
+
34
+ [![Documentation](https://img.shields.io/badge/-Documentation-blue)](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF)
35
+ [<img src="https://img.shields.io/badge/Supported%20By-UNITARY%20FUND-brightgreen.svg?style=for-the-badge" alt="drawing" width="170"/>](https://unitary.fund)
36
+
37
+ ## pyALF
38
+
39
+ A Python package building on top of [ALF](https://github.com/ALF-QMC/ALF), meant to simplify the different steps of working with ALF, including:
40
+
41
+ * Obtaining and compiling the ALF source code
42
+ * Preparing and running simulations
43
+ * Postprocessing and displaying the data obtained during the simulation
44
+
45
+ It introduces:
46
+
47
+ * The Python module `py_alf`, exposing all the package's utility to Python.
48
+ * A set of command line tools in the folder, that make it easy to leverage pyALF from a Unix shell.
49
+ They are automatically exposed to the shell when pyALF is installed via pip.
50
+ Their source code can be found in [py_alf/cli](py_alf/cli) and documentation
51
+ [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF/source/reference/cli.html).
52
+ * Jupyter notebooks in the folder [Notebooks](Notebooks), serving as an easy introduction to QMC and ALF.
53
+ * Python Scripts in the folder [Scripts](Scripts) that can be run to reproduce benchmark results for established models.
54
+
55
+ The **documentation** can be found [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF).
56
+
57
+ ## Installation
58
+
59
+ ---
60
+ **⚠️ NOTE** In previous versions of pyALF, the installation instructions asked the users to set the environment variable `PYTHONPATH`.
61
+ This conflicts with the newer pip package, therefore you should remove definitions of this environment variable related to pyALF.
62
+
63
+ ---
64
+
65
+ pyALF can be installed via the Python package installer [pip](https://pip.pypa.io/en/stable/).
66
+
67
+ ```bash
68
+ pip install pyALF
69
+ ```
70
+
71
+ For running ALF, you will additionaly need the [ALF prerequsites](https://github.com/ALF-QMC/ALF#prerequisites).
72
+
73
+ Alternatively, one could use [this Docker image](https://hub.docker.com/r/alfcollaboration/jupyter-pyalf-full), which has ALF, pyALF and a Jupyter server pre-installed.
74
+
75
+ ### Development installation
76
+
77
+ If you want to develop pyALF, you can clone the repository and install it in
78
+ [development mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html),
79
+ which allows you to edit the files while using them like an installed package.
80
+ For this, it is highly recommended to use a dedicated Python environment using e.g.
81
+ [Python venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
82
+ or a
83
+ [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
84
+ The following example shows how to install pyALF in development mode using venv.
85
+
86
+ ```bash
87
+ git clone https://github.com/ALF-QMC/pyALF.git
88
+ cd pyALF
89
+ python -m venv .venv
90
+ source .venv/bin/activate
91
+
92
+ pip install --editable .
93
+ ```
94
+
95
+ ## Usage
96
+
97
+ There are multiple ways to use pyALF, which roughly breaks down into three approaches:
98
+ * Using Jupyter notebooks
99
+ * Using the command line interface
100
+ * Use the module `py_alf` in custom scripts
101
+
102
+ ### Jupyter notebooks
103
+
104
+ A convenient way to use pyALF is through Jupyter notebooks. They [are run](https://jupyter.readthedocs.io/en/latest/running.html) through a Jupyter server started, e.g., from the command line:
105
+
106
+ ```bash
107
+ jupyter-lab
108
+ ```
109
+
110
+ or
111
+
112
+ ```bash
113
+ jupyter-notebook
114
+ ```
115
+
116
+ which opens the "notebook dashboard" in your default browser, from where one can open the sample notebooks in [Notebooks/](Notebooks) and create new notebooks.
117
+
118
+ ### Command line interface
119
+
120
+ pyALF also delivers a set of command line scripts, to be use from a UNIX shell. For a full list of command line scripts see [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF/source/reference/cli.html).
121
+
122
+ Try, e.g.
123
+
124
+ ```bash
125
+ alf_run -h
126
+ ```
127
+
128
+ The source code for the scripts can be found in the folder [py_alf/cli/](py_alf/cli).
129
+
130
+
131
+ ### Use module `py_alf` in custom scripts
132
+
133
+ Finally, one can also use the module module `py_alf` in custom Python scripts, which is analogous to the usage in Jupyter notebooks minus some interactivity.
134
+
135
+ ## License
136
+
137
+ The various works that make up the ALF project are placed under licenses that put
138
+ a strong emphasis on the attribution of the original authors and the sharing of the contained knowledge.
139
+ To that end we have placed the ALF source code under the GPL version 3 license (see license.GPL and license.additional)
140
+ and took the liberty as per GPLv3 section 7 to include additional terms that deal with the attribution
141
+ of the original authors(see license.additional).
142
+ The Documentation of the ALF project by the ALF contributors is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (see Documentation/license.CCBYSA)
143
+ We mention that we link against parts of lapack which licensed under a BSD license(see license.BSD).
@@ -3,7 +3,7 @@
3
3
 
4
4
  ## pyALF
5
5
 
6
- A Python package building on top of [ALF](https://git.physik.uni-wuerzburg.de/ALF/ALF), meant to simplify the different steps of working with ALF, including:
6
+ A Python package building on top of [ALF](https://github.com/ALF-QMC/ALF), meant to simplify the different steps of working with ALF, including:
7
7
 
8
8
  * Obtaining and compiling the ALF source code
9
9
  * Preparing and running simulations
@@ -35,7 +35,7 @@ pyALF can be installed via the Python package installer [pip](https://pip.pypa.i
35
35
  pip install pyALF
36
36
  ```
37
37
 
38
- For running ALF, you will additionaly need the [ALF prerequsites](https://git.physik.uni-wuerzburg.de/ALF/ALF#prerequisites).
38
+ For running ALF, you will additionaly need the [ALF prerequsites](https://github.com/ALF-QMC/ALF#prerequisites).
39
39
 
40
40
  Alternatively, one could use [this Docker image](https://hub.docker.com/r/alfcollaboration/jupyter-pyalf-full), which has ALF, pyALF and a Jupyter server pre-installed.
41
41
 
@@ -51,7 +51,7 @@ or a
51
51
  The following example shows how to install pyALF in development mode using venv.
52
52
 
53
53
  ```bash
54
- git clone https://git.physik.uni-wuerzburg.de/ALF/pyALF.git
54
+ git clone https://github.com/ALF-QMC/pyALF.git
55
55
  cd pyALF
56
56
  python -m venv .venv
57
57
  source .venv/bin/activate
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyALF
3
+ Version: 2.6.post35
4
+ Summary: Python interface for ALF, plus scripts and Jupyter notebooks.
5
+ Author-email: ALF Collaboration <alf@physik.uni-wuerzburg.de>, Jonas Schwab <jonas.schwab@uni-wuerzburg.de>
6
+ License-Expression: GPL-2.0-or-later
7
+ Project-URL: Documentation, https://alf.physik.uni-wuerzburg.de/pyalf-doc/
8
+ Project-URL: Repository, https://github.com/ALF-QMC/pyALF
9
+ Project-URL: Issues, https://github.com/ALF-QMC/pyALF/issues
10
+ Project-URL: ALF Homepage, https://alf.physik.uni-wuerzburg.de/
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.7
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: f90nml
17
+ Requires-Dist: h5py
18
+ Requires-Dist: ipympl
19
+ Requires-Dist: ipywidgets
20
+ Requires-Dist: matplotlib
21
+ Requires-Dist: numba
22
+ Requires-Dist: numpy
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scipy
25
+ Provides-Extra: gui
26
+ Requires-Dist: tkinter; extra == "gui"
27
+ Provides-Extra: doc
28
+ Requires-Dist: sphinxcontrib-svg2pdfconverter; extra == "doc"
29
+ Requires-Dist: jupyter-book<2.0; extra == "doc"
30
+ Requires-Dist: numpydoc; extra == "doc"
31
+ Requires-Dist: sphinx-argparse; extra == "doc"
32
+ Dynamic: license-file
33
+
34
+ [![Documentation](https://img.shields.io/badge/-Documentation-blue)](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF)
35
+ [<img src="https://img.shields.io/badge/Supported%20By-UNITARY%20FUND-brightgreen.svg?style=for-the-badge" alt="drawing" width="170"/>](https://unitary.fund)
36
+
37
+ ## pyALF
38
+
39
+ A Python package building on top of [ALF](https://github.com/ALF-QMC/ALF), meant to simplify the different steps of working with ALF, including:
40
+
41
+ * Obtaining and compiling the ALF source code
42
+ * Preparing and running simulations
43
+ * Postprocessing and displaying the data obtained during the simulation
44
+
45
+ It introduces:
46
+
47
+ * The Python module `py_alf`, exposing all the package's utility to Python.
48
+ * A set of command line tools in the folder, that make it easy to leverage pyALF from a Unix shell.
49
+ They are automatically exposed to the shell when pyALF is installed via pip.
50
+ Their source code can be found in [py_alf/cli](py_alf/cli) and documentation
51
+ [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF/source/reference/cli.html).
52
+ * Jupyter notebooks in the folder [Notebooks](Notebooks), serving as an easy introduction to QMC and ALF.
53
+ * Python Scripts in the folder [Scripts](Scripts) that can be run to reproduce benchmark results for established models.
54
+
55
+ The **documentation** can be found [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF).
56
+
57
+ ## Installation
58
+
59
+ ---
60
+ **⚠️ NOTE** In previous versions of pyALF, the installation instructions asked the users to set the environment variable `PYTHONPATH`.
61
+ This conflicts with the newer pip package, therefore you should remove definitions of this environment variable related to pyALF.
62
+
63
+ ---
64
+
65
+ pyALF can be installed via the Python package installer [pip](https://pip.pypa.io/en/stable/).
66
+
67
+ ```bash
68
+ pip install pyALF
69
+ ```
70
+
71
+ For running ALF, you will additionaly need the [ALF prerequsites](https://github.com/ALF-QMC/ALF#prerequisites).
72
+
73
+ Alternatively, one could use [this Docker image](https://hub.docker.com/r/alfcollaboration/jupyter-pyalf-full), which has ALF, pyALF and a Jupyter server pre-installed.
74
+
75
+ ### Development installation
76
+
77
+ If you want to develop pyALF, you can clone the repository and install it in
78
+ [development mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html),
79
+ which allows you to edit the files while using them like an installed package.
80
+ For this, it is highly recommended to use a dedicated Python environment using e.g.
81
+ [Python venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
82
+ or a
83
+ [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
84
+ The following example shows how to install pyALF in development mode using venv.
85
+
86
+ ```bash
87
+ git clone https://github.com/ALF-QMC/pyALF.git
88
+ cd pyALF
89
+ python -m venv .venv
90
+ source .venv/bin/activate
91
+
92
+ pip install --editable .
93
+ ```
94
+
95
+ ## Usage
96
+
97
+ There are multiple ways to use pyALF, which roughly breaks down into three approaches:
98
+ * Using Jupyter notebooks
99
+ * Using the command line interface
100
+ * Use the module `py_alf` in custom scripts
101
+
102
+ ### Jupyter notebooks
103
+
104
+ A convenient way to use pyALF is through Jupyter notebooks. They [are run](https://jupyter.readthedocs.io/en/latest/running.html) through a Jupyter server started, e.g., from the command line:
105
+
106
+ ```bash
107
+ jupyter-lab
108
+ ```
109
+
110
+ or
111
+
112
+ ```bash
113
+ jupyter-notebook
114
+ ```
115
+
116
+ which opens the "notebook dashboard" in your default browser, from where one can open the sample notebooks in [Notebooks/](Notebooks) and create new notebooks.
117
+
118
+ ### Command line interface
119
+
120
+ pyALF also delivers a set of command line scripts, to be use from a UNIX shell. For a full list of command line scripts see [here](https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF/source/reference/cli.html).
121
+
122
+ Try, e.g.
123
+
124
+ ```bash
125
+ alf_run -h
126
+ ```
127
+
128
+ The source code for the scripts can be found in the folder [py_alf/cli/](py_alf/cli).
129
+
130
+
131
+ ### Use module `py_alf` in custom scripts
132
+
133
+ Finally, one can also use the module module `py_alf` in custom Python scripts, which is analogous to the usage in Jupyter notebooks minus some interactivity.
134
+
135
+ ## License
136
+
137
+ The various works that make up the ALF project are placed under licenses that put
138
+ a strong emphasis on the attribution of the original authors and the sharing of the contained knowledge.
139
+ To that end we have placed the ALF source code under the GPL version 3 license (see license.GPL and license.additional)
140
+ and took the liberty as per GPLv3 section 7 to include additional terms that deal with the attribution
141
+ of the original authors(see license.additional).
142
+ The Documentation of the ALF project by the ALF contributors is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (see Documentation/license.CCBYSA)
143
+ We mention that we link against parts of lapack which licensed under a BSD license(see license.BSD).
@@ -40,13 +40,13 @@ class ALF_source:
40
40
  to './ALF'.
41
41
  branch : str, optional
42
42
  If specified, this will be checked out by git.
43
- url : str, default='https://git.physik.uni-wuerzburg.de/ALF/ALF.git'
43
+ url : str, default='https://github.com/ALF-QMC/ALF.git'
44
44
  Address from where to clone ALF if alf_dir does not exist.
45
45
 
46
46
  """
47
47
 
48
48
  def __init__(self, alf_dir=None, branch=None,
49
- url='https://git.physik.uni-wuerzburg.de/ALF/ALF.git'):
49
+ url='https://github.com/ALF-QMC/ALF.git'):
50
50
  if alf_dir is None:
51
51
  alf_dir = os.getenv('ALF_DIR', './ALF')
52
52
  self.alf_dir = os.path.abspath(os.path.expanduser(alf_dir))
@@ -39,7 +39,7 @@ def _get_bins(directory, names, custom_obs):
39
39
 
40
40
  dtype, shape = custom_obs_get_dtype_shape(obs_spec, bins_raw)
41
41
  del dtype
42
- size = np.prod(shape)
42
+ size = 1 if not shape else np.prod(shape)
43
43
  bins = np.empty((N_bins, size))
44
44
 
45
45
  for i in range(N_bins):
@@ -15,7 +15,7 @@ from py_alf import ALF_source, Simulation
15
15
 
16
16
  def _main():
17
17
  # Create an instance of ALF_source, downloading the ALF source code from
18
- # https://git.physik.uni-wuerzburg.de/ALF/ALF, if ALF diretory does not exist.
18
+ # https://github.com/ALF-QMC/ALF, if ALF diretory does not exist.
19
19
  # Gets ALF diretory from environment variable $ALF_DIR, or defaults to "./ALF",
20
20
  # if not present.
21
21
  alf_src = ALF_source()
@@ -6,6 +6,8 @@ __author__ = "Jonas Schwab"
6
6
  __copyright__ = "Copyright 2020-2022, The ALF Project"
7
7
  __license__ = "GPL"
8
8
 
9
+ import hashlib
10
+ import json
9
11
  import os
10
12
  import re
11
13
  import shutil
@@ -44,11 +46,18 @@ class Simulation:
44
46
  ham_name : str
45
47
  Name of the Hamiltonian.
46
48
  sim_dict : dict or list of dicts
47
- Dictionary specfying parameters owerwriting defaults.
49
+ Dictionary specifying parameters overwriting defaults.
48
50
  Can be a list of dictionaries to enable parallel tempering.
49
51
  sim_dir : path-like object, optional
50
52
  Directory in which the Monte Carlo will be run.
51
53
  If not specified, sim_dir is generated from sim_dict.
54
+ sim_dir_hash : bool, default=False
55
+ Whether to use a hash of the parameters for the directory name.
56
+ This is an experimental feature to get shorter directory names
57
+ that take into account all simulation parameters except for
58
+ Nbin and CPU_MAX. It is not fully supported and may lead to
59
+ issues with reproducibility if parameters are changed without
60
+ changing the directory name. Use with caution.
52
61
  sim_root : path-like object, default="ALF_data"
53
62
  Directory to prepend to sim_dir.
54
63
  mpi : bool, default=False
@@ -90,10 +99,18 @@ class Simulation:
90
99
  self.alf_src = alf_src
91
100
  self.ham_name = ham_name
92
101
  self.sim_dict = sim_dict
102
+ sim_root = kwargs.pop("sim_root", "ALF_data")
103
+ sim_dir_hash = kwargs.pop("sim_dir_hash", False)
104
+ explicit_sim_dir = kwargs.pop("sim_dir", None)
105
+ if explicit_sim_dir is not None:
106
+ # Explicitly provided sim_dir takes precedence over hash-based naming
107
+ dir_component = explicit_sim_dir
108
+ elif sim_dir_hash:
109
+ dir_component = directory_name_hash(alf_src, ham_name, sim_dict)
110
+ else:
111
+ dir_component = directory_name(alf_src, ham_name, sim_dict)
93
112
  self.sim_dir = os.path.abspath(os.path.expanduser(os.path.join(
94
- kwargs.pop("sim_root", "ALF_data"),
95
- kwargs.pop("sim_dir",
96
- directory_name(alf_src, ham_name, sim_dict)))))
113
+ sim_root, dir_component)))
97
114
  self.mpi = kwargs.pop("mpi", False)
98
115
  self.parallel_params = kwargs.pop("parallel_params", False)
99
116
  self.n_mpi = kwargs.pop("n_mpi", 2)
@@ -408,6 +425,47 @@ def directory_name(alf_src, ham_name, sim_dict):
408
425
  return dirname[:-1]
409
426
 
410
427
 
428
+ def get_hashable_parameters(parameters):
429
+ """Build a deterministic, JSON-serializable subset of parameters for hashing.
430
+
431
+ This helper removes non-essential or run-dependent fields (such as post-
432
+ processing namespaces and certain QMC controls) and keeps only the raw
433
+ parameter values. The returned nested dictionary is intended to be
434
+ serialized (for example with ``json.dumps``) and then hashed; this
435
+ function itself does not perform any serialization or hashing.
436
+ """
437
+ # Use only the parameter values for hashing.
438
+ parameters_hashable = {}
439
+ for namespace in parameters:
440
+ if namespace in ['VAR_errors', 'VAR_Max_Stoch']:
441
+ # Exclude postprocessing parameters from hash.
442
+ continue
443
+ parameters_hashable[namespace] = {}
444
+ for var in parameters[namespace]:
445
+ if namespace == 'VAR_QMC' and var in ['Nbin', 'CPU_MAX']:
446
+ # Exclude Nbin and CPU_MAX from hash.
447
+ continue
448
+ parameters_hashable[namespace][var] = parameters[namespace][var]['value']
449
+ return parameters_hashable
450
+
451
+
452
+ def directory_name_hash(alf_src, ham_name, sim_dict):
453
+ """Return name of directory for simulations, given a set of simulation
454
+ parameters. The name is a hash of the parameters, so that it is short
455
+ and does not contain any special characters."""
456
+ if isinstance(sim_dict, list):
457
+ # For tempering / parallel parameters, incorporate all parameter sets
458
+ to_hash = [
459
+ get_hashable_parameters(
460
+ set_param(alf_src, ham_name, sim_dict_single))
461
+ for sim_dict_single in sim_dict
462
+ ]
463
+ else:
464
+ to_hash = get_hashable_parameters(set_param(alf_src, ham_name, sim_dict))
465
+ dump = json.dumps(to_hash, sort_keys=True, separators=(",", ":"))
466
+ return hashlib.sha1(dump.encode("utf-8")).hexdigest()[:15]
467
+
468
+
411
469
  def _update_var(params, var, value):
412
470
  """Try to update value of parameter called var in params."""
413
471
  for name in params:
@@ -466,7 +524,7 @@ def getenv(config, alf_dir='.'):
466
524
  def compile_alf(alf_dir=None,
467
525
  branch=None,
468
526
  config='GNU noMPI',
469
- url='https://git.physik.uni-wuerzburg.de/ALF/ALF.git',
527
+ url='https://github.com/ALF-QMC/ALF.git',
470
528
  verbosity=0
471
529
  ):
472
530
  """Compile ALF. Clone a new repository if alf_dir does not exist.
@@ -482,7 +540,7 @@ def compile_alf(alf_dir=None,
482
540
  If specified, this will be checked out by git.
483
541
  config : str, default='GNU noMPI'
484
542
  Arguments for `configure.sh`.
485
- url : str, default='https://git.physik.uni-wuerzburg.de/ALF/ALF.git'
543
+ url : str, default='https://github.com/ALF-QMC/ALF.git'
486
544
  Address from where to clone ALF if alf_dir not exists.
487
545
  verbosity : int, default=0
488
546
  0: Don't echo make reciepes.
@@ -17,12 +17,12 @@ authors = [
17
17
  { name="Jonas Schwab", email="jonas.schwab@uni-wuerzburg.de" },
18
18
  ]
19
19
  description = "Python interface for ALF, plus scripts and Jupyter notebooks."
20
- license = {file = "LICENSE"}
20
+ license = "GPL-2.0-or-later"
21
+ license-files = ['LICENSE']
21
22
  readme = "README.md"
22
23
  requires-python = ">=3.7"
23
24
  classifiers = [
24
25
  "Programming Language :: Python :: 3",
25
- "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
26
26
  "Operating System :: OS Independent",
27
27
  ]
28
28
  dependencies = [
@@ -50,9 +50,9 @@ doc = [
50
50
  include = ["py_alf", "py_alf.cli"]
51
51
 
52
52
  [project.urls]
53
- Documentation = "https://gitpages.physik.uni-wuerzburg.de/ALF/pyALF"
54
- Repository = "https://git.physik.uni-wuerzburg.de/ALF/pyALF"
55
- Issues = "https://git.physik.uni-wuerzburg.de/ALF/pyALF/-/issues"
53
+ Documentation = "https://alf.physik.uni-wuerzburg.de/pyalf-doc/"
54
+ Repository = "https://github.com/ALF-QMC/pyALF"
55
+ Issues = "https://github.com/ALF-QMC/pyALF/issues"
56
56
  "ALF Homepage" = "https://alf.physik.uni-wuerzburg.de/"
57
57
 
58
58
  [project.scripts]