tirex-mirror 2025.9.10__tar.gz → 2025.10.1__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 (33) hide show
  1. {tirex_mirror-2025.9.10/src/tirex_mirror.egg-info → tirex_mirror-2025.10.1}/PKG-INFO +3 -3
  2. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/pyproject.toml +3 -3
  3. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1/src/tirex_mirror.egg-info}/PKG-INFO +3 -3
  4. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex_mirror.egg-info/requires.txt +2 -2
  5. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/tests/test_chronos_zs.py +24 -16
  6. tirex_mirror-2025.10.1/tests/test_forecast.py +48 -0
  7. tirex_mirror-2025.9.10/tests/test_forecast.py +0 -37
  8. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/LICENSE +0 -0
  9. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/LICENSE_MIRROR.txt +0 -0
  10. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/MANIFEST.in +0 -0
  11. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/NOTICE.txt +0 -0
  12. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/README.md +0 -0
  13. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/setup.cfg +0 -0
  14. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/__init__.py +0 -0
  15. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/api_adapter/__init__.py +0 -0
  16. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/api_adapter/forecast.py +0 -0
  17. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/api_adapter/gluon.py +0 -0
  18. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/api_adapter/hf_data.py +0 -0
  19. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/api_adapter/standard_adapter.py +0 -0
  20. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/base.py +0 -0
  21. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/__init__.py +0 -0
  22. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/patcher.py +0 -0
  23. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/slstm/block.py +0 -0
  24. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/slstm/cell.py +0 -0
  25. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/slstm/layer.py +0 -0
  26. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/models/tirex.py +0 -0
  27. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex/util.py +0 -0
  28. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex_mirror.egg-info/SOURCES.txt +0 -0
  29. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex_mirror.egg-info/dependency_links.txt +0 -0
  30. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/src/tirex_mirror.egg-info/top_level.txt +0 -0
  31. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/tests/test_forecast_adapter.py +0 -0
  32. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/tests/test_slstm_torch_vs_cuda.py +0 -0
  33. {tirex_mirror-2025.9.10 → tirex_mirror-2025.10.1}/tests/test_standard_adapter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tirex-mirror
3
- Version: 2025.9.10
3
+ Version: 2025.10.1
4
4
  Summary: Unofficial mirror of NX-AI/tirex for packaging
5
5
  Author-email: Arpad Rozsas <rozsasarpi@gmail.com>
6
6
  License: NXAI COMMUNITY LICENSE AGREEMENT
@@ -80,7 +80,7 @@ Requires-Dist: gluonts; extra == "gluonts"
80
80
  Provides-Extra: hfdataset
81
81
  Requires-Dist: datasets; extra == "hfdataset"
82
82
  Provides-Extra: test
83
- Requires-Dist: fev; extra == "test"
83
+ Requires-Dist: fev>=0.6.0; extra == "test"
84
84
  Requires-Dist: pytest; extra == "test"
85
85
  Provides-Extra: all
86
86
  Requires-Dist: xlstm; extra == "all"
@@ -90,7 +90,7 @@ Requires-Dist: matplotlib; extra == "all"
90
90
  Requires-Dist: gluonts; extra == "all"
91
91
  Requires-Dist: datasets; extra == "all"
92
92
  Requires-Dist: pytest; extra == "all"
93
- Requires-Dist: fev; extra == "all"
93
+ Requires-Dist: fev>=0.6.0; extra == "all"
94
94
  Dynamic: license-file
95
95
 
96
96
  # tirex-mirror
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tirex-mirror"
3
- version = "2025.09.10"
3
+ version = "2025.10.01"
4
4
  description = "Unofficial mirror of NX-AI/tirex for packaging"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -27,8 +27,8 @@ cuda = [ "xlstm", "ninja",]
27
27
  notebooks = [ "ipykernel", "matplotlib",]
28
28
  gluonts = [ "gluonts",]
29
29
  hfdataset = [ "datasets",]
30
- test = [ "fev", "pytest",]
31
- all = [ "xlstm", "ninja", "ipykernel", "matplotlib", "gluonts", "datasets", "pytest", "fev",]
30
+ test = [ "fev>=0.6.0", "pytest",]
31
+ all = [ "xlstm", "ninja", "ipykernel", "matplotlib", "gluonts", "datasets", "pytest", "fev>=0.6.0",]
32
32
 
33
33
  [tool.docformatter]
34
34
  diff = false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tirex-mirror
3
- Version: 2025.9.10
3
+ Version: 2025.10.1
4
4
  Summary: Unofficial mirror of NX-AI/tirex for packaging
5
5
  Author-email: Arpad Rozsas <rozsasarpi@gmail.com>
6
6
  License: NXAI COMMUNITY LICENSE AGREEMENT
@@ -80,7 +80,7 @@ Requires-Dist: gluonts; extra == "gluonts"
80
80
  Provides-Extra: hfdataset
81
81
  Requires-Dist: datasets; extra == "hfdataset"
82
82
  Provides-Extra: test
83
- Requires-Dist: fev; extra == "test"
83
+ Requires-Dist: fev>=0.6.0; extra == "test"
84
84
  Requires-Dist: pytest; extra == "test"
85
85
  Provides-Extra: all
86
86
  Requires-Dist: xlstm; extra == "all"
@@ -90,7 +90,7 @@ Requires-Dist: matplotlib; extra == "all"
90
90
  Requires-Dist: gluonts; extra == "all"
91
91
  Requires-Dist: datasets; extra == "all"
92
92
  Requires-Dist: pytest; extra == "all"
93
- Requires-Dist: fev; extra == "all"
93
+ Requires-Dist: fev>=0.6.0; extra == "all"
94
94
  Dynamic: license-file
95
95
 
96
96
  # tirex-mirror
@@ -13,7 +13,7 @@ matplotlib
13
13
  gluonts
14
14
  datasets
15
15
  pytest
16
- fev
16
+ fev>=0.6.0
17
17
 
18
18
  [cuda]
19
19
  xlstm
@@ -30,5 +30,5 @@ ipykernel
30
30
  matplotlib
31
31
 
32
32
  [test]
33
- fev
33
+ fev>=0.6.0
34
34
  pytest
@@ -14,22 +14,30 @@ def geometric_mean(s):
14
14
 
15
15
 
16
16
  def eval_task(model, task):
17
- past_data, _ = task.get_input_data(trust_remote_code=True)
18
- quantile_levels = task.quantile_levels
19
- past_data = past_data.with_format("torch").cast_column(
20
- task.target_column, datasets.Sequence(datasets.Value("float32"))
21
- )[task.target_column]
22
- loaded_data = [t for t in past_data]
23
-
24
- start_time = time.monotonic()
25
- quantiles, means = model.forecast(loaded_data, quantile_levels=quantile_levels, prediction_length=task.horizon)
26
- inference_time = time.monotonic() - start_time
27
- predictions_dict = {"predictions": means}
28
- for idx, level in enumerate(quantile_levels):
29
- predictions_dict[str(level)] = quantiles[:, :, idx] # [num_items, horizon]
30
-
31
- predictions = datasets.Dataset.from_dict(predictions_dict)
32
- return predictions, inference_time
17
+ inference_time = 0.0
18
+ predictions_per_window = []
19
+ for window in task.iter_windows(trust_remote_code=True):
20
+ past_data, _ = fev.convert_input_data(window, adapter="datasets", as_univariate=True)
21
+ past_data = past_data.with_format("torch").cast_column("target", datasets.Sequence(datasets.Value("float32")))
22
+ loaded_targets = [t for t in past_data["target"]]
23
+
24
+ start_time = time.monotonic()
25
+ quantiles, means = model.forecast(
26
+ loaded_targets, quantile_levels=task.quantile_levels, prediction_length=task.horizon
27
+ )
28
+ inference_time += time.monotonic() - start_time
29
+
30
+ predictions_dict = {"predictions": means}
31
+ for idx, level in enumerate(task.quantile_levels):
32
+ predictions_dict[str(level)] = quantiles[:, :, idx]
33
+
34
+ predictions_per_window.append(
35
+ fev.combine_univariate_predictions_to_multivariate(
36
+ datasets.Dataset.from_dict(predictions_dict), target_columns=task.target_columns
37
+ )
38
+ )
39
+
40
+ return predictions_per_window, inference_time
33
41
 
34
42
 
35
43
  @pytest.fixture
@@ -0,0 +1,48 @@
1
+ from pathlib import Path
2
+
3
+ import numpy as np
4
+ import pytest
5
+ import torch
6
+
7
+ from tirex import ForecastModel, load_model
8
+
9
+
10
+ def load_tensor_from_txt_file(path):
11
+ base_path = Path(__file__).parent.resolve() / "data"
12
+ return torch.from_numpy(np.genfromtxt(base_path / path, dtype=np.float32))
13
+
14
+
15
+ def load_tensor_from_pt_file(path):
16
+ base_path = Path(__file__).parent.resolve() / "data"
17
+ return torch.load(base_path / path)
18
+
19
+
20
+ @pytest.fixture
21
+ def tirex_model() -> ForecastModel:
22
+ return load_model("NX-AI/TiRex")
23
+
24
+
25
+ def test_forecast_air_traffic(tirex_model):
26
+ context = load_tensor_from_txt_file("air_passengers.csv")[:-12]
27
+
28
+ quantiles, mean = tirex_model.forecast(context, prediction_length=24)
29
+
30
+ ref_mean = load_tensor_from_txt_file("air_passengers_forecast_ref.csv").unsqueeze(0)
31
+ ref_quantiles = load_tensor_from_pt_file("air_passengers_quantiles_ref.pt")
32
+
33
+ # default rtol & atol for bfloat16
34
+ torch.testing.assert_close(mean, ref_mean, rtol=1.6e-2, atol=1e-5)
35
+ torch.testing.assert_close(quantiles, ref_quantiles, rtol=1.6e-2, atol=1e-5)
36
+
37
+
38
+ def test_forecast_seattle_5T(tirex_model):
39
+ context = load_tensor_from_txt_file("loop_seattle_5T.csv")[:-512]
40
+
41
+ quantiles, mean = tirex_model.forecast(context, prediction_length=768)
42
+
43
+ ref_mean = load_tensor_from_txt_file("loop_seattle_5T_forecast_ref.csv").unsqueeze(0)
44
+ ref_quantiles = load_tensor_from_pt_file("loop_seattle_5T_quantiles_ref.pt")
45
+
46
+ # default rtol & atol for bfloat16
47
+ torch.testing.assert_close(mean, ref_mean, rtol=1.6e-2, atol=1e-5)
48
+ torch.testing.assert_close(quantiles, ref_quantiles, rtol=1.6e-2, atol=1e-5)
@@ -1,37 +0,0 @@
1
- from pathlib import Path
2
-
3
- import numpy as np
4
- import pytest
5
- import torch
6
-
7
- from tirex import ForecastModel, load_model
8
-
9
-
10
- def load_tensor_from_file(path):
11
- base_path = Path(__file__).parent.resolve() / "data"
12
- return torch.from_numpy(np.genfromtxt(base_path / path, dtype=np.float32))
13
-
14
-
15
- @pytest.fixture
16
- def tirex_model() -> ForecastModel:
17
- return load_model("NX-AI/TiRex")
18
-
19
-
20
- def test_forecast_air_traffic(tirex_model):
21
- context = load_tensor_from_file("air_passengers.csv")[:-12]
22
-
23
- quantiles, mean = tirex_model.forecast(context, prediction_length=24)
24
-
25
- ref_data = load_tensor_from_file("air_passengers_forecast_ref.csv").unsqueeze(0)
26
-
27
- torch.testing.assert_close(mean, ref_data, rtol=1.6e-2, atol=1e-5) # default rtol & atol for bfloat16
28
-
29
-
30
- def test_forecast_seattle_5T(tirex_model):
31
- context = load_tensor_from_file("loop_seattle_5T.csv")[:-512]
32
-
33
- quantiles, mean = tirex_model.forecast(context, prediction_length=768)
34
-
35
- ref_data = load_tensor_from_file("loop_seattle_5T_forecast_ref.csv").unsqueeze(0)
36
-
37
- torch.testing.assert_close(mean, ref_data, rtol=1.6e-2, atol=1e-5) # default rtol & atol for bfloat16