Skip to content

Commit 01bcc94

Browse files
committed
Merge branch 'dev' into feature/toml-config
2 parents 3797d09 + e37a58b commit 01bcc94

37 files changed

+1490
-688
lines changed

.github/workflows/test_client_macos.yml

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

1212
jobs:
1313
build:
14-
timeout-minutes: 10
14+
timeout-minutes: 20
1515
runs-on: macos-latest
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Set up Python 3.11
18+
- name: Set up Python 3.12
1919
uses: actions/setup-python@v3
2020
with:
21-
python-version: "3.11"
21+
python-version: "3.12"
2222
- name: Install dependencies
2323
run: |
2424
rm poetry.lock

.github/workflows/test_client_ubuntu.yml

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

1818
runs-on: ubuntu-latest
19-
timeout-minutes: 10
19+
timeout-minutes: 20
2020
steps:
2121
- uses: actions/checkout@v3
22-
- name: Set up Python 3.11
22+
- name: Set up Python 3.12
2323
uses: actions/setup-python@v3
2424
with:
25-
python-version: "3.11"
25+
python-version: "3.12"
2626
- name: Install dependencies
2727
run: python -m pip install poetry
2828
- name: Test with pytest

.github/workflows/test_client_windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ permissions:
1212
jobs:
1313
build:
1414
runs-on: windows-latest
15-
timeout-minutes: 10
15+
timeout-minutes: 20
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Set up Python 3.11
18+
- name: Set up Python 3.12
1919
uses: actions/setup-python@v3
2020
with:
21-
python-version: "3.11"
21+
python-version: "3.12"
2222
- name: Install dependencies
2323
run: |
2424
rm poetry.lock
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Simvue Client (Python Versions)
5+
6+
on:
7+
push:
8+
branches: [ "main", "dev", "hotfix/update-ci" ]
9+
pull_request:
10+
branches: [ "main", "dev", "hotfix/update-ci" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
strategy:
20+
matrix:
21+
python-version: ['3.9', '3.10', '3.11']
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: "${{ matrix.python-version }}"
28+
- name: Install dependencies
29+
run: python -m pip install poetry
30+
- name: Test with pytest
31+
run: |
32+
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
33+
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
34+
poetry install --all-extras
35+
poetry run pytest --cov --cov-report=xml tests/unit/ tests/refactor/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ dmypy.json
135135
# Simvue files
136136
simvue.ini
137137
simvue.toml
138+
offline/
138139

139140
# Pyenv
140141
.python-version

.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.2
26+
rev: v0.4.4
2727
hooks:
2828
- id: ruff
2929
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Collect metadata, metrics and artifacts from simulations, processing and AI/ML t
1212

1313
<div align="center">
1414
<a href="https://github.com/simvue-io/client/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/github/license/simvue-io/client"/></a>
15+
<img src="https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue">
1516
<a href="https://pypi.org/project/simvue/" target="_blank"><img src="https://img.shields.io/pypi/v/simvue.svg"/></a>
1617
<a href="https://pepy.tech/project/simvue"><img src="https://static.pepy.tech/badge/simvue"/></a>
1718
<p></p>

poetry.lock

Lines changed: 199 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ description = "Simulation tracking and monitoring"
55
authors = ["Simvue Development Team <[email protected]>"]
66
license = "Apache v2"
77
readme = "README.md"
8+
classifiers = [
9+
"Development Status :: 5 - Production/Stable",
10+
"Intended Audience :: Science/Research",
11+
"License :: OSI Approved :: Apache Software License",
12+
"Natural Language :: English",
13+
"Operating System :: Unix",
14+
"Operating System :: Microsoft :: Windows",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Topic :: Scientific/Engineering",
20+
"Topic :: System :: Monitoring",
21+
"Topic :: Utilities",
22+
"Typing :: Typed"
23+
]
24+
25+
keywords = [
26+
"tracking",
27+
"monitoring",
28+
"metrics",
29+
"alerting",
30+
"metrics-gathering"
31+
]
832

933
[tool.poetry.dependencies]
1034
python = "^3.9"
@@ -19,8 +43,11 @@ pandas = {version = "^2.2.0", optional = true}
1943
plotly = {version = "^5.18.0", optional = true}
2044
numpy = {version = "^1.26.3", optional = true}
2145
matplotlib = {version = "^3.8.2", optional = true}
46+
typing_extensions = { version = "^4.11.0", python = "<3.10" }
2247
toml = "^0.10.2"
2348
click = "^8.1.7"
49+
humanfriendly = "^10.0"
50+
tabulate = "^0.9.0"
2451

2552
[tool.poetry.extras]
2653
dataset = ["pandas", "numpy"]

simvue/client.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,12 @@ def get_runs(
258258
alerts: bool = False,
259259
metadata: bool = False,
260260
format: typing.Literal["dict", "dataframe"] = "dict",
261+
count: int = 100,
262+
start_index: int = 0,
261263
) -> typing.Union[
262264
"DataFrame", list[dict[str, typing.Union[int, str, float, None]]], None
263265
]:
264-
"""Retrieve all runs matching filters
266+
"""Retrieve all runs matching filters.
265267
266268
Parameters
267269
----------
@@ -280,6 +282,10 @@ def get_runs(
280282
format : str ('dict' | 'dataframe'), optional
281283
the structure of the response, either a dictionary or a dataframe.
282284
Default is 'dict'. Pandas must be installed for 'dataframe'.
285+
count : int, optional
286+
maximum number of entries to return. Default is 100.
287+
start_index : int, optional
288+
the index from which to count entries. Default is 0.
283289
284290
Returns
285291
-------
@@ -301,6 +307,8 @@ def get_runs(
301307
"return_alerts": alerts,
302308
"return_system": system,
303309
"return_metadata": metadata,
310+
"count": count,
311+
"start": start_index,
304312
}
305313

306314
response = requests.get(
@@ -778,14 +786,21 @@ def get_folder(self, folder_id: str) -> typing.Optional[dict[str, typing.Any]]:
778786
return _folders[0]
779787

780788
def get_folders(
781-
self, filters: typing.Optional[list[str]] = None
789+
self,
790+
filters: typing.Optional[list[str]] = None,
791+
count: int = 100,
792+
start_index: int = 0,
782793
) -> list[dict[str, typing.Any]]:
783794
"""Retrieve folders from the server
784795
785796
Parameters
786797
----------
787798
filters : list[str] | None
788799
set of filters to apply to the search
800+
count : int, optional
801+
maximum number of entries to return. Default is 100.
802+
start_index : int, optional
803+
the index from which to count entries. Default is 0.
789804
790805
Returns
791806
-------
@@ -797,7 +812,11 @@ def get_folders(
797812
RuntimeError
798813
if there was a failure retrieving data from the server
799814
"""
800-
params: dict[str, str] = {"filters": json.dumps(filters or [])}
815+
params: dict[str, typing.Union[str, int]] = {
816+
"filters": json.dumps(filters or []),
817+
"count": count,
818+
"start": start_index,
819+
}
801820

802821
response: requests.Response = requests.get(
803822
f"{self._url}/api/folders", headers=self._headers, params=params
@@ -873,7 +892,7 @@ def _get_run_metrics_from_server(
873892
"xaxis": xaxis,
874893
"max_points": max_points,
875894
}
876-
print(params)
895+
877896
metrics_response: requests.Response = requests.get(
878897
f"{self._url}/api/metrics", headers=self._headers, params=params
879898
)
@@ -1105,7 +1124,7 @@ def get_events(
11051124
"""
11061125

11071126
msg_filter: str = (
1108-
json.dumps([{"operator": "contains", "value": message_contains}])
1127+
json.dumps([f"event.message contains {message_contains}"])
11091128
if message_contains
11101129
else ""
11111130
)

0 commit comments

Comments
 (0)