piegy 2.1.9__tar.gz → 2.1.11__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 (36) hide show
  1. {piegy-2.1.9/src/piegy.egg-info → piegy-2.1.11}/PKG-INFO +1 -1
  2. {piegy-2.1.9 → piegy-2.1.11}/pyproject.toml +1 -1
  3. {piegy-2.1.9 → piegy-2.1.11}/setup.py +12 -1
  4. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/Makefile +6 -6
  5. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/sim_funcs.c +1 -1
  6. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/__version__.py +3 -1
  7. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/build_info.py +3 -3
  8. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/simulation.py +1 -1
  9. {piegy-2.1.9 → piegy-2.1.11/src/piegy.egg-info}/PKG-INFO +1 -1
  10. {piegy-2.1.9 → piegy-2.1.11}/src/piegy.egg-info/SOURCES.txt +0 -1
  11. piegy-2.1.9/src/piegy/C_core/piegyc.so +0 -0
  12. {piegy-2.1.9 → piegy-2.1.11}/LICENSE.txt +0 -0
  13. {piegy-2.1.9 → piegy-2.1.11}/MANIFEST.in +0 -0
  14. {piegy-2.1.9 → piegy-2.1.11}/README.md +0 -0
  15. {piegy-2.1.9 → piegy-2.1.11}/setup.cfg +0 -0
  16. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/model.c +0 -0
  17. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/model.h +0 -0
  18. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/patch.c +0 -0
  19. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/patch.h +0 -0
  20. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/piegyc.h +0 -0
  21. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/runner.c +0 -0
  22. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/C_core/sim_funcs.h +0 -0
  23. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/__init__.py +0 -0
  24. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/analysis.py +0 -0
  25. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/data_tools.py +0 -0
  26. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/figures.py +0 -0
  27. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/find_C.py +0 -0
  28. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/simulation_py.py +0 -0
  29. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/test_var.py +0 -0
  30. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/tools/__init__.py +0 -0
  31. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/tools/figure_tools.py +0 -0
  32. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/tools/file_tools.py +0 -0
  33. {piegy-2.1.9 → piegy-2.1.11}/src/piegy/videos.py +0 -0
  34. {piegy-2.1.9 → piegy-2.1.11}/src/piegy.egg-info/dependency_links.txt +0 -0
  35. {piegy-2.1.9 → piegy-2.1.11}/src/piegy.egg-info/requires.txt +0 -0
  36. {piegy-2.1.9 → piegy-2.1.11}/src/piegy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: piegy
3
- Version: 2.1.9
3
+ Version: 2.1.11
4
4
  Summary: Payoff-Driven Stochastic Spatial Model for Evolutionary Game Theory
5
5
  Author-email: Chenning Xu <cxu7@caltech.edu>
6
6
  License: BSD 3-Clause License
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'piegy'
7
- version = '2.1.9'
7
+ version = '2.1.11'
8
8
  description = 'Payoff-Driven Stochastic Spatial Model for Evolutionary Game Theory'
9
9
  readme = 'README.md'
10
10
  requires-python = '>=3.7'
@@ -19,7 +19,7 @@ class BuildSharedLib(build_ext):
19
19
 
20
20
  def build_extension(self, ext):
21
21
  if sys.platform == 'win32':
22
- lib_name = 'piegyc.dll'
22
+ lib_name = 'piegyc.pyd'
23
23
  else:
24
24
  lib_name = 'piegyc.so'
25
25
  so_path = os.path.abspath(f'src/piegy/C_core/{lib_name}')
@@ -27,6 +27,17 @@ class BuildSharedLib(build_ext):
27
27
 
28
28
  os.makedirs(os.path.dirname(target_path), exist_ok=True)
29
29
  self.copy_file(so_path, target_path)
30
+ self.rm_duplicate()
31
+
32
+ def rm_duplicate(self):
33
+ C_core_path = os.path.abspath(f'src/piegy/C_core')
34
+ so_name = 'piegyc.so'
35
+ if sys.platform == 'win32':
36
+ so_name = 'piegyc.pyd'
37
+ try:
38
+ os.remove(os.path.join(C_core_path, so_name))
39
+ except OSError:
40
+ pass
30
41
 
31
42
 
32
43
 
@@ -10,11 +10,11 @@ LDFLAGS_COMMON = -flto
10
10
 
11
11
  ## Flags for Debugging ##
12
12
  # slower, debuggable with lldb, with Address Sanitizer. Don't use in python
13
- #CFLAGS = -g -std=c99 -Wall -Wextra -MMD -MP -fsanitize=address,undefined -fno-omit-frame-pointer
14
- #LDFLAGS = -fsanitize=address,undefined
13
+ #CFLAGS_COMMON = -g -std=c99 -Wall -Wextra -MMD -MP -fsanitize=address,undefined -fno-omit-frame-pointer
14
+ #LDFLAGS_COMMON = -fsanitize=address,undefined
15
15
  # slower, regular build, allow lldb
16
- #CFLAGS = -g -std=c99 -Wall -Wextra -MMD -MP
17
- #LDFLAGS =
16
+ #CFLAGS_COMMON = -g -std=c99 -Wall -Wextra -MMD -MP
17
+ #LDFLAGS_COMMON =
18
18
 
19
19
 
20
20
  #### OS specific ####
@@ -54,7 +54,7 @@ DEPS = $(OBJ:.o=.d) $(RUNNER_DEPS)
54
54
  TEST = runner
55
55
  ifeq '$(findstring ;,$(PATH))' ';'
56
56
  # windows
57
- SHARED_LIB = piegyc.dll
57
+ SHARED_LIB = piegyc.pyd
58
58
  else
59
59
  SHARED_LIB = piegyc.so
60
60
  endif
@@ -83,7 +83,7 @@ $(SHARED_LIB): $(OBJ)
83
83
 
84
84
  # Clean build files
85
85
  clean:
86
- rm -f $(OBJ) $(RUNNER_OBJ) $(TEST) $(SHARED_LIB) $(DEPS)
86
+ rm -f $(OBJ) $(RUNNER_OBJ) $(TEST) $(SHARED_LIB) $(DEPS) *.so
87
87
 
88
88
  # Rebuild target: clean then all
89
89
  re: clean all
@@ -506,7 +506,7 @@ void run(model_t* mod, char* message, size_t msg_len) {
506
506
  size_t i = 0;
507
507
 
508
508
  while (i < mod->sim_time) {
509
- char curr_msg[20 + msg_len]; // message for current round
509
+ char curr_msg[100 + msg_len]; // message for current round
510
510
  strcpy(curr_msg, message);
511
511
  strcat(curr_msg, "round ");
512
512
  snprintf(curr_msg + strlen(curr_msg), sizeof(curr_msg) - strlen(curr_msg), "%zu", i);
@@ -1,4 +1,4 @@
1
- __version__ = '2.1.9'
1
+ __version__ = '2.1.11'
2
2
 
3
3
  '''
4
4
  version history:
@@ -30,4 +30,6 @@ version history:
30
30
  2.1.0: redo random number generator. Update package upload so that more compatible across platforms.
31
31
  2.1.1: fix import bug for the C core.
32
32
  2.1.2 ~ 2.1.9: updating & fixing wheel.
33
+ 2.1.10: fix print bug in run function.
34
+ 2.1.11: fix .so duplicate error.
33
35
  '''
@@ -4,9 +4,9 @@ Auto-generated at compile time.
4
4
  """
5
5
 
6
6
  build_info = {
7
- "version": "2.1.8",
8
- "built from": "local",
9
- "build date": "2025-06-28 01:23:08",
7
+ "version": "2.1.10",
8
+ "built from": "local machine",
9
+ "build date": "2025-06-28 04:12:23",
10
10
  "python version": "3.11.10",
11
11
  "platform": "darwin"
12
12
  }
@@ -408,7 +408,7 @@ def run(mod, message = ""):
408
408
  if not mod.data_empty:
409
409
  raise ValueError('mod has non-empty data.')
410
410
 
411
- msg_len = len(message)
411
+ msg_len = len(message) * 2
412
412
  msg_bytes = message.encode('utf-8')
413
413
  msg_buffer = ctypes.create_string_buffer(msg_bytes, msg_len)
414
414
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: piegy
3
- Version: 2.1.9
3
+ Version: 2.1.11
4
4
  Summary: Payoff-Driven Stochastic Spatial Model for Evolutionary Game Theory
5
5
  Author-email: Chenning Xu <cxu7@caltech.edu>
6
6
  License: BSD 3-Clause License
@@ -25,7 +25,6 @@ src/piegy/C_core/model.h
25
25
  src/piegy/C_core/patch.c
26
26
  src/piegy/C_core/patch.h
27
27
  src/piegy/C_core/piegyc.h
28
- src/piegy/C_core/piegyc.so
29
28
  src/piegy/C_core/runner.c
30
29
  src/piegy/C_core/sim_funcs.c
31
30
  src/piegy/C_core/sim_funcs.h
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes