-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcollection_errors.log
More file actions
7075 lines (7019 loc) · 405 KB
/
collection_errors.log
File metadata and controls
7075 lines (7019 loc) · 405 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[1m============================= test session starts ==============================[0m
platform darwin -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0 -- /Users/4d/.pyenv/versions/3.12.11/bin/python
cachedir: .pytest_cache
hypothesis profile 'default'
metadata: {'Python': '3.12.11', 'Platform': 'macOS-26.3-arm64-arm-64bit', 'Packages': {'pytest': '8.4.2', 'pluggy': '1.6.0'}, 'Plugins': {'jaxtyping': '0.3.3', 'anyio': '4.9.0', 'hypothesis': '6.135.29', 'html': '4.1.1', 'Faker': '37.4.0', 'xdist': '3.8.0', 'timeout': '2.4.0', 'metadata': '3.1.1', 'cov': '4.1.0', 'asyncio': '1.3.0', 'mock': '3.14.1', 'pytest_httpserver': '1.1.3', 'benchmark': '5.1.0'}}
benchmark: 5.1.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/4d/Documents/GitHub/GEO-INFER
configfile: pytest.ini
testpaths: .
plugins: jaxtyping-0.3.3, anyio-4.9.0, hypothesis-6.135.29, html-4.1.1, Faker-37.4.0, xdist-3.8.0, timeout-2.4.0, metadata-3.1.1, cov-4.1.0, asyncio-1.3.0, mock-3.14.1, pytest_httpserver-1.1.3, benchmark-5.1.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
[1mcollecting ... [0m
[1m----------------------------- live log collection ------------------------------[0m
06:32:15 [[32m INFO[0m] arviz_base not installed (preview.py:16)
06:32:15 [[32m INFO[0m] arviz_stats not installed (preview.py:30)
06:32:15 [[32m INFO[0m] arviz_plots not installed (preview.py:43)
06:32:16 [[32m INFO[0m] Available tools: ['rxinfer', 'bayeux', 'pymdp', 'pymc', 'pyro', 'jax'] (integration.py:62)
06:32:16 [[32m INFO[0m] Available tools: ['rxinfer', 'bayeux', 'pymdp', 'pymc', 'pyro', 'jax'] (integration.py:62)
06:32:16 [[32m INFO[0m] Available tools: ['rxinfer', 'bayeux', 'pymdp', 'pymc', 'pyro', 'jax'] (integration.py:62)
06:32:17 [[32m INFO[0m] Agent registry initialized (agent_registry.py:73)
06:32:17 [[32m INFO[0m] Messaging service initialized (messaging.py:138)
06:32:17 [[32m INFO[0m] Telemetry service initialized (telemetry.py:275)
06:32:17 [[33m WARNING[0m] Integration modules not available: No module named 'geo_infer_time.core.temporal' (population.py:32)
06:32:21 [[33m WARNING[0m] No GPU acceleration backends available (gpu_acceleration.py:26)
06:32:21 [[33m WARNING[0m] Integration modules not available: cannot import name 'OptimizationBase' from 'geo_infer_math.core.optimization' (/Users/4d/Documents/GitHub/GEO-INFER/GEO-INFER-MATH/src/geo_infer_math/core/optimization.py) (aco.py:33)
06:32:21 [[33m WARNING[0m] Integration modules not available: cannot import name 'OptimizationBase' from 'geo_infer_math.core.optimization' (/Users/4d/Documents/GitHub/GEO-INFER/GEO-INFER-MATH/src/geo_infer_math/core/optimization.py) (pso.py:33)
06:32:21 [[33m WARNING[0m] Utility modules not yet implemented: No module named 'geo_infer_ant.utils.logging' (__init__.py:93)
06:32:21 [[32m INFO[0m] Registered interface BDIAgentInterface for agent type bdi (agent_factory.py:43)
06:32:23 [[33m WARNING[0m] GEO-INFER-ORG not available, organizational features disabled (organizational.py:14)
06:32:23 [[33m WARNING[0m] GEO-INFER-SEC not available, security features disabled (security.py:14)
06:32:23 [[33m WARNING[0m] GEO-INFER-NORMS not available, normative features disabled (normative.py:14)
collected 1798 items / 283 errors / 1 skipped
<Dir GEO-INFER>
<Dir GEO-INFER-ACT>
<Dir tests>
<Package unit>
<Module test_core.py>
Tests for GEO-INFER-ACT core functionality.
<UnitTestCase TestActiveInferenceModel>
Tests for ActiveInferenceModel class.
<TestCaseFunction test_act>
Test action selection.
<TestCaseFunction test_compute_free_energy>
Test free energy computation.
<TestCaseFunction test_get_current_state>
Test getting current state.
<TestCaseFunction test_get_history>
Test getting history.
<TestCaseFunction test_initialization>
Test model initializes correctly.
<TestCaseFunction test_perceive>
Test belief updating via perceive.
<TestCaseFunction test_reset>
Test model reset.
<TestCaseFunction test_set_generative_model>
Test setting generative model.
<TestCaseFunction test_step>
<UnitTestCase TestBayesianBeliefUpdate>
Tests for BayesianBeliefUpdate class.
<TestCaseFunction test_compute_prediction_error>
Test precision-weighted prediction error.
<TestCaseFunction test_compute_surprise>
Test surprise computation.
<TestCaseFunction test_update_categorical>
Test categorical belief update.
<TestCaseFunction test_update_gaussian>
Test Gaussian belief update.
<UnitTestCase TestDynamicCausalModel>
Tests for DynamicCausalModel class.
<TestCaseFunction test_estimate_parameters>
Test parameter estimation.
<TestCaseFunction test_generate_observations>
Test observation generation.
<TestCaseFunction test_integrate_dynamics>
Test dynamics integration.
<TestCaseFunction test_observation_equation>
Test observation equation.
<TestCaseFunction test_set_noise_parameters>
Test setting noise parameters.
<TestCaseFunction test_set_parameters>
Test setting model parameters.
<TestCaseFunction test_state_equation>
Test state evolution equation.
<UnitTestCase TestFreeEnergyCalculator>
Tests for FreeEnergyCalculator class.
<TestCaseFunction test_compute_categorical>
<TestCaseFunction test_compute_categorical_free_energy>
Test categorical free energy computation.
<TestCaseFunction test_compute_expected_free_energy>
Test expected free energy computation.
<TestCaseFunction test_compute_gaussian_free_energy>
Test Gaussian free energy computation.
<UnitTestCase TestGenerativeModel>
Tests for GenerativeModel class.
<TestCaseFunction test_add_nested_level>
Test adding nested level.
<TestCaseFunction test_compute_free_energy>
Test free energy computation.
<TestCaseFunction test_enable_h3_spatial>
Test H3 spatial enabling.
<TestCaseFunction test_enable_spatial_navigation>
Test enabling spatial navigation mode.
<TestCaseFunction test_hierarchical_initialization>
Test hierarchical model initialization.
<TestCaseFunction test_hierarchical_levels>
Test hierarchical level initialization.
<TestCaseFunction test_hierarchical_update_beliefs>
Test belief updating in hierarchical model.
<TestCaseFunction test_initialization>
Test model initializes correctly.
<TestCaseFunction test_integrate_bayeux>
Test Bayeux integration.
<TestCaseFunction test_integrate_rxinfer>
Test RxInfer integration.
<TestCaseFunction test_markov_blanket_check>
Test Markov blanket independence check.
<TestCaseFunction test_set_preferences>
Test setting preferences.
<TestCaseFunction test_spatial_mode>
Test spatial navigation mode.
<TestCaseFunction test_update_beliefs>
Test belief updating.
<TestCaseFunction test_update_h3_beliefs>
<TestCaseFunction test_update_nested_beliefs>
Test updating nested beliefs.
<UnitTestCase TestMarkovDecisionProcess>
Tests for MarkovDecisionProcess class.
<TestCaseFunction test_get_observation_prob>
Test getting observation probabilities.
<TestCaseFunction test_get_predictive_observation>
Test predictive observation distribution.
<TestCaseFunction test_get_predictive_state>
Test predictive state distribution.
<TestCaseFunction test_get_transition_prob>
Test getting transition probabilities.
<TestCaseFunction test_initialization>
Test MDP initializes correctly.
<TestCaseFunction test_observe>
Test observation sampling.
<TestCaseFunction test_set_observation_matrix>
Test setting observation matrix.
<TestCaseFunction test_set_transition_matrix>
Test setting transition matrix.
<TestCaseFunction test_simulate>
Test trajectory simulation.
<TestCaseFunction test_transition>
Test state transition.
<TestCaseFunction test_update_belief>
Test belief updating.
<UnitTestCase TestVariationalInference>
Tests for VariationalInference class.
<TestCaseFunction test_update_categorical>
Test mean-field update for categorical.
<TestCaseFunction test_update_gaussian>
Test mean-field update for Gaussian.
<UnitTestCase TestPolicySelector>
Tests for PolicySelector class.
<TestCaseFunction test_compute_expected_free_energy>
<TestCaseFunction test_select_policy>
<Package integration>
<Module test_integration.py>
<UnitTestCase TestModernToolsIntegration>
Tests for ModernToolsIntegration.
<TestCaseFunction test_check_available_tools>
Test checking available tools.
<TestCaseFunction test_create_pymdp_agent>
Test pymdp integration if available.
<Module test_space_integration.py>
Integration tests for ACT-SPACE module integration.
Tests the cross-module integration between GEO-INFER-ACT and GEO-INFER-SPACE,
verifying that the geo_infer_space import is safely wrapped in try/except
and that spatial functions work with or without the SPACE module available.
<Class TestSpaceImportSafety>
Test that SPACE module imports are safely wrapped.
<Function test_integration_module_imports_without_space>
Test that the integration module loads even without geo_infer_space.
<Function test_space_h3_fallback>
Test that space_h3 variable is None when SPACE unavailable.
<Function test_h3_spatial_model_creation>
Test H3 spatial model creation (uses h3 directly, not space module).
<Class TestSpaceIntegrationFunction>
Test the integrate_space function behavior.
<Function test_disabled_integration_returns_empty>
Test that disabled integration returns empty dict.
<Function test_no_endpoint_returns_empty>
Test that missing endpoint returns empty dict.
<Function test_invalid_endpoint_returns_error>
Test that invalid endpoint returns error gracefully.
<Class TestMultiAgentSpatialIntegration>
Test multi-agent model spatial integration capabilities.
<Function test_multi_agent_model_has_spatial_mode>
Test that MultiAgentModel can be created with spatial attributes.
<Function test_multi_agent_coordination_without_spatial>
Test coordination works in non-spatial mode.
<Function test_multi_agent_step_integration>
Test that multi-agent step works regardless of spatial module.
<Class TestModernToolsIntegration>
Test the modern tools integration hub.
<Function test_integration_hub_creates>
Test that ModernToolsIntegration can be instantiated.
<Function test_unavailable_tool_raises>
Test that using unavailable tool raises RuntimeError.
<Module test_act_models_real.py>
<Class TestRealActiveInferenceModels>
<Function test_climate_model_initialization_and_step>
Test ClimateModel initialization and stepping.
<Function test_ecological_model_initialization_and_step>
Test EcologicalModel initialization and stepping.
<Function test_urban_model_simulation>
Test UrbanModel multi-agent simulation.
<Package unit>
<Module test_analysis.py>
<UnitTestCase TestActiveInferenceAnalyzer>
Tests for ActiveInferenceAnalyzer.
<TestCaseFunction test_analyze_action_selection_patterns>
Test action selection analysis.
<TestCaseFunction test_analyze_free_energy_patterns>
Test free energy analysis.
<TestCaseFunction test_analyze_perception_patterns>
Test perception analysis.
<TestCaseFunction test_generate_comprehensive_report>
Test report generation.
<TestCaseFunction test_record_step>
Test recording steps.
<TestCaseFunction test_save_traces_to_csv>
Test saving traces.
<UnitTestCase TestVisualizationFunctions>
Tests for shared visualization functions.
<TestCaseFunction test_create_shared_visualizations>
Test creating visualizations.
<Module test_api.py>
<UnitTestCase TestActiveInferenceInterface>
Tests for ActiveInferenceInterface.
<TestCaseFunction test_create_model_categorical>
Test creating categorical model.
<TestCaseFunction test_get_free_energy>
Test getting free energy.
<TestCaseFunction test_select_policy>
Test policy selection.
<TestCaseFunction test_set_preferences>
Test setting preferences.
<TestCaseFunction test_update_beliefs_categorical>
Test updating beliefs for categorical model.
<TestCaseFunction test_update_beliefs_gaussian>
<UnitTestCase TestClient>
Tests for API Client.
<TestCaseFunction test_initialization>
Test client initializes.
<UnitTestCase TestEndpoints>
Tests for API endpoints.
<TestCaseFunction test_create_endpoints>
Test creating endpoints.
<Module test_climate_model.py>
Unit tests for the Climate Active Inference Model.
Tests the ClimateModel class which implements climate adaptation modeling
using Active Inference with temperature and CO2 state factors.
<Class TestClimateModelInit>
Test ClimateModel initialization.
<Function test_default_initialization>
Test that ClimateModel initializes with correct dimensions.
<Function test_inherits_active_inference>
Test that ClimateModel is a valid ActiveInferenceModel.
<Function test_generative_model_set>
Test that the generative model is properly configured.
<Class TestClimateModelMatrices>
Test the climate model's generative model matrices.
<Function test_likelihood_a_structure>
Test A matrix (likelihood) has correct shape and normalization.
<Function test_transition_b_normalization>
Test B matrix columns sum to 1 for each state-action pair.
<Function test_preferences_encode_climate_goals>
Test C matrix encodes preference for normal temperature and safe CO2.
<Function test_prior_d_initial_state>
Test D matrix starts at normal/safe conditions.
<Class TestClimateModelStep>
Test climate model step execution.
<Function test_step_with_observations>
Test step with explicit observations.
<Function test_step_default_observation>
Test step with default (None) observation.
<Function test_climate_crisis_observation_shifts_beliefs>
Test that crisis observations shift beliefs appropriately.
<Function test_config_override>
Test that custom config can be provided.
<Module test_dynamic_causal_model.py>
Unit tests for the Dynamic Causal Model.
Tests the DynamicCausalModel class which implements continuous-time
active inference using stochastic differential equations and
Kalman filtering for state estimation.
<Class TestDCMInitialization>
Test DCM initialization and parameter setup.
<Function test_default_initialization>
Test that DCM initializes with correct dimensions.
<Function test_matrix_dimensions>
Test that internal matrices have correct shapes.
<Function test_initial_state_is_zero>
Test that initial state vector is zero.
<Function test_custom_dt>
Test custom time step.
<Class TestDCMDynamics>
Test DCM state evolution and observation equations.
<Function test_state_equation_linear>
Test state equation computes dx/dt = Ax + Bu.
<Function test_observation_equation_output>
Test observation equation produces output of correct dimension.
<Function test_integrate_dynamics_trajectory_shape>
Test that dynamics integration produces correct trajectory shape.
<Function test_stable_dynamics_decay>
Test that with negative eigenvalues, states decay toward zero.
<Class TestDCMObservations>
Test observation generation from state trajectories.
<Function test_generate_observations_shape>
Test observation generation produces correct shape.
<Function test_observation_noise_nonzero>
Test that observations include noise (not exactly C*x).
<Class TestDCMParameterEstimation>
Test DCM parameter estimation from data.
<Function test_estimate_parameters_returns_dict>
Test that parameter estimation returns expected structure.
<Function test_estimated_matrices_shapes>
Test that estimated matrices have correct shapes.
<Function test_set_parameters>
Test manual parameter setting.
<Function test_set_noise_parameters>
Test manual noise parameter setting.
<Module test_ecological_model.py>
Unit tests for the Ecological Active Inference Model.
Tests the EcologicalModel class which implements ecological niche modeling
using Active Inference with hidden states for resources and predation risk.
<Class TestEcologicalModelInit>
Test EcologicalModel initialization and matrix construction.
<Function test_default_initialization>
Test that default initialization creates valid model dimensions.
<Function test_a_matrix_construction>
Test likelihood matrix A has correct structure and normalization.
<Function test_b_matrix_construction>
Test transition matrix B has valid probability structure.
<Function test_c_matrix_preferences>
Test preference matrix C encodes ecologically meaningful preferences.
<Function test_d_matrix_priors>
Test prior matrix D sums to valid distributions.
<Class TestEcologicalModelDynamics>
Test ecological model simulation dynamics.
<Function test_step_returns_valid_structure>
Test that a step returns beliefs, action, and observation.
<Function test_step_default_observation>
Test that step works with default observation.
<Function test_multiple_steps_produce_different_beliefs>
Test that sequential observations lead to belief evolution.
<Class TestEcologicalModelEdgeCases>
Test edge cases for the ecological model.
<Function test_custom_config_override>
Test that custom A/B/C/D matrices can override defaults.
<Function test_repeated_same_observation>
Test model stability under repeated identical observations.
<Module test_free_energy.py>
Unit tests for the Free Energy Calculator.
Tests the FreeEnergyCalculator class which implements variational free energy
computations for both categorical and Gaussian active inference models.
Free energy F = Complexity - Accuracy serves as the cost function that
agents minimize through perception and action.
<Class TestFreeEnergyInit>
Test FreeEnergyCalculator initialization.
<Function test_initialization>
Test that calculator initializes correctly.
<Class TestCategoricalFreeEnergy>
Test free energy computation for categorical (discrete) models.
<Function test_uniform_beliefs_zero_complexity>
Test that uniform beliefs produce zero complexity (KL = 0 from uniform prior).
<Function test_peaked_beliefs_higher_complexity>
Test that peaked beliefs produce higher complexity than uniform.
<Function test_matching_observations_lower_energy>
Test that observations matching beliefs produce lower free energy.
<Function test_returns_finite_value>
Test that free energy is always finite for valid inputs.
<Function test_dimension_mismatch_handling>
Test that mismatched dimensions are handled gracefully.
<Class TestGaussianFreeEnergy>
Test free energy computation for Gaussian (continuous) models.
<Function test_perfect_observation_low_energy>
Test that observations at the mean produce low free energy.
<Function test_distant_observation_higher_energy>
Test that distant observations produce higher free energy.
<Function test_with_prior>
Test Gaussian free energy with explicit prior.
<Function test_returns_float>
Test that result is a Python float.
<Class TestExpectedFreeEnergy>
Test expected free energy for policy evaluation.
<Function test_basic_computation>
Test that expected free energy computation returns finite value.
<Function test_exploration_bonus_effect>
Test that higher exploration bonus increases epistemic value weight.
<Function test_no_preferences>
Test expected free energy without preferences.
<Class TestComputeDispatch>
Test the general compute dispatch method.
<Function test_categorical_dispatch>
Test dispatch to categorical computation.
<Function test_unsupported_model_type>
Test that unsupported model type raises ValueError.
<Module test_geospatial_ai.py>
Comprehensive tests for advanced geospatial active inference methods.
This module tests the sophisticated geospatial AI functionality including
environmental modeling, resource optimization, multi-scale analysis, and
predictive environmental dynamics.
<UnitTestCase TestEnvironmentalActiveInferenceEngine>
Test suite for EnvironmentalActiveInferenceEngine.
<TestCaseFunction test_environmental_free_energy>
Test environmental free energy computation.
<TestCaseFunction test_environmental_observations>
Test environmental observation processing.
<TestCaseFunction test_environmental_summary>
Test environmental summary generation.
<TestCaseFunction test_initialization>
Test engine initialization.
<TestCaseFunction test_prediction_generation>
Test environmental prediction generation.
<TestCaseFunction test_resource_allocation_optimization>
Test resource allocation optimization.
<TestCaseFunction test_spatial_domain_initialization>
Test spatial domain initialization.
<TestCaseFunction test_uncertainty_analysis>
Test environmental uncertainty analysis.
<UnitTestCase TestMultiScaleHierarchicalAnalyzer>
Test suite for MultiScaleHierarchicalAnalyzer.
<TestCaseFunction test_belief_propagation>
Test hierarchical belief propagation.
<TestCaseFunction test_cross_scale_interactions>
Test cross-scale interaction analysis.
<TestCaseFunction test_emergent_pattern_detection>
Test emergent pattern detection.
<TestCaseFunction test_hierarchy_initialization>
Test hierarchical structure initialization.
<TestCaseFunction test_initialization>
Test analyzer initialization.
<TestCaseFunction test_multi_scale_pattern_analysis>
Test the multi-scale pattern analysis function.
<UnitTestCase TestDataStructures>
Test suite for data structures.
<TestCaseFunction test_environmental_state>
Test EnvironmentalState data structure.
<TestCaseFunction test_resource_allocation>
Test ResourceAllocation data structure.
<TestCaseFunction test_spatial_prediction>
Test SpatialPrediction data structure.
<UnitTestCase TestIntegrationScenarios>
Integration tests for complete workflows.
<TestCaseFunction test_complete_environmental_workflow>
Test complete environmental modeling workflow.
<TestCaseFunction test_hierarchical_environmental_integration>
Test integration between environmental engine and hierarchical analyzer.
<UnitTestCase TestErrorHandling>
Test error handling and edge cases.
<TestCaseFunction test_empty_boundary_handling>
Test handling of empty or invalid boundaries.
<TestCaseFunction test_insufficient_data_for_prediction>
Test prediction generation with insufficient data.
<TestCaseFunction test_invalid_observations>
Test handling of invalid observation data.
<Module test_h3.py>
Comprehensive H3 geospatial active inference tests.
Tests the H3 hexagonal grid functionality including spatial modeling,
belief updating, multi-agent coordination, and visualization capabilities.
<UnitTestCase TestH3Methods>
Test suite for H3 geospatial active inference methods.
<TestCaseFunction test_enable_h3_spatial>
Test enabling H3 spatial functionality in generative models.
<TestCaseFunction test_environmental_active_inference>
Test environmental modeling integration with H3.
<TestCaseFunction test_h3_hierarchical_analysis>
Test hierarchical spatial analysis across H3 resolutions.
<TestCaseFunction test_h3_visualizations>
Test H3 visualization capabilities.
<TestCaseFunction test_infer_over_h3_grid>
Test active inference over H3 grid.
<TestCaseFunction test_multi_agent_h3>
Test multi-agent modeling on H3 grid.
<TestCaseFunction test_spatial_belief_diffusion>
Test belief diffusion across H3 spatial neighbors.
<TestCaseFunction test_update_h3_beliefs>
Test H3 belief updating with spatial observations.
<UnitTestCase TestH3Integration>
Integration tests for H3 with other system components.
<TestCaseFunction test_h3_multi_scale_analysis>
Test multi-scale analysis with H3.
<TestCaseFunction test_h3_with_resource_optimization>
Test H3 integration with resource optimization.
<Module test_markov_decision_process.py>
Unit tests for the Markov Decision Process module.
Tests the MarkovDecisionProcess class which implements discrete
state-space dynamics and observation models for active inference,
including transition sampling, observation generation, and
belief updating via Bayes' rule.
<Class TestMDPInitialization>
Test MDP initialization and validation.
<Function test_default_initialization>
Test MDP initializes with uniform distributions by default.
<Function test_custom_transition_matrix>
Test initialization with custom transition probabilities.
<Function test_invalid_transition_shape_raises>
Test that wrong transition matrix shape raises ValueError.
<Function test_invalid_observation_shape_raises>
Test that wrong observation matrix shape raises ValueError.
<Function test_non_normalized_transition_raises>
Test that non-normalized transition probabilities raise ValueError.
<Class TestMDPTransitions>
Test MDP state transitions.
<Function test_deterministic_transition>
Test deterministic state transitions.
<Function test_stay_action>
Test that stay action keeps state unchanged.
<Function test_get_transition_prob>
Test transition probability retrieval.
<Class TestMDPObservations>
Test MDP observation generation.
<Function test_deterministic_observation>
Test observation with identity observation matrix.
<Function test_get_observation_prob>
Test observation probability retrieval.
<Class TestMDPSimulation>
Test MDP trajectory simulation.
<Function test_simulation_trajectory_lengths>
Test that simulation produces correct trajectory lengths.
<Function test_deterministic_simulation>
Test deterministic simulation mode.
<Function test_stochastic_simulation_varies>
Test that stochastic simulation can produce different outcomes.
<Class TestMDPBeliefUpdating>
Test MDP belief updating via Bayes' rule.
<Function test_belief_update_normalizes>
Test that belief update produces normalized distribution.
<Function test_observation_shifts_belief>
Test that observations shift beliefs toward the correct state.
<Function test_predictive_state>
Test predictive state distribution after action.
<Function test_predictive_observation>
Test predictive observation distribution.
<Class TestMDPMatrixSetting>
Test setting transition and observation matrices.
<Function test_set_transition_matrix>
Test setting transition distribution for specific state-action pair.
<Function test_set_transition_invalid_shape_raises>
Test that wrong shape raises ValueError.
<Function test_set_transition_non_normalized_raises>
Test that non-normalized distribution raises ValueError.
<Function test_set_observation_matrix>
Test setting observation distribution for a specific state.
<Module test_models.py>
<UnitTestCase TestCategoricalModel>
Tests for CategoricalModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_reset>
Test reset.
<TestCaseFunction test_set_likelihood_matrix>
Test setting likelihood matrix.
<TestCaseFunction test_set_preferences>
Test setting preferences.
<TestCaseFunction test_set_transition_matrix>
Test setting transition matrix.
<TestCaseFunction test_step>
Test model step.
<TestCaseFunction test_update_beliefs>
Test belief updating.
<UnitTestCase TestGaussianModel>
Tests for GaussianModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_reset>
Test reset.
<TestCaseFunction test_set_observation_model>
Test setting observation model.
<TestCaseFunction test_set_preferences>
Test setting preferences.
<TestCaseFunction test_set_transition_model>
Test setting transition model.
<TestCaseFunction test_step>
Test model step.
<TestCaseFunction test_update_beliefs>
Test belief updating.
<UnitTestCase TestUrbanModel>
Tests for UrbanModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_step>
Test model step.
<TestCaseFunction test_urban_model_step>
<UnitTestCase TestClimateModel>
Tests for ClimateModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_step>
Test step.
<UnitTestCase TestEcologicalModel>
Tests for EcologicalModel.
<TestCaseFunction test_step>
Test step.
<UnitTestCase TestMultiAgentModel>
Tests for MultiAgentModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_step>
Test model step.
<UnitTestCase TestResourceModel>
Tests for ResourceModel.
<TestCaseFunction test_initialization>
Test initialization.
<TestCaseFunction test_step>
Test model step.
<Function test_multi_agent_h3>
<Function test_resource_h3>
<Module test_policy_selection.py>
Unit tests for the Policy Selection module.
Tests the PolicySelector class which implements policy selection based on
expected free energy minimization, balancing exploration (epistemic value)
and exploitation (pragmatic value) in the active inference framework.
<Class TestPolicySelectorInit>
Test PolicySelector initialization.
<Function test_default_temperature>
Test default temperature parameter.
<Function test_custom_temperature>
Test custom temperature parameter.
<Class TestPolicySelection>
Test policy selection mechanics.
<Function test_select_from_explicit_policies>
Test selecting from an explicit list of policies.
<Function test_probabilities_sum_to_one>
Test that all policy probabilities sum to 1.
<Function test_default_policies_when_empty>
Test that default policies are created when none provided.
<Class TestExpectedFreeEnergyComputation>
Test expected free energy computation for policies.
<Function test_efe_returns_float>
Test that EFE computation returns a float.
<Function test_efe_with_preferences>
Test EFE with explicit preferences.
<Function test_integer_policy_conversion>
Test that integer policies are handled gracefully.
<Function test_risk_averse_vs_seeking>
Test that risk preference modulates expected free energy.
<Class TestPolicyPrecision>
Test policy precision computation.
<Function test_differentiated_policies_higher_precision>
Test that well-differentiated policies produce higher precision.
<Class TestPolicySetEvaluation>
Test evaluation of complete policy sets.
<Function test_evaluate_returns_complete_info>
Test that evaluation returns all expected fields.
<Function test_best_policy_index_valid>
Test that best policy index is within valid range.
<Class TestActionSelection>
Test single action selection.
<Function test_select_action_from_list>
Test selecting a single action from available actions.
<Function test_single_action_returns_it>
Test that a single available action is always returned.
<Function test_empty_actions_returns_none>
Test that empty action list returns None.
<Module test_spatial_agent.py>
Unit tests for SpatialActiveInferenceAgent.
Tests cover:
- H3 cell initialization
- Spatial perception with neighbor influence
- Belief propagation
- Free energy computation
- Spatial policy selection
- Diagnostics and export
<Class TestSpatialActiveInferenceAgentInit>
Tests for agent initialization.
<Function test_default_initialization>
Test agent initializes with defaults.
<Function test_custom_dimensions>
Test agent with custom state/obs dimensions.
<Function test_initialization_from_cells>
Test initialization from explicit cell list.
<Function test_diffusion_rate_clamping>
Test diffusion rate is clamped to [0, 1].
<Function test_uniform_initial_beliefs>
Test beliefs are initially uniform.
<Class TestSpatialPerception>
Tests for spatial perception.
<Function test_basic_perception>
Test basic perception updates beliefs.
<Function test_perception_with_propagation>
Test perception with neighbor propagation.
<Function test_observation_history_recorded>
Test observations are recorded in history.
<Class TestSpatialAction>
Tests for spatial action selection.
<Function test_action_selection>
Test action selection returns valid result.
<Function test_action_history_recorded>
Test actions are recorded in history.
<Function test_policy_distribution_sums_to_one>
Test policy distribution is valid probability.
<Class TestStepFunction>
Tests for full perception-action cycle.
<Function test_step_returns_all_components>
Test step returns beliefs, action, and free energy.
<Function test_multiple_steps>
Test multiple steps accumulate history.
<Class TestDiagnostics>
Tests for diagnostics and export.
<Function test_get_diagnostics>
Test diagnostics returns expected structure.
<Function test_export_results_json>
Test export to JSON file.
<Class TestPreferencesAndModels>
Tests for setting preferences and models.
<Function test_set_preferences>
Test setting preferences per cell.
<Function test_update_precision>
Test updating precision for a cell.
<Class TestReset>
Tests for reset functionality.
<Function test_reset_clears_history>
Test reset clears all history.
<Function test_reset_restores_uniform_beliefs>
Test reset restores uniform beliefs.
<Class TestFreeEnergyComputation>
Tests for free energy computation.
<Function test_free_energy_decreases_with_learning>
Test free energy trend during learning.
<Module test_utils.py>
<UnitTestCase TestConfigUtils>
Tests for config utilities.
<TestCaseFunction test_get_config_value>
Test getting nested config value.
<TestCaseFunction test_merge_configs>
Test merging configs.
<TestCaseFunction test_save_load_config>
Test saving and loading config.
<UnitTestCase TestMathUtils>
Tests for math utilities.
<TestCaseFunction test_categorical_log_likelihood>
Test categorical log likelihood.
<TestCaseFunction test_compute_expected_free_energy>
Test expected free energy.
<TestCaseFunction test_compute_free_energy_categorical>
Test categorical free energy.
<TestCaseFunction test_compute_precision>
<TestCaseFunction test_dirichlet_kl_divergence>
Test Dirichlet KL divergence.
<TestCaseFunction test_entropy>
Test entropy computation.
<TestCaseFunction test_gaussian_log_likelihood>
Test Gaussian log likelihood.
<TestCaseFunction test_kl_divergence>
Test KL divergence.
<TestCaseFunction test_kl_divergence_edge>
<TestCaseFunction test_normalize_distribution>
Test distribution normalization.
<TestCaseFunction test_precision_weighted_error>
Test precision-weighted error.
<TestCaseFunction test_sample_categorical>
Test categorical sampling.
<TestCaseFunction test_sample_dirichlet>
<TestCaseFunction test_softmax>
Test softmax function.
<UnitTestCase TestVisualizationUtils>
Tests for visualization utilities.
<TestCaseFunction test_plot_belief_update>
Test belief update plot.
<TestCaseFunction test_plot_belief_update_viz>
<TestCaseFunction test_plot_free_energy>
Test free energy plot.
<TestCaseFunction test_plot_hierarchical_beliefs>
Test hierarchical belief plotting.
<TestCaseFunction test_plot_markov_blanket>
Test Markov blanket visualization.
<TestCaseFunction test_plot_policies>
Test policies plot.
<UnitTestCase TestAnalysisUtils>
Tests for analysis utilities.
<TestCaseFunction test_analyze_free_energy_patterns>
<TestCaseFunction test_analyze_perception_patterns>
<TestCaseFunction test_record_step>
Test recording step.
<UnitTestCase TestIntegrationUtils>
Tests for integration utilities.
<TestCaseFunction test_create_h3_spatial_model>
Test H3 spatial model creation.
<TestCaseFunction test_integrate_rxinfer>
<TestCaseFunction test_modern_tools_integration>
Test modern tools.
<Module test_variational_inference.py>
Unit tests for the Variational Inference module.
Tests the VariationalInference class which implements variational inference
algorithms for belief updating in active inference models, including
mean-field updates, structured inference, and ELBO computation.
<Class TestVariationalInferenceInit>
Test VariationalInference initialization.
<Function test_default_parameters>
Test default initialization parameters.
<Function test_custom_parameters>
Test custom initialization parameters.
<Class TestMeanFieldUpdate>
Test mean-field variational inference updates.
<Function test_dirichlet_categorical_update>
Test Dirichlet-categorical conjugate update.
<Function test_gaussian_update>
Test Gaussian conjugate update.
<Function test_categorical_shorthand>
Test the categorical update shorthand method.
<Function test_gaussian_shorthand>
Test the Gaussian update shorthand method.
<Function test_default_fallback>
Test that unknown prior types return a copy of prior.
<Class TestStructuredInference>
Test structured variational inference with factor graphs.
<Function test_belief_propagation>
Test belief propagation on a simple factor graph.
<Function test_structured_mean_field>
Test structured mean-field variational inference.
<Function test_invalid_method_raises>
Test that invalid inference method raises ValueError.
<Class TestImportanceSampling>
Test importance sampling for posterior approximation.
<Function test_importance_sampling_gaussian>
Test importance sampling with Gaussian prior.
<Class TestELBO>
Test Evidence Lower Bound computation.
<Function test_gaussian_elbo>
Test ELBO computation for Gaussian distributions.
<Function test_categorical_elbo>
Test ELBO computation for categorical distributions.
<Function test_perfect_match_high_elbo>
Test that perfect observation-posterior match gives higher ELBO.
<Dir GEO-INFER-AG>
<Dir tests>
<Package unit>
<Dir core>
<Module test_agricultural_analysis.py>
Unit tests for the Agricultural Analysis core functionality.
<Class TestAgriculturalAnalysis>
Test suite for AgriculturalAnalysis class.
<Function test_initialization>
Test initialization of AgriculturalAnalysis.
<Function test_validation>
Test input validation.
<Function test_prepare_data>
Test data preparation for model input.
<Function test_run_analysis>
Test running the agricultural analysis.
<Class TestAgriculturalResults>
Test suite for AgriculturalResults class.
<Function test_initialization>
Test initialization of AgriculturalResults.
<Function test_merge_results>
Test merging results with field data.
<Function test_get_metric>
Test getting metrics from results.
<Function test_summary>
Test generating summary statistics.
<Module test_field_boundary.py>
Unit tests for the Field Boundary Manager functionality.
<Class TestFieldBoundaryManager>
Test suite for FieldBoundaryManager class.
<Function test_initialization>
Test initialization of FieldBoundaryManager.
<Function test_add_field>
Test adding a field.
<Function test_remove_field>
Test removing a field.
<Function test_update_field>
Test updating a field.
<Function test_get_field>
Test retrieving a field.
<Function test_get_fields_by_crop>
Test retrieving fields by crop type.
<Function test_get_neighboring_fields>
Test retrieving neighboring fields.
<Function test_extract_fields_from_raster>
Test extracting fields from raster data.
<Function test_export_to_file>
Test exporting fields to file.
<Function test_calculate_areas>
Test area calculation.
<Module test_seasonal_analysis.py>
Unit tests for the Seasonal Analysis core functionality.
<Class TestSeasonalAnalysis>
Test suite for SeasonalAnalysis class.
<Function test_initialization>
Test initialization of SeasonalAnalysis.
<Function test_detect_growing_season_threshold>
Test growing season detection using threshold method.
<Function test_detect_growing_season_derivative>
Test growing season detection using derivative method.
<Function test_identify_phenological_stages>
Test identification of phenological stages.
<Function test_analyze_temporal_trends>
Test analysis of temporal trends.
<Function test_analyze_spatial_temporal_patterns>
Test analysis of spatial-temporal patterns.
<Function test_plot_growing_season>
Test plotting of growing season.
<Module test_sustainability.py>
Unit tests for the Sustainability Assessment core functionality.
<Class TestSustainabilityAssessment>
Test suite for SustainabilityAssessment class.
<Function test_initialization>
Test initialization of SustainabilityAssessment.
<Function test_assess_carbon_sequestration>
Test carbon sequestration assessment.
<Function test_assess_water_usage>
Test water usage assessment.
<Function test_assess_soil_health>
Test soil health assessment.
<Function test_assess_biodiversity>
Test biodiversity assessment.
<Function test_calculate_sustainability_index>
Test calculation of sustainability index.
<Function test_plot_sustainability_metrics>
Test plotting of sustainability metrics.
<Dir GEO-INFER-AGENT>
<Dir tests>
<Dir unit>
<Dir models>
<Module test_active_inference.py>
Tests for the Active Inference agent module.
This module contains unit tests for:
- GenerativeModel
- ActiveInferenceState
- ActiveInferenceAgent
<UnitTestCase TestGenerativeModel>
Test cases for the GenerativeModel class.
<TestCaseFunction test_infer_state>
Test state inference from an observation.
<TestCaseFunction test_initialization>
Test if the model initializes with correct dimensions.
<TestCaseFunction test_predict_next_state>
Test next state prediction.
<TestCaseFunction test_select_action>
Test action selection through expected free energy minimization.
<TestCaseFunction test_to_from_dict>
Test serialization to and from dictionary.
<TestCaseFunction test_update_likelihood>
Test updating the likelihood mapping.
<TestCaseFunction test_update_transition>
Test updating the transition probabilities.
<UnitTestCase TestActiveInferenceState>
Test cases for the ActiveInferenceState class.
<TestCaseFunction test_initialization>
Test if the state initializes correctly.
<TestCaseFunction test_record_action>
Test recording an action.
<TestCaseFunction test_select_action>
Test action selection.
<TestCaseFunction test_to_from_dict>
Test serialization to and from dictionary.
<TestCaseFunction test_update_preferences>
Test updating preferences.
<TestCaseFunction test_update_with_observation>
Test updating state with new observation.
<UnitTestCase TestActiveInferenceAgent>
Test cases for the ActiveInferenceAgent class.
<TestCaseFunction test_action_cycle>
Test the action cycle.
<TestCaseFunction test_action_handlers>
Test action handlers.
<TestCaseFunction test_decision_cycle>
Test the decision cycle using real select_action.
<TestCaseFunction test_full_cycle>
Test a full perception-decision-action cycle with real methods.
<TestCaseFunction test_initialization>
Test if the agent initializes with correct parameters.
<TestCaseFunction test_initialize>
Test agent initialization.
<TestCaseFunction test_perception_cycle>
Test the perception cycle using real perceive method.
<TestCaseFunction test_shutdown>
Test agent shutdown.
<Module test_bdi.py>
Unit tests for BDI agent.
<Class TestBelief>
Tests for the Belief class.
<Function test_belief_initialization>
Test that a belief can be initialized with correct values.
<Function test_belief_update>
Test that a belief can be updated.
<Function test_belief_to_dict>
Test conversion to dictionary.
<Function test_belief_from_dict>
Test creation from dictionary.
<Class TestDesire>
Tests for the Desire class.