rustat-python-api 0.6.0__tar.gz → 0.6.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 (18) hide show
  1. {rustat-python-api-0.6.0/rustat_python_api.egg-info → rustat-python-api-0.6.1}/PKG-INFO +1 -1
  2. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/pitch_control.py +15 -2
  3. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1/rustat_python_api.egg-info}/PKG-INFO +1 -1
  4. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/setup.py +1 -1
  5. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/LICENSE +0 -0
  6. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/README.md +0 -0
  7. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/pyproject.toml +0 -0
  8. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/__init__.py +0 -0
  9. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/config.py +0 -0
  10. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/models_api.py +0 -0
  11. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/parser.py +0 -0
  12. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/processing.py +0 -0
  13. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api/urls.py +0 -0
  14. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api.egg-info/SOURCES.txt +0 -0
  15. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api.egg-info/dependency_links.txt +0 -0
  16. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api.egg-info/requires.txt +0 -0
  17. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/rustat_python_api.egg-info/top_level.txt +0 -0
  18. {rustat-python-api-0.6.0 → rustat-python-api-0.6.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rustat-python-api
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: A Python wrapper for RuStat API
5
5
  Home-page: https://github.com/dailydaniel/rustat-python-api
6
6
  Author: Daniel Zholkovsky
@@ -398,11 +398,24 @@ class PitchControl:
398
398
  @staticmethod
399
399
  def _stack_team_frames(players: list[np.ndarray], frames: np.ndarray, device: str, dtype: torch.dtype):
400
400
  """Stack positions for given frames into torch tensors (pos_t, pos_tp1)."""
401
+ # Ensure every player's trajectory is long enough; if not, pad by repeating
402
+ # the last available coordinate so that indexing `frames` and `frames+1` is safe.
403
+ max_needed = frames[-1] + 1 # we access idx and idx+1
404
+
405
+ padded = []
406
+ for p in players:
407
+ if len(p) <= max_needed:
408
+ pad_len = max_needed + 1 - len(p)
409
+ if pad_len > 0:
410
+ last = p[-1][None, :]
411
+ p = np.vstack([p, np.repeat(last, pad_len, axis=0)])
412
+ padded.append(p)
413
+
401
414
  pos_t = torch.tensor(
402
- np.stack([p[frames] for p in players], axis=1), device=device, dtype=dtype
415
+ np.stack([p[frames] for p in padded], axis=1), device=device, dtype=dtype
403
416
  ) # (F,P,2)
404
417
  pos_tp1 = torch.tensor(
405
- np.stack([p[frames + 1] for p in players], axis=1), device=device, dtype=dtype
418
+ np.stack([p[frames + 1] for p in padded], axis=1), device=device, dtype=dtype
406
419
  )
407
420
  return pos_t, pos_tp1
408
421
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rustat-python-api
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: A Python wrapper for RuStat API
5
5
  Home-page: https://github.com/dailydaniel/rustat-python-api
6
6
  Author: Daniel Zholkovsky
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='rustat-python-api',
5
- version='0.6.0',
5
+ version='0.6.1',
6
6
  description='A Python wrapper for RuStat API',
7
7
  long_description=open('README.md').read(),
8
8
  long_description_content_type='text/markdown',