piegy 2.2.3__pp311-pypy311_pp73-macosx_11_0_arm64.whl → 2.3.1__pp311-pypy311_pp73-macosx_11_0_arm64.whl
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.
- piegy/C_core/patch.h +6 -6
- piegy/C_core/piegyc.pypy311-pp73-darwin.so +0 -0
- piegy/C_core/sim_funcs.c +7 -7
- piegy/C_core/sim_funcs.h +12 -12
- piegy/__init__.py +2 -2
- piegy/__version__.py +2 -1
- piegy/build_info.py +2 -2
- piegy/figures.py +74 -17
- piegy/test_var.py +2 -2
- piegy/tools/figure_tools.py +1 -1
- {piegy-2.2.3.dist-info → piegy-2.3.1.dist-info}/METADATA +1 -1
- piegy-2.3.1.dist-info/RECORD +28 -0
- piegy-2.2.3.dist-info/RECORD +0 -28
- {piegy-2.2.3.dist-info → piegy-2.3.1.dist-info}/WHEEL +0 -0
- {piegy-2.2.3.dist-info → piegy-2.3.1.dist-info}/licenses/LICENSE.txt +0 -0
- {piegy-2.2.3.dist-info → piegy-2.3.1.dist-info}/top_level.txt +0 -0
piegy/C_core/patch.h
CHANGED
@@ -23,14 +23,14 @@ typedef struct patch_t {
|
|
23
23
|
double V_pi;
|
24
24
|
|
25
25
|
struct patch_t* nb[4];
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
double U_weight[4]; // stores migration weight of each of the 4 neighbors
|
27
|
+
double V_weight[4];
|
28
|
+
double sum_U_weight; // sum of U_weight
|
29
|
+
double sum_V_weight;
|
30
30
|
double pi_death_rates[4];
|
31
|
-
|
31
|
+
double mig_rates[8];
|
32
32
|
double sum_pi_death_rates;
|
33
|
-
|
33
|
+
double sum_mig_rates;
|
34
34
|
} patch_t;
|
35
35
|
|
36
36
|
// in .c
|
Binary file
|
piegy/C_core/sim_funcs.c
CHANGED
@@ -69,7 +69,7 @@ static void find_nb_periodical(size_t* restrict nb, size_t i, size_t j, size_t N
|
|
69
69
|
|
70
70
|
// single_init function: initializes world, runs 1 event, returns updated variables
|
71
71
|
static double single_init(const model_t* mod, patch_t* world, size_t* nb_indices,
|
72
|
-
|
72
|
+
double* patch_rates, double* sum_rates_by_row, double* sum_rates_p, signal_t* sig_p, patch_picked_t* picked_p) {
|
73
73
|
|
74
74
|
size_t N = mod->N;
|
75
75
|
size_t M = mod->M;
|
@@ -141,7 +141,7 @@ static double single_init(const model_t* mod, patch_t* world, size_t* nb_indices
|
|
141
141
|
}
|
142
142
|
|
143
143
|
// pick the first random event
|
144
|
-
|
144
|
+
double expected_sum = random01() * *sum_rates_p;
|
145
145
|
find_patch(picked_p, expected_sum, patch_rates, sum_rates_by_row, *sum_rates_p, N, M);
|
146
146
|
size_t picked_idx = picked_p->i * M + picked_p->j;
|
147
147
|
size_t e0 = find_event(&world[picked_idx], expected_sum - picked_p->current_sum);
|
@@ -223,9 +223,9 @@ static uint8_t single_test(model_t* restrict mod, uint32_t update_sum_freq, char
|
|
223
223
|
patch_t* world = (patch_t*) calloc(NM, sizeof(patch_t));
|
224
224
|
size_t* nb_indices = (size_t*) calloc(NM * 4, sizeof(size_t));
|
225
225
|
|
226
|
-
|
227
|
-
|
228
|
-
|
226
|
+
double* patch_rates = (double*) calloc(NM, sizeof(double));
|
227
|
+
double* sum_rates_by_row = (double*) calloc(N, sizeof(double));
|
228
|
+
double sum_rates = 0;
|
229
229
|
|
230
230
|
signal_t signal;
|
231
231
|
patch_picked_t picked;
|
@@ -399,7 +399,7 @@ static uint8_t single_test(model_t* restrict mod, uint32_t update_sum_freq, char
|
|
399
399
|
|
400
400
|
|
401
401
|
// pick a random event
|
402
|
-
|
402
|
+
double expected_sum = random01() * sum_rates;
|
403
403
|
find_patch(&picked, expected_sum, patch_rates, sum_rates_by_row, sum_rates, N, M);
|
404
404
|
size_t picked_idx = picked.i * M + picked.j;
|
405
405
|
uint8_t e0 = find_event(&world[picked_idx], expected_sum - picked.current_sum);
|
@@ -477,7 +477,7 @@ static uint8_t single_test(model_t* restrict mod, uint32_t update_sum_freq, char
|
|
477
477
|
|
478
478
|
|
479
479
|
|
480
|
-
static void single_test_free(patch_t** world, size_t** nb_indices,
|
480
|
+
static void single_test_free(patch_t** world, size_t** nb_indices, double** patch_rates, double** sum_rates_by_row) {
|
481
481
|
free(*world);
|
482
482
|
free(*nb_indices);
|
483
483
|
free(*patch_rates);
|
piegy/C_core/sim_funcs.h
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
// where exp(x) is considered overflow
|
39
39
|
// below the actual bound (709) because the large numbers will be computed with close-to-0 ones (payoff rates), so higher accuracy is needed
|
40
|
-
#define EXP_OVERFLOW_BOUND
|
40
|
+
#define EXP_OVERFLOW_BOUND 500
|
41
41
|
|
42
42
|
|
43
43
|
static uint64_t pcg_state = 0;
|
@@ -83,9 +83,9 @@ typedef struct signal_t {
|
|
83
83
|
static void find_nb_zero_flux(size_t* restrict nb, size_t i, size_t j, size_t N, size_t M, size_t NM);
|
84
84
|
static void find_nb_periodical(size_t* restrict nb, size_t i, size_t j, size_t N, size_t M, size_t NM);
|
85
85
|
static double single_init(const model_t* mod, patch_t* world, size_t* nb_indices,
|
86
|
-
|
86
|
+
double* patch_rates, double* sum_rates_by_row, double* sum_rates, signal_t* sig_p, patch_picked_t* picked_p) ;
|
87
87
|
static uint8_t single_test(model_t* restrict mod, uint32_t update_sum_frequency, char* message);
|
88
|
-
static void single_test_free(patch_t** world, size_t** nb_indices,
|
88
|
+
static void single_test_free(patch_t** world, size_t** nb_indices, double** patch_rates, double** sum_rates_by_row);
|
89
89
|
uint8_t run(model_t* mod, char* message, size_t msg_len, uint32_t update_sum_freq);
|
90
90
|
|
91
91
|
|
@@ -94,12 +94,12 @@ uint8_t run(model_t* mod, char* message, size_t msg_len, uint32_t update_sum_fre
|
|
94
94
|
* Inline Functions
|
95
95
|
*/
|
96
96
|
|
97
|
-
static inline
|
97
|
+
static inline double random01() {
|
98
98
|
// generate a 24 bit random int, then convert to a (0, 1) ranged double
|
99
99
|
uint32_t r1 = rand() & 0x7fff; // RAND_MAX is different across machines, ensure 15 bits
|
100
100
|
uint32_t r2 = rand() & 0x7fff;
|
101
101
|
|
102
|
-
|
102
|
+
double r_combined = (r1 << 15) + r2; // discard the lower 3 bits, which are unstable
|
103
103
|
return (r_combined + 1) / RAND_UPPER_PLUS_2;
|
104
104
|
}
|
105
105
|
|
@@ -155,8 +155,8 @@ static inline uint8_t update_mig_one(patch_t* restrict p, const double* restrict
|
|
155
155
|
|
156
156
|
double mu1_U = P_start[0] * (double)p->U;
|
157
157
|
double mu2_V = P_start[1] * (double)p->V;
|
158
|
-
|
159
|
-
|
158
|
+
double* p_U_weight = p->U_weight;
|
159
|
+
double* p_V_weight = p->V_weight;
|
160
160
|
|
161
161
|
patch_t* nbi = p->nb[nb_loc];
|
162
162
|
p->sum_U_weight -= p_U_weight[nb_loc];
|
@@ -210,8 +210,8 @@ static inline uint8_t update_mig_all(patch_t* restrict p, const double* restrict
|
|
210
210
|
double mu1_U = P_start[0] * (double)p->U;
|
211
211
|
double mu2_V = P_start[1] * (double)p->V;
|
212
212
|
|
213
|
-
|
214
|
-
|
213
|
+
double* p_U_weight = p->U_weight;
|
214
|
+
double* p_V_weight = p->V_weight;
|
215
215
|
|
216
216
|
p->sum_U_weight = 0.0;
|
217
217
|
p->sum_V_weight = 0.0;
|
@@ -255,7 +255,7 @@ static inline uint8_t update_mig_all(patch_t* restrict p, const double* restrict
|
|
255
255
|
|
256
256
|
|
257
257
|
|
258
|
-
static inline uint8_t find_event(const patch_t* restrict p,
|
258
|
+
static inline uint8_t find_event(const patch_t* restrict p, double expected_sum) {
|
259
259
|
size_t event = 0;
|
260
260
|
double current_sum;
|
261
261
|
|
@@ -330,8 +330,8 @@ static inline void change_popu(patch_t* restrict p, uint8_t s) {
|
|
330
330
|
* Main Simulation Functions
|
331
331
|
*/
|
332
332
|
|
333
|
-
static inline void find_patch(patch_picked_t* restrict picked,
|
334
|
-
const
|
333
|
+
static inline void find_patch(patch_picked_t* restrict picked, double expected_sum,
|
334
|
+
const double* restrict patch_rates, const double* restrict sum_rates_by_row, double sum_rates, size_t N, size_t M) {
|
335
335
|
double current_sum = 0;
|
336
336
|
size_t row = 0;
|
337
337
|
size_t col = 0;
|
piegy/__init__.py
CHANGED
@@ -28,7 +28,7 @@ from .data_tools import save_data, read_data
|
|
28
28
|
from .analysis import rounds_expected, scale_maxtime, check_convergence, combine_sim
|
29
29
|
|
30
30
|
from .figures import (UV_hmap, UV_bar, UV_dyna, UV_hist, UV_std, UV_expected,
|
31
|
-
pi_hmap, pi_bar, pi_dyna, pi_hist, pi_std, UV_pi)
|
31
|
+
pi_hmap, pi_bar, pi_dyna, pi_hist, pi_std, UV_pi, video_fig)
|
32
32
|
|
33
33
|
from .test_var import (test_var1, var_UV1, var_pi1, var_convergence1, get_dirs1,
|
34
34
|
test_var2, var_UV2, var_pi2, var_convergence2, get_dirs2)
|
@@ -43,7 +43,7 @@ data_members = ['save_data', 'read_data']
|
|
43
43
|
analysis_members = ['expected_rounds', 'scale_maxtime', 'check_convergence', 'combine_mod']
|
44
44
|
|
45
45
|
figures_members = ['UV_hmap', 'UV_bar', 'UV_dyna', 'UV_hist', 'UV_std', 'UV_expected_val', 'UV_expected',
|
46
|
-
'pi_hmap', 'pi_bar', 'pi_dyna', 'pi_hist', 'pi_std', 'UV_pi']
|
46
|
+
'pi_hmap', 'pi_bar', 'pi_dyna', 'pi_hist', 'pi_std', 'UV_pi', 'video_fig']
|
47
47
|
|
48
48
|
test_var_members = ['test_var1', 'var_UV1', 'var_pi1', 'var_convergence1', 'get_dirs1',
|
49
49
|
'test_var2', 'var_UV2', 'var_pi2', 'var_convergence2', 'get_dirs2']
|
piegy/__version__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = '2.
|
1
|
+
__version__ = '2.3.1'
|
2
2
|
|
3
3
|
'''
|
4
4
|
version history:
|
@@ -35,4 +35,5 @@ version history:
|
|
35
35
|
2.2.1: change heatmap plotting tool from Seaborn to Matplotlib. Change video maker to cv2 (opencv-python).
|
36
36
|
2.2.2: impose stricter overflow error check. Used update_mig_one function (already written before, didn't use). This gives 30% speed improvement.
|
37
37
|
2.2.3: raised rate calculation to higher accuracy (long double), and switched to 30-bit random number generator.
|
38
|
+
2.3.1: roll back accuracy update. Decrease toleratable bound for exponent of exp() to 500. Add video_fig function to figures module, which plots change of patch popu/payoff overtime in a 2D figure.
|
38
39
|
'''
|
piegy/build_info.py
CHANGED
piegy/figures.py
CHANGED
@@ -306,9 +306,9 @@ def pi_hmap(mod, ax_U = None, ax_V = None, U_color = 'BuPu', V_color = 'YlGn', s
|
|
306
306
|
Upi_ave = figure_t.ave_interval(mod.Upi, start_index, end_index)
|
307
307
|
V_pi_ave = figure_t.ave_interval(mod.Vpi, start_index, end_index)
|
308
308
|
|
309
|
-
U_title = figure_t.gen_title('Payoff ' + r'$
|
309
|
+
U_title = figure_t.gen_title('Payoff ' + r'$p_H$', start, end)
|
310
310
|
U_text = figure_t.gen_text(np.mean(Upi_ave), np.std(Upi_ave))
|
311
|
-
V_title = figure_t.gen_title('Payoff ' + r'$
|
311
|
+
V_title = figure_t.gen_title('Payoff ' + r'$p_D$', start, end)
|
312
312
|
V_text = figure_t.gen_text(np.mean(V_pi_ave), np.std(V_pi_ave))
|
313
313
|
|
314
314
|
figure_t.hmap(Upi_ave, ax_U, U_color, U_title, U_text, vmin = vrange_U[0], vmax = vrange_U[1])
|
@@ -334,13 +334,13 @@ def pi_bar(mod, ax_U = None, ax_V = None, U_color = 'violet', V_color = 'yellowg
|
|
334
334
|
Upi_ave = figure_t.ave_interval_1D(mod.Upi, start_index, end_index)
|
335
335
|
V_pi_ave = figure_t.ave_interval_1D(mod.Vpi, start_index, end_index)
|
336
336
|
|
337
|
-
U_title = figure_t.gen_title(r'$
|
337
|
+
U_title = figure_t.gen_title(r'$p_H$', start, end)
|
338
338
|
U_text = figure_t.gen_text(np.mean(Upi_ave), np.std(Upi_ave))
|
339
|
-
V_title = figure_t.gen_title(r'$
|
339
|
+
V_title = figure_t.gen_title(r'$p_D$', start, end)
|
340
340
|
V_text = figure_t.gen_text(np.mean(V_pi_ave), np.std(V_pi_ave))
|
341
341
|
|
342
|
-
ax_U = figure_t.bar(Upi_ave, ax_U, U_color, 'Patches', 'Payoff ' + r'$
|
343
|
-
ax_V = figure_t.bar(V_pi_ave, ax_V, V_color, 'Patches', 'Payoff ' + r'$
|
342
|
+
ax_U = figure_t.bar(Upi_ave, ax_U, U_color, 'Patches', 'Payoff ' + r'$p_H$', U_title, U_text)
|
343
|
+
ax_V = figure_t.bar(V_pi_ave, ax_V, V_color, 'Patches', 'Payoff ' + r'$p_D$', V_title, V_text)
|
344
344
|
|
345
345
|
return ax_U, ax_V
|
346
346
|
|
@@ -376,12 +376,12 @@ def pi_dyna(mod, ax = None, interval = 20, grid = True):
|
|
376
376
|
if ax == None:
|
377
377
|
_, ax = plt.subplots()
|
378
378
|
ax.grid(grid)
|
379
|
-
ax.plot(xaxis, U_curve, CURVE_TYPE, label = r'$
|
380
|
-
ax.plot(xaxis, V_curve, CURVE_TYPE, label = r'$
|
379
|
+
ax.plot(xaxis, U_curve, CURVE_TYPE, label = r'$p_H$')
|
380
|
+
ax.plot(xaxis, V_curve, CURVE_TYPE, label = r'$p_D$')
|
381
381
|
ax.plot(xaxis, total_curve, CURVE_TYPE, label = 'total')
|
382
382
|
ax.set_xlabel('Time')
|
383
383
|
ax.set_ylabel('Payoff')
|
384
|
-
ax.set_title('Payoff ' + r'$
|
384
|
+
ax.set_title('Payoff ' + r'$p_H$' + ' & ' + r'$p_D$' + ' over time')
|
385
385
|
ax.legend()
|
386
386
|
|
387
387
|
return ax
|
@@ -408,17 +408,17 @@ def pi_hist(mod, ax_U = None, ax_V = None, U_color = 'violet', V_color = 'yellow
|
|
408
408
|
|
409
409
|
if ax_U == None:
|
410
410
|
_, ax_U = plt.subplots()
|
411
|
-
ax_U.set_xlabel('Payoff ' + r'$
|
411
|
+
ax_U.set_xlabel('Payoff ' + r'$p_H$')
|
412
412
|
ax_U.set_ylabel('Density')
|
413
413
|
ax_U.hist(Upi_ave, color = U_color, density = True)
|
414
|
-
ax_U.set_title(figure_t.gen_title('Payoff ' + r'$
|
414
|
+
ax_U.set_title(figure_t.gen_title('Payoff ' + r'$p_H$' + ' Hist', start, end))
|
415
415
|
|
416
416
|
if ax_V == None:
|
417
417
|
_, ax_V = plt.subplots()
|
418
|
-
ax_V.set_xlabel('Payoff ' + r'$
|
418
|
+
ax_V.set_xlabel('Payoff ' + r'$p_D$')
|
419
419
|
ax_V.set_ylabel('Density')
|
420
420
|
ax_V.hist(V_pi_ave, color = V_color, density = True)
|
421
|
-
ax_V.set_title(figure_t.gen_title('Payoff ' + r'$
|
421
|
+
ax_V.set_title(figure_t.gen_title('Payoff ' + r'$p_D$' + ' Hist', start, end))
|
422
422
|
|
423
423
|
return ax_U, ax_V
|
424
424
|
|
@@ -453,8 +453,8 @@ def pi_std(mod, ax = None, interval = 20, grid = True):
|
|
453
453
|
if ax == None:
|
454
454
|
_, ax = plt.subplots()
|
455
455
|
ax.grid(grid)
|
456
|
-
ax.plot(xaxis, Upi_std, CURVE_TYPE, label = r'$
|
457
|
-
ax.plot(xaxis, V_pi_std, CURVE_TYPE, label = r'$
|
456
|
+
ax.plot(xaxis, Upi_std, CURVE_TYPE, label = r'$p_H$' + ' std')
|
457
|
+
ax.plot(xaxis, V_pi_std, CURVE_TYPE, label = r'$p_D$' + ' std')
|
458
458
|
ax.legend()
|
459
459
|
ax.set_xlabel('Time')
|
460
460
|
ax.set_ylabel('Std Dev')
|
@@ -484,9 +484,66 @@ def UV_pi(mod, ax_U = None, ax_V = None, U_color = 'violet', V_color = 'yellowgr
|
|
484
484
|
V_pi_ave = figure_t.ave_interval(mod.Vpi, start_index, end_index)
|
485
485
|
|
486
486
|
|
487
|
-
ax_U = figure_t.scatter(U_ave, Upi_ave, ax_U, U_color, alpha, xlabel = 'U', ylabel = 'Payoff ' + r'$
|
488
|
-
ax_V = figure_t.scatter(V_ave, V_pi_ave, ax_V, V_color, alpha, xlabel = 'V', ylabel = 'Payoff ' + r'$
|
487
|
+
ax_U = figure_t.scatter(U_ave, Upi_ave, ax_U, U_color, alpha, xlabel = 'U', ylabel = 'Payoff ' + r'$p_H$', title = 'U - ' + r'$p_H$')
|
488
|
+
ax_V = figure_t.scatter(V_ave, V_pi_ave, ax_V, V_color, alpha, xlabel = 'V', ylabel = 'Payoff ' + r'$p_D$', title = 'V - ' + r'$p_D$')
|
489
489
|
|
490
490
|
return ax_U, ax_V
|
491
491
|
|
492
492
|
|
493
|
+
|
494
|
+
def video_fig(mod, ax_list = None, num_itv = 100, U_color = 'Purples', V_color = 'Greens'):
|
495
|
+
'''
|
496
|
+
Plot distribution dynamics over time, of U, V population and payoff.
|
497
|
+
|
498
|
+
mod: simulation.model object
|
499
|
+
ax_list: a 2*2 list of ax, or None (a new 2*2 ax_list will be created)
|
500
|
+
num_itv: how many time intervals to plot
|
501
|
+
U_color & V_color: matplotlib color map, color for U, V population and payoff.
|
502
|
+
'''
|
503
|
+
|
504
|
+
if num_itv > mod.max_record:
|
505
|
+
raise ValueError('num_itv too large, larger than mod.max_record')
|
506
|
+
idx_step = int(mod.max_record / num_itv)
|
507
|
+
ave_U = []
|
508
|
+
ave_V = []
|
509
|
+
ave_Upi = []
|
510
|
+
ave_Vpi = []
|
511
|
+
|
512
|
+
for lower_idx in range(0, mod.max_record, idx_step):
|
513
|
+
ave_U.append(figure_t.ave_interval_1D(mod.U, lower_idx, lower_idx + idx_step))
|
514
|
+
ave_V.append(figure_t.ave_interval_1D(mod.V, lower_idx, lower_idx + idx_step))
|
515
|
+
ave_Upi.append(figure_t.ave_interval_1D(mod.Upi, lower_idx, lower_idx + idx_step))
|
516
|
+
ave_Vpi.append(figure_t.ave_interval_1D(mod.Vpi, lower_idx, lower_idx + idx_step))
|
517
|
+
|
518
|
+
if ax_list == None:
|
519
|
+
|
520
|
+
_, ax_list = plt.subplots(2, 2, figsize = (9.6, 12.8), dpi = 300)
|
521
|
+
|
522
|
+
for i in range(2):
|
523
|
+
for j in range(2):
|
524
|
+
ax_list[i, j].spines['top'].set_visible(False)
|
525
|
+
ax_list[i, j].spines['right'].set_visible(False)
|
526
|
+
ax_list[i, j].set_xlabel('Patches')
|
527
|
+
ax_list[i, j].set_ylabel('Time')
|
528
|
+
ax_list[i, j].set_xlim([0, mod.M - 1])
|
529
|
+
ax_list[i, j].set_ylim([0, mod.maxtime])
|
530
|
+
|
531
|
+
|
532
|
+
im = ax_list[0, 0].imshow(ave_U, cmap = U_color)
|
533
|
+
ax_list[0, 0].get_figure().colorbar(im, ax = ax_list[0, 0])
|
534
|
+
ax_list[0, 0].set_title('Population U over time')
|
535
|
+
|
536
|
+
im = ax_list[0, 1].imshow(ave_V, cmap = V_color)
|
537
|
+
ax_list[0, 1].get_figure().colorbar(im, ax = ax_list[0, 1])
|
538
|
+
ax_list[0, 1].set_title('Population V over time')
|
539
|
+
|
540
|
+
im = ax_list[1, 0].imshow(ave_Upi, cmap = U_color)
|
541
|
+
ax_list[1, 0].get_figure().colorbar(im, ax = ax_list[1, 0])
|
542
|
+
ax_list[1, 0].set_title('Payoff ' + r'$p_H$' + ' over time')
|
543
|
+
|
544
|
+
im = ax_list[1, 1].imshow(ave_Vpi, cmap = V_color)
|
545
|
+
ax_list[1, 1].get_figure().colorbar(im, ax = ax_list[1, 1])
|
546
|
+
ax_list[1, 1].set_title('Payoff ' + r'$p_D$' + ' over time')
|
547
|
+
|
548
|
+
return ax_list
|
549
|
+
|
piegy/test_var.py
CHANGED
@@ -347,12 +347,12 @@ def var_pi1(var, values, var_dirs, ax_U = None, ax_V = None, start = 0.95, end =
|
|
347
347
|
var_disp = PATCH_VAR_DISP[var]
|
348
348
|
|
349
349
|
ax_U.set_xlabel(var_disp)
|
350
|
-
ax_U.set_ylabel('Payoff ' + r'$
|
350
|
+
ax_U.set_ylabel('Payoff ' + r'$p_H$')
|
351
351
|
ax_U.plot(values, U_ave, DOTTED_CURVE_TYPE, color = U_color)
|
352
352
|
ax_U.set_title(figure_t.gen_title(var_disp + r'$\,-\,p_U$', start, end))
|
353
353
|
|
354
354
|
ax_V.set_xlabel(var_disp)
|
355
|
-
ax_V.set_ylabel('Payoff ' + r'$
|
355
|
+
ax_V.set_ylabel('Payoff ' + r'$p_D$')
|
356
356
|
ax_V.plot(values, V_ave, DOTTED_CURVE_TYPE, color = V_color)
|
357
357
|
ax_V.set_title(figure_t.gen_title(var_disp + r'$\,-\,p_V$', start, end))
|
358
358
|
|
piegy/tools/figure_tools.py
CHANGED
@@ -172,7 +172,7 @@ def ave_interval(data, start_index, end_index):
|
|
172
172
|
def ave_interval_1D(data, start_index, end_index):
|
173
173
|
'''
|
174
174
|
Calculate average value of data over an interval. Return a 1D np.array.
|
175
|
-
Assume data is 3D and has shape (
|
175
|
+
Assume data is 3D and has shape (N x M x K). Then implicitly 'compress' that N x M to 1D (NM) and takes average on the 3rd axis K.
|
176
176
|
|
177
177
|
Input:
|
178
178
|
data: 3D np.array or list. One of its dimensions must have size 1. Will take average on the 3rd axis.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
piegy/simulation.py,sha256=JG9c8d2s52DFxFYcbPjujon2nrqn1CA_B7RjjPgWArQ,20969
|
2
|
+
piegy/analysis.py,sha256=2GBsBbi7LdstSEAM0-F2bfL2kHu3MElcrw8bxZ1x6LI,8719
|
3
|
+
piegy/data_tools.py,sha256=auliVb88qKQmCX7LEDgKQvhBcwFTCXBEWKtjJ4_-rTU,3446
|
4
|
+
piegy/__init__.py,sha256=8hLweLATjR8WZ_ciSh357KdiShUA2s4uKGNd9LLxstI,2129
|
5
|
+
piegy/__version__.py,sha256=v9SoW27eJbN6GI_KzBE9NnqeA0rAoVKg47295CD9TFI,2260
|
6
|
+
piegy/figures.py,sha256=0WDaFQzKRAeE--mLS8DrcIGEhhpJeyE7M-GRLUpnIyo,20262
|
7
|
+
piegy/test_var.py,sha256=bURrIKv2AI9HQCJbLBk_4IA_qaba-9TyHPzNEJsvXqM,23513
|
8
|
+
piegy/simulation_py.py,sha256=vVQbb76ui8Dw1msdk_GaNDNYVkMEUG-Q3lMsCx-8KNs,29503
|
9
|
+
piegy/build_info.py,sha256=qgB-dn-1oBzxDIwFOrUnyutsB54QPfGERmDhb-DzmPM,250
|
10
|
+
piegy/videos.py,sha256=UfizXDFvS2teGUq0l4SYdwOMEBWkG03mF7FOaNODB1k,10673
|
11
|
+
piegy/C_core/patch.c,sha256=OVG4qyTpRs0hDa5eMRdPyNUmZk2G-FogBVq7Li381PQ,1032
|
12
|
+
piegy/C_core/model.c,sha256=lAIQ2-r6GDBZNQUnxaj6EWiMLNI52-1vnYC6CPY8KyY,2854
|
13
|
+
piegy/C_core/runner.c,sha256=PqiSQOvL_r9U9eNke3TMvEDBlzBq3BQpR9LJ_-0Y5Yk,1650
|
14
|
+
piegy/C_core/Makefile,sha256=TljAGmo-fYI0HZ6Uemqy8HfcUHw8wfOVu4n8-KW02ac,2092
|
15
|
+
piegy/C_core/sim_funcs.c,sha256=jCkXe6aUw0GvhnRKIHVKmcxX6egn41O6IGt9jM0pVr0,19301
|
16
|
+
piegy/C_core/model.h,sha256=hmIqOwznkB8rhG-JeEUmn7JBDiWHkNrR9qfy1wN7X1E,1180
|
17
|
+
piegy/C_core/piegyc.pypy311-pp73-darwin.so,sha256=yhdlhm8fLjposAa4dx7PsnlSOVmsVkZ3LkgD5Znik6o,67656
|
18
|
+
piegy/C_core/patch.h,sha256=EkN2mjV-aDV2JzQV-hFpjs0NteLg4iBj-pMeoAZRtWo,854
|
19
|
+
piegy/C_core/sim_funcs.h,sha256=M6YEWOWf3sNbu0YKvRb4gEucVV_E-E5j2h9mUOUd5CE,15785
|
20
|
+
piegy/tools/find_C.py,sha256=z-gEicKdWKwBpAmUggW_1V9XA5yt1PqfsG5KjGXwa6o,513
|
21
|
+
piegy/tools/__init__.py,sha256=eYOl_HJHDonYexfrmKh3koOlxvtSo46vH6jHvCEEB4k,300
|
22
|
+
piegy/tools/file_tools.py,sha256=ncxFWeHfIE-GYLQlOrahFlhBgqPyuY3R5_93fpQeCEs,630
|
23
|
+
piegy/tools/figure_tools.py,sha256=yaWahxuTY7PL-6Bt7C2TwmrQvkWsJILsp6R5Omfmc3c,6954
|
24
|
+
piegy-2.3.1.dist-info/RECORD,,
|
25
|
+
piegy-2.3.1.dist-info/WHEEL,sha256=4X0suYJrlcp_yIet7d4pQ5btDfRmOBx_QjfSXwlpgbE,143
|
26
|
+
piegy-2.3.1.dist-info/top_level.txt,sha256=k4QLYL8PqdqDuy95-4NZD_FVLqJDsmq67tpKkBn4vMw,6
|
27
|
+
piegy-2.3.1.dist-info/METADATA,sha256=U6AW7l9Q0BE9vW61aV7nR1nGYg0Qg9zHWmJL-GKAgKE,5436
|
28
|
+
piegy-2.3.1.dist-info/licenses/LICENSE.txt,sha256=wfzEht_CxOcfGGmg3f3at4mWJb9rTBjA51mXLl_3O3g,1498
|
piegy-2.2.3.dist-info/RECORD
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
piegy/simulation.py,sha256=JG9c8d2s52DFxFYcbPjujon2nrqn1CA_B7RjjPgWArQ,20969
|
2
|
-
piegy/analysis.py,sha256=2GBsBbi7LdstSEAM0-F2bfL2kHu3MElcrw8bxZ1x6LI,8719
|
3
|
-
piegy/data_tools.py,sha256=auliVb88qKQmCX7LEDgKQvhBcwFTCXBEWKtjJ4_-rTU,3446
|
4
|
-
piegy/__init__.py,sha256=pBt2quZkkHVm_x29TuSEAkLIYCKzNAWIXujCUwxkdTw,2105
|
5
|
-
piegy/__version__.py,sha256=e9G4Rk8KlSekkvXqNaC9iMw_lsp5nuPvVRMfG1mi4A8,2062
|
6
|
-
piegy/figures.py,sha256=-eH7rGP2ff2khP2PVDBc_I2Yuy7GO5xfr2TurAJgPfI,17996
|
7
|
-
piegy/test_var.py,sha256=pBmkoHKU3FRj2E7flVz1_2GYs71JIONruDcyYm94SG4,23513
|
8
|
-
piegy/simulation_py.py,sha256=vVQbb76ui8Dw1msdk_GaNDNYVkMEUG-Q3lMsCx-8KNs,29503
|
9
|
-
piegy/build_info.py,sha256=S_Pmn9rTQGlDxny7SlCEnSnuWXPuzyM_hk6avlM7uM4,250
|
10
|
-
piegy/videos.py,sha256=UfizXDFvS2teGUq0l4SYdwOMEBWkG03mF7FOaNODB1k,10673
|
11
|
-
piegy/C_core/patch.c,sha256=OVG4qyTpRs0hDa5eMRdPyNUmZk2G-FogBVq7Li381PQ,1032
|
12
|
-
piegy/C_core/model.c,sha256=lAIQ2-r6GDBZNQUnxaj6EWiMLNI52-1vnYC6CPY8KyY,2854
|
13
|
-
piegy/C_core/runner.c,sha256=PqiSQOvL_r9U9eNke3TMvEDBlzBq3BQpR9LJ_-0Y5Yk,1650
|
14
|
-
piegy/C_core/Makefile,sha256=TljAGmo-fYI0HZ6Uemqy8HfcUHw8wfOVu4n8-KW02ac,2092
|
15
|
-
piegy/C_core/sim_funcs.c,sha256=gbJcg4yFJKmW_Hnpxt5Sv7XZ62SX_Lh8J8__TSVnK5g,19371
|
16
|
-
piegy/C_core/model.h,sha256=hmIqOwznkB8rhG-JeEUmn7JBDiWHkNrR9qfy1wN7X1E,1180
|
17
|
-
piegy/C_core/piegyc.pypy311-pp73-darwin.so,sha256=8mLJY86SvVmxQtgVAUi-QOM-M2wJmMzq9b1pThPgB7I,67656
|
18
|
-
piegy/C_core/patch.h,sha256=8qAPv6GXguRRasi9W2OQAEgtIjQ0xjCvuRrgAntQ628,884
|
19
|
-
piegy/C_core/sim_funcs.h,sha256=U0BvM3Vscv5Bxksr4c6jpa2R51Y7eYugdqzrDSHhW3A,15864
|
20
|
-
piegy/tools/find_C.py,sha256=z-gEicKdWKwBpAmUggW_1V9XA5yt1PqfsG5KjGXwa6o,513
|
21
|
-
piegy/tools/__init__.py,sha256=eYOl_HJHDonYexfrmKh3koOlxvtSo46vH6jHvCEEB4k,300
|
22
|
-
piegy/tools/file_tools.py,sha256=ncxFWeHfIE-GYLQlOrahFlhBgqPyuY3R5_93fpQeCEs,630
|
23
|
-
piegy/tools/figure_tools.py,sha256=iSGIwjZljs0Sso4sNMFB0qH7Dq_DI88xXTZ_b5C0pEI,6952
|
24
|
-
piegy-2.2.3.dist-info/RECORD,,
|
25
|
-
piegy-2.2.3.dist-info/WHEEL,sha256=4X0suYJrlcp_yIet7d4pQ5btDfRmOBx_QjfSXwlpgbE,143
|
26
|
-
piegy-2.2.3.dist-info/top_level.txt,sha256=k4QLYL8PqdqDuy95-4NZD_FVLqJDsmq67tpKkBn4vMw,6
|
27
|
-
piegy-2.2.3.dist-info/METADATA,sha256=w9k5yUuZ1KKU5LFuoj0ZQ8BE6YJklT8waU2uOGQRIus,5436
|
28
|
-
piegy-2.2.3.dist-info/licenses/LICENSE.txt,sha256=wfzEht_CxOcfGGmg3f3at4mWJb9rTBjA51mXLl_3O3g,1498
|
File without changes
|
File without changes
|
File without changes
|