Multiclass-interface 1.21__tar.gz → 1.22__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 (26) hide show
  1. {multiclass_interface-1.21 → multiclass_interface-1.22/Multiclass_interface.egg-info}/PKG-INFO +1 -1
  2. multiclass_interface-1.22/Multiclass_interface.egg-info/scm_version.json +8 -0
  3. {multiclass_interface-1.21/Multiclass_interface.egg-info → multiclass_interface-1.22}/PKG-INFO +1 -1
  4. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/mpi_interface.py +23 -5
  5. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/tests/test_mpi.py +1 -2
  6. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/version.py +3 -3
  7. multiclass_interface-1.21/Multiclass_interface.egg-info/scm_version.json +0 -8
  8. {multiclass_interface-1.21 → multiclass_interface-1.22}/.gitignore +0 -0
  9. {multiclass_interface-1.21 → multiclass_interface-1.22}/.gitlab-ci.yml +0 -0
  10. {multiclass_interface-1.21 → multiclass_interface-1.22}/LICENSE +0 -0
  11. {multiclass_interface-1.21 → multiclass_interface-1.22}/Multiclass_interface.egg-info/SOURCES.txt +0 -0
  12. {multiclass_interface-1.21 → multiclass_interface-1.22}/Multiclass_interface.egg-info/dependency_links.txt +0 -0
  13. {multiclass_interface-1.21 → multiclass_interface-1.22}/Multiclass_interface.egg-info/requires.txt +0 -0
  14. {multiclass_interface-1.21 → multiclass_interface-1.22}/Multiclass_interface.egg-info/scm_file_list.json +0 -0
  15. {multiclass_interface-1.21 → multiclass_interface-1.22}/Multiclass_interface.egg-info/top_level.txt +0 -0
  16. {multiclass_interface-1.21 → multiclass_interface-1.22}/README.md +0 -0
  17. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/__init__.py +0 -0
  18. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/multi_object_list.py +0 -0
  19. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/multiprocess_interface.py +0 -0
  20. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/tests/__init__.py +0 -0
  21. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/tests/my_test_cls.py +0 -0
  22. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/tests/test_multiclass_list.py +0 -0
  23. {multiclass_interface-1.21 → multiclass_interface-1.22}/multiclass_interface/tests/test_multiprocessinterface.py +0 -0
  24. {multiclass_interface-1.21 → multiclass_interface-1.22}/pyproject.toml +0 -0
  25. {multiclass_interface-1.21 → multiclass_interface-1.22}/sequence_diagrams.md +0 -0
  26. {multiclass_interface-1.21 → multiclass_interface-1.22}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Multiclass_interface
3
- Version: 1.21
3
+ Version: 1.22
4
4
  Summary: Multiclass interface
5
5
  Author-email: "Mads M. Pedersen" <mmpe@dtu.dk>
6
6
  Project-URL: Homepage, https://gitlab.windenergy.dtu.dk/DYNAMIKS/multiclass_interface
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.22",
3
+ "distance": 0,
4
+ "node": "g3494f25be53fc669f99cd3f34e4221cd9f030c5a",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-25"
8
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Multiclass_interface
3
- Version: 1.21
3
+ Version: 1.22
4
4
  Summary: Multiclass interface
5
5
  Author-email: "Mads M. Pedersen" <mmpe@dtu.dk>
6
6
  Project-URL: Homepage, https://gitlab.windenergy.dtu.dk/DYNAMIKS/multiclass_interface
@@ -8,6 +8,7 @@ import sys
8
8
  import traceback
9
9
  from contextlib import contextmanager
10
10
  import contextlib
11
+ import subprocess
11
12
 
12
13
  comm = None
13
14
  size = 1
@@ -312,7 +313,7 @@ def bcast_function_result_main2all(f):
312
313
  return wrapper
313
314
 
314
315
 
315
- def mpi_run_test(n, cwd='.', mpirun_cmd='mpirun'):
316
+ def mpi_run_test(n, cwd='.', mpirun_cmd='mpirun', assert_success=True):
316
317
  if callable(n):
317
318
  return mpi_run_test(n=4)(n)
318
319
 
@@ -327,13 +328,30 @@ def mpi_run_test(n, cwd='.', mpirun_cmd='mpirun'):
327
328
  def wrap(mpirun=False):
328
329
  if mpirun:
329
330
  with contextlib.chdir(cwd):
330
- return test_function()
331
+ # print(f"Running {name} with {n} mpi processes in {os.getcwd()}", flush=True)
332
+ test_function()
333
+ print(f"{name} completed successfully", flush=True)
331
334
  else:
332
335
  import_path = Path(inspect.getsourcefile(test_function)).relative_to(os.getcwd()).as_posix()
333
336
  import_path = import_path[:-3].replace('/', '.')
334
- cmd = f'''{mpirun_cmd} -n {n} {sys.executable} -c "from {import_path} import {name}; {name}(mpirun=True)"'''
335
- print(f"cd {os.getcwd()} && {cmd}", flush=True)
336
- assert os.system(cmd) == 0, name
337
+ cmd = [mpirun_cmd, '-n', str(n),
338
+ sys.executable, '-c', f'from {import_path} import {name}; {name}(mpirun=True)']
339
+
340
+ print(f"cd {os.getcwd()} && {' '.join(cmd[:-1])} '{cmd[-1]}'", flush=True)
341
+ success = False
342
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
343
+
344
+ while p.poll() is None:
345
+ l = p.stdout.readline().decode('utf-8') # This blocks until it receives a newline.
346
+ if f'{name} completed successfully\n' == l:
347
+ success = True
348
+ else:
349
+ print(l, end='', flush=True)
350
+ # When the subprocess terminates there might be unconsumed output
351
+ # that still needs to be processed.
352
+ print(p.stdout.read())
353
+
354
+ assert success or not assert_success, f"Test {name} did not success. Check the output above for details."
337
355
 
338
356
  wrap.__name__ = name
339
357
  return wrap
@@ -245,7 +245,6 @@ def test_multiprocessinterface_tests_diff_interface():
245
245
  f(mpici)
246
246
  except ChildProcessError:
247
247
  pass
248
- sys.exit(0)
249
248
 
250
249
 
251
250
  @mpi_run_test(4)
@@ -274,7 +273,7 @@ def test_barrier_print_bcast_missing_error():
274
273
  raise Exception('Exception not raised')
275
274
 
276
275
 
277
- @mpi_run_test(4)
276
+ @mpi_run_test(4, assert_success=False)
278
277
  def test_barrier_print_bcast_missing_exit():
279
278
  mpi_interface.activate_mpi(collective_mpi=False)
280
279
  if mpi_interface.rank in [0, 2, 3]:
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.21'
22
- __version_tuple__ = version_tuple = (1, 21)
21
+ __version__ = version = '1.22'
22
+ __version_tuple__ = version_tuple = (1, 22)
23
23
 
24
- __commit_id__ = commit_id = 'g7ab17bd08'
24
+ __commit_id__ = commit_id = 'g3494f25be'
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.21",
3
- "distance": 0,
4
- "node": "g7ab17bd086dc20afa440d26bd8c04d87e1b9718f",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-11-16"
8
- }