Skip to content

Commit dde2ce2

Browse files
committed
Merge branch 'dev' into feature/toml-config
2 parents 01bcc94 + 7b4f221 commit dde2ce2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2176
-958
lines changed

.github/workflows/citation.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Citation File Validation
2+
3+
on:
4+
push:
5+
branches: [ "main", "dev", "hotfix/update-ci" ]
6+
pull_request:
7+
branches: [ "main", "dev", "hotfix/update-ci" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v3
20+
- name: Install Checker
21+
run: python3 -m pip install cffconvert
22+
- name: Check Citation File
23+
run: cffconvert --validate

.github/workflows/test_client_macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
build:
14-
timeout-minutes: 20
14+
timeout-minutes: 30
1515
runs-on: macos-latest
1616
steps:
1717
- uses: actions/checkout@v3
@@ -28,4 +28,4 @@ jobs:
2828
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
2929
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
3030
poetry install --all-extras
31-
poetry run pytest tests/unit/ tests/refactor/
31+
poetry run pytest tests/unit/ tests/refactor/ -m 'not scenario'

.github/workflows/test_client_ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
build:
1717

1818
runs-on: ubuntu-latest
19-
timeout-minutes: 20
19+
timeout-minutes: 30
2020
steps:
2121
- uses: actions/checkout@v3
2222
- name: Set up Python 3.12
@@ -30,7 +30,7 @@ jobs:
3030
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
3131
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
3232
poetry install --all-extras
33-
poetry run pytest --cov --cov-report=xml tests/unit/ tests/refactor/
33+
poetry run pytest --cov --cov-report=xml tests/unit/ tests/refactor/ -m 'not scenario'
3434
- name: Upload coverage reports to Codecov
3535
run: |
3636
curl -Os https://uploader.codecov.io/latest/linux/codecov

.github/workflows/test_client_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
build:
1414
runs-on: windows-latest
15-
timeout-minutes: 20
15+
timeout-minutes: 30
1616
steps:
1717
- uses: actions/checkout@v3
1818
- name: Set up Python 3.12
@@ -29,4 +29,4 @@ jobs:
2929
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
3030
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
3131
poetry install --all-extras
32-
poetry run pytest tests/unit/ tests/refactor/
32+
poetry run pytest tests/unit/ tests/refactor/ -m 'not scenario'

.github/workflows/test_multiple_python.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ name: Simvue Client (Python Versions)
55

66
on:
77
push:
8-
branches: [ "main", "dev", "hotfix/update-ci" ]
9-
pull_request:
10-
branches: [ "main", "dev", "hotfix/update-ci" ]
8+
tags:
9+
- 'v*-*-rc*'
1110

1211
permissions:
1312
contents: read
1413

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
18-
timeout-minutes: 20
17+
timeout-minutes: 30
1918
strategy:
2019
matrix:
2120
python-version: ['3.9', '3.10', '3.11']
@@ -32,4 +31,4 @@ jobs:
3231
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
3332
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
3433
poetry install --all-extras
35-
poetry run pytest --cov --cov-report=xml tests/unit/ tests/refactor/
34+
poetry run pytest tests/unit/ tests/refactor/ -m 'not scenario'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
args: [--branch, main, --branch, dev]
2424
- id: check-added-large-files
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.4.4
26+
rev: v0.4.7
2727
hooks:
2828
- id: ruff
2929
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]

CHANGELOG.md

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,130 @@
11
# Change log
22

3-
## v0.15.0
3+
## Unreleased
44

5-
* Support v2 server.
5+
* Refactor and re-write of codebase to align with latest developments in version 2 of the Simvue server.
6+
* Added `Executor` to Simvue runs allowing users to start shell based processes as part of a run and handle termination of these.
7+
* Removal of obsolete functions due to server change, and renaming of functions and parameters (see [documentation](https://docs.simvue.io)).
8+
* Added pre-request validation to both `Client` and `Run` class methods via Pydantic.
9+
* Separation of save functionality into `save_file` and `save_object`.
10+
* Fixed issue whereby metrics would still have to wait for the next iteration of dispatch before being sent to the server, even if the queue was not full.
11+
* Added support for `'user'` alerts.
612

7-
## v0.14.3
13+
## [v0.14.3](https://github.com/simvue-io/client/releases/tag/v0.14.3) - 2023-06-29
814

915
* Ensure import of the `requests` module is only done if actually used.
1016

11-
## v0.14.0
17+
## [v0.14.0](https://github.com/simvue-io/client/releases/tag/v0.14.0) - 2023-04-04
1218

1319
* Added a method to the `Client` class for retrieving events.
1420

15-
## v0.13.3
21+
## [v0.13.3](https://github.com/simvue-io/client/releases/tag/v0.13.3) - 2023-04-04
1622

1723
* Allow files (`input` and `code` only) to be saved for runs in the `created` state.
1824
* Allow metadata and tags to be updated for runs in the `created` state.
1925

20-
## v0.13.2
26+
## [v0.13.2](https://github.com/simvue-io/client/releases/tag/v0.13.2) - 2023-04-04
2127

2228
* Added `plot_metrics` method to the `Client` class to simplify plotting metrics.
2329
* (Bug fix) `reconnect` works without a uuid being specified when `offline` mode isn't being used.
2430
* (Bug fix) Restrict version of Pydantic to prevent V2 from accidently being used.
2531

26-
## v0.13.1
32+
## [v0.13.1](https://github.com/simvue-io/client/releases/tag/v0.13.1) - 2023-03-28
2733

2834
* Set `sample_by` to 0 by default (no sampling) in `get_metrics_multiple`.
2935

30-
## v0.13.0
36+
## [v0.13.0](https://github.com/simvue-io/client/releases/tag/v0.13.0) - 2023-03-28
3137

3238
* Added methods to the `Client` class for retrieving metrics.
3339
* CPU architecture and processor obtained on Apple hardware.
3440
* Client now reports to server when files have been successfully uploaded.
3541
* `User-Agent` header now included in HTTP requests.
3642

37-
## v0.12.0
43+
## [v0.12.0](https://github.com/simvue-io/client/releases/tag/v0.12.0) - 2023-03-13
3844

3945
* Add methods to the `Client` class for deleting runs and folders.
4046
* Confusing messages about `process no longer exists` or `NVML Shared Library Not Found` no longer displayed.
4147

42-
## v0.11.4
48+
## [v0.11.4](https://github.com/simvue-io/client/releases/tag/v0.11.4) - 2023-03-13
4349

4450
* (Bug fix) Ensure `simvue_sender` can be run when installed from PyPI.
4551
* (Bug fix) Runs created in `offline` mode using a context manager weren't automatically closed.
4652

47-
## v0.11.3
53+
## [v0.11.3](https://github.com/simvue-io/client/releases/tag/v0.11.3) - 2023-03-07
4854

4955
* Added logging messages for debugging when debug level set to `debug`.
5056

51-
## v0.11.2
52-
57+
## [v0.11.2](https://github.com/simvue-io/client/releases/tag/v0.11.2) - 2023-03-06
5358
* Raise exceptions in `Client` class methods if run does not exist or artifact does not exist.
5459
* (Bug fix) `list_artifacts` optional category restriction now works.
5560

56-
## v0.11.1
61+
## [v0.11.1](https://github.com/simvue-io/client/releases/tag/v0.11.1) - 2023-03-05
5762

5863
* Support different runs having different metadata in `get_runs` dataframe output.
5964
* (Bug fix) Error message when creating a duplicate run is now more clear.
6065
* (Bug fix) Correction to stopping the worker thread in situations where the run never started.
6166

62-
## v0.11.0
67+
## [v0.11.0](https://github.com/simvue-io/client/releases/tag/v0.11.0) - 2023-03-04
6368

6469
* Support optional dataframe output from `get_runs`.
6570

66-
## v0.10.1
71+
## [v0.10.1](https://github.com/simvue-io/client/releases/tag/v0.10.1) - 2023-03-03
6772

6873
* The worker process now no longer gives a long delay when a run has finished (now at most ~1 second).
6974
* The worker process ends when the `Run()` context ends or `close` is called, rather than only when the main process exits.
7075

71-
## v0.10.0
76+
## [v0.10.0](https://github.com/simvue-io/client/releases/tag/v0.10.0) - 2023-02-07
7277

7378
* The `client` class can now be used to retrieve runs.
7479

75-
## v0.9.1
80+
## [v0.9.1](https://github.com/simvue-io/client/releases/tag/v0.9.1) - 2023-01-25
7681

7782
* (Bug fix) Retries in POST/PUTs to REST APIs didn't happen.
7883
* Warn users if `allow_pickle=True` is required.
7984

80-
## v0.9.0
85+
## [v0.9.0](https://github.com/simvue-io/client/releases/tag/v0.9.0) - 2023-01-25
8186

8287
* Set status to `failed` or `terminated` if the context manager is used and there is an exception.
8388

84-
## v0.8.0
89+
## [v0.8.0](https://github.com/simvue-io/client/releases/tag/v0.8.0) - 2023-01-23
8590

8691
* Support NumPy arrays, PyTorch tensors, Matplotlib and Plotly plots and picklable Python objects as artifacts.
8792
* (Bug fix) Events in offline mode didn't work.
8893

89-
## v0.7.2
94+
## [v0.7.2](https://github.com/simvue-io/client/releases/tag/v0.7.2) - 2023-01-08
9095

9196
* Pydantic model is used for input validation.
9297
* Support NaN, -inf and inf in metadata and metrics.
9398

94-
## v0.7.0
99+
## [v0.7.0](https://github.com/simvue-io/client/releases/tag/v0.7.0) - 2022-12-05
95100

96101
* Collect CPU, GPU and memory resource metrics.
97102
* Automatically delete temporary files used in offline mode once runs have entered a terminal state.
98103
* Warn users if their access token has expired.
99104
* Remove dependency on the randomname module, instead handle name generation server side.
100105

101-
## v0.6.0
106+
## [v0.6.0](https://github.com/simvue-io/client/releases/tag/v0.6.0) - 2022-11-07
102107

103108
* `offline` and `disabled` options replaced with single `mode` flag.
104109

105-
## v0.5.0
110+
## [v0.5.0](https://github.com/simvue-io/client/releases/tag/v0.5.0) - 2022-11-03
106111

107112
* Added option to disable all monitoring.
108113

109-
## v0.4.0
114+
## [v0.4.0](https://github.com/simvue-io/client/releases/tag/v0.4.0) - 2022-11-03
110115

111116
* Offline mode added, enabling tracking of simulations running on worker nodes without outgoing network access.
112117
* Argument to `init` enabling runs to be left in the `created` state changed from `status="created"` to `running=True`.
113118
* Improvements to error handling.
114119

115-
## v0.3.0
120+
## [v0.3.0](https://github.com/simvue-io/client/releases/tag/v0.3.0) - 2022-10-31
116121

117122
* Update `add_alert` method to support either metrics or events based alerts.
118123

119-
## v0.2.0
124+
## [v0.2.0](https://github.com/simvue-io/client/releases/tag/v0.2.0) - 2022-10-26
120125

121126
* The previous `Simvue` class has been split into `Run` and `Client`. When creating a run use the new `Run` class rather than `Simvue`.
122127

123-
## v0.1.0
128+
## [v0.1.0](https://github.com/simvue-io/client/releases/tag/v0.1.0) - 2022-10-25
124129

125130
* First release.

CITATION.cff

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This CITATION.cff file was generated with cffinit.
2+
# Visit https://bit.ly/cffinit to generate yours today!
3+
4+
cff-version: 1.2.0
5+
title: Simvue
6+
message: >-
7+
If you use this software, please cite it using the
8+
metadata from this file.
9+
type: software
10+
authors:
11+
- given-names: Andrew
12+
family-names: Lahiff
13+
affiliation: United Kingdom Atomic Energy Authority
14+
orcid: 'https://orcid.org/0000-0002-2785-4116'
15+
- given-names: Aby
16+
family-names: Abraham
17+
affiliation: United Kingdom Atomic Energy Authority
18+
- given-names: Vignesh
19+
family-names: Gopakumar
20+
orcid: 'https://orcid.org/0000-0002-6773-1049'
21+
affiliation: United Kingdom Atomic Energy Authority
22+
- given-names: Kristian
23+
family-names: Zarebski
24+
affiliation: United Kingdom Atomic Energy Authority
25+
orcid: 'https://orcid.org/0000-0002-6773-1049'
26+
- given-names: Matthew
27+
family-names: Field
28+
affiliation: United Kingdom Atomic Energy Authority
29+
- given-names: James
30+
family-names: Panayis
31+
affiliation: United Kingdom Atomic Energy Authority
32+
repository-code: 'https://github.com/simvue-io/client'
33+
url: 'https://simvue.io/'
34+
abstract: >-
35+
Simvue allows users to organise and gain insights in simulations,
36+
processing tasks and AI/ML training by capturing metadata and
37+
data combined with real-time monitoring, logging and alerting.
38+
keywords:
39+
- tracking
40+
- monitoring
41+
- metrics
42+
- alerting
43+
- simulation
44+
license: Apache-2.0

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ if __name__ == "__main__":
6969
description='This is part 1 of a test') # Description
7070

7171
# Upload the code
72-
run.save('training.py', 'code')
72+
run.save_file('training.py', 'code')
7373

7474
# Upload an input file
75-
run.save('params.in', 'input')
75+
run.save_file('params.in', 'input')
7676

7777
# Add an alert (the alert definition will be created if necessary)
78-
run.add_alert(name='loss-too-high', # Name
78+
run.create_alert(name='loss-too-high', # Name
7979
source='metrics', # Source
8080
rule='is above', # Rule
8181
metric='loss', # Metric
@@ -91,12 +91,12 @@ if __name__ == "__main__":
9191
...
9292

9393
# Send metrics inside main application loop
94-
run.log({'loss': 0.5, 'density': 34.4})
94+
run.log_metrics({'loss': 0.5, 'density': 34.4})
9595

9696
...
9797

9898
# Upload an output file
99-
run.save('output.cdf', 'output')
99+
run.save_file('output.cdf', 'output')
100100

101101
# If we weren't using a context manager we'd need to end the run
102102
# run.close()

examples/GeometryOptimisation/bluemira_simvue_geometry_optimisation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,5 @@ def my_minimise_length(vector, grad, parameterisation, ad_args=None):
171171

172172
# Here we're minimising the length, within the bounds of our PrincetonD parameterisation,
173173
# so we'd expect that x1 goes to its upper bound, and x2 goes to its lower bound.
174-
run.save("bluemira_simvue_geometry_optimisation.py", "code")
174+
run.save_file("bluemira_simvue_geometry_optimisation.py", "code")
175175
run.close()

0 commit comments

Comments
 (0)