Skip to content

Commit b1114fb

Browse files
authored
Merge pull request #63 from MiraGeoscience/hotfix/0.1.8
GEOPY-1651: merge hotfix/0.1.8 to main 🚧
2 parents 0b67ffb + bace9ba commit b1114fb

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

README.md renamed to README.rst

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
# Param-sweeps
1+
Param-sweeps
2+
============
23

34
A Parameter sweeper for applications driven by ui.json files
45

56
This package contains two main modules. One is for generating sweep
67
files, and the other is to run a sweep over some number of parameters
78
in a driver application.
89

9-
### Basic Usage
10+
11+
Basic Usage
12+
^^^^^^^^^^^
1013

1114
To generate a sweep file from a ui.json file for an existing
12-
application, use the following command:
15+
application, use the following command::
1316

14-
```bash
15-
python -m param_sweeps.generate some_file.ui.json
16-
```
17+
$ python -m param_sweeps.generate some_file.ui.json
1718

1819
This will create a new `some_file_sweep.ui.json` file that may be run
19-
with:
20+
with::
2021

21-
```bash
22-
python -m param_sweeps.driver some_file_sweep.ui.json
23-
```
22+
$ python -m param_sweeps.driver some_file_sweep.ui.json
2423

2524
By default, this would execute a single run of the original parameters.
2625
To design a sweep, simply drag the `some_file_sweep.ui.json` file into
27-
the [Geoscience ANALYST Pro](https://mirageoscience.com/mining-industry-software/geoscience-analyst-pro/)
26+
`Geoscience ANALYST Pro <https://mirageoscience.com/mining-industry-software/geoscience-analyst-pro/>`_.
2827
session that produced the original file and select start, end, and number
2928
of samples values for parameters that you would like to sweep.
3029

@@ -33,6 +32,7 @@ To organize the output, param-sweeps uses a `UUID` file naming scheme, with
3332
a `lookup.json` file to map individual parameter sets back to their respective
3433
files.
3534

35+
3636
License
3737
^^^^^^^
3838
MIT License
@@ -60,10 +60,15 @@ SOFTWARE.
6060

6161
Third Party Software
6262
^^^^^^^^^^^^^^^^^^^^
63-
The param-sweeps Software may provide links to third party libraries or code (collectively Third Party Software)
63+
The param-sweeps Software may provide links to third party libraries or code (collectively "Third Party Software")
6464
to implement various functions. Third Party Software does not comprise part of the Software.
6565
The use of Third Party Software is governed by the terms of such software license(s).
6666
Third Party Software notices and/or additional terms and conditions are located in the
6767
`THIRD_PARTY_SOFTWARE.rst`_ file.
6868

6969
.. _THIRD_PARTY_SOFTWARE.rst: THIRD_PARTY_SOFTWARE.rst
70+
71+
72+
Copyright
73+
^^^^^^^^^
74+
Copyright (c) 2024 Mira Geoscience Ltd.

param_sweeps/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# (see LICENSE file at the root of this source code package).
77

88

9-
__version__ = "0.1.7"
9+
__version__ = "0.1.8"

param_sweeps/generate.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def generate(
3333
file_path = Path(worker).resolve(strict=True)
3434
ifile = InputFile.read_ui_json(file_path)
3535
sweepfile = InputFile(ui_json=deepcopy(default_ui_json), validate=False)
36+
37+
if sweepfile.data is None or sweepfile.ui_json is None:
38+
raise ValueError("Sweep file data is empty.")
39+
3640
sweepfile.data.update({"worker_uijson": str(worker)})
3741
if update_values:
3842
sweepfile.data.update(**update_values)
@@ -47,10 +51,8 @@ def generate(
4751

4852
sweepfile.data["geoh5"] = ifile.data["geoh5"]
4953
dirpath = file_path.parent
50-
filename = file_path.name
51-
filename = filename.rstrip("ui.json")
54+
filename = file_path.name.removesuffix(".ui.json")
5255
filename = re.sub(r"\._sweep$", "", filename)
53-
# filename = filename.rstrip("_sweep")
5456
filename = f"{filename}_sweep.ui.json"
5557

5658
print(f"Writing sweep file to: {dirpath / filename}")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "param-sweeps"
3-
version = "0.1.7"
3+
version = "0.1.8"
44

55
description = "Parameter sweeper for ui.json powered applications"
66
license = "MIT"
@@ -10,7 +10,7 @@ repository = "https://github.com/MiraGeoscience/param-sweeps"
1010
#documentatio = "https://mirageoscience-param-sweeps.readthedocs-hosted.com/"
1111
homepage = "https://www.mirageoscience.com/mining-industry-software/python-integration/"
1212

13-
readme = "README.md"
13+
readme = "README.rst"
1414
keywords = ["geology", "geophysics", "earth sciences"]
1515
classifiers = [
1616
"Development Status :: 4 - Beta",

0 commit comments

Comments
 (0)