metacountregressor 0.1.346__tar.gz → 0.1.348__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 (31) hide show
  1. {metacountregressor-0.1.346/metacountregressor.egg-info → metacountregressor-0.1.348}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/solution.py +24 -7
  3. {metacountregressor-0.1.346 → metacountregressor-0.1.348/metacountregressor.egg-info}/PKG-INFO +1 -1
  4. metacountregressor-0.1.348/version.txt +1 -0
  5. metacountregressor-0.1.346/version.txt +0 -1
  6. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/LICENSE.txt +0 -0
  7. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/MANIFEST.in +0 -0
  8. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/README.md +0 -0
  9. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/README.rst +0 -0
  10. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/__init__.py +0 -0
  11. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/_device_cust.py +0 -0
  12. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/app_main.py +0 -0
  13. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/data_split_helper.py +0 -0
  14. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/halton.py +0 -0
  15. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/helperprocess.py +0 -0
  16. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/main.py +0 -0
  17. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/main_old.py +0 -0
  18. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/metaheuristics.py +0 -0
  19. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/pareto_file.py +0 -0
  20. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/pareto_logger__plot.py +0 -0
  21. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/setup.py +0 -0
  22. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/single_objective_finder.py +0 -0
  23. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor/test_generated_paper2.py +0 -0
  24. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor.egg-info/SOURCES.txt +0 -0
  25. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor.egg-info/dependency_links.txt +0 -0
  26. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor.egg-info/not-zip-safe +0 -0
  27. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor.egg-info/requires.txt +0 -0
  28. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/metacountregressor.egg-info/top_level.txt +0 -0
  29. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/setup.cfg +0 -0
  30. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/setup.py +0 -0
  31. {metacountregressor-0.1.346 → metacountregressor-0.1.348}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 0.1.346
3
+ Version: 0.1.348
4
4
  Summary: Extensive Testing for Estimation of Data Count Models
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -1737,7 +1737,7 @@ class ObjectiveFunction(object):
1737
1737
 
1738
1738
  b = self.get_param_num(dispersion=vector[-1])
1739
1739
  # b = sum(prmVect) + self.is_dispersion(vector[-1])
1740
- max_loops = 100 # Maximum number of loops
1740
+ max_loops = 10 # Maximum number of loops
1741
1741
  counter = 0 # Counter variable to keep track of the number of loops
1742
1742
 
1743
1743
 
@@ -1793,23 +1793,40 @@ class ObjectiveFunction(object):
1793
1793
 
1794
1794
  counter = 0
1795
1795
  while b < self._min_characteristics and counter < max_loops:
1796
-
1796
+ counter += 1
1797
1797
  weights = [1 if x == 0 else 0 for x in only_ints_vals]
1798
1798
  get_rdm_i = random.choices(only_ints, weights=weights)[0]
1799
1799
 
1800
- # todo if only 1 this will get stuck
1800
+ # Safeguard: Check if only one valid value exists to handle the "stuck" case
1801
+ if len(only_ints_vals) == 1 and only_ints_vals[0] == 0:
1802
+ print("Breaking out: only one valid value exists and it is 0.")
1803
+ break
1804
+
1801
1805
  if vector[get_rdm_i] == 0:
1806
+ max_inner_loops = 100 # Limit for the inner loop
1807
+ inner_counter = 0
1802
1808
  while new_j == 0:
1803
- # print('this should only ever be 3 ocasionally 2', self.get_num_discrete_values(get_rdm_i))
1804
- get_rdm_j = random.randint(
1805
- 0, self.get_num_discrete_values(get_rdm_i) - 1)
1809
+ inner_counter += 1
1810
+ if inner_counter > max_inner_loops:
1811
+ print("Breaking out of inner loop: exceeded maximum iterations.")
1812
+ break
1813
+
1814
+ get_rdm_j = random.randint(0, self.get_num_discrete_values(get_rdm_i) - 1)
1806
1815
  new_j = self.get_value(get_rdm_i, get_rdm_j)
1816
+
1817
+ # If the inner loop exited early, check and continue
1818
+ if new_j == 0:
1819
+ print("Inner loop exited without finding a valid value.")
1820
+ break
1821
+
1822
+ # Assign the value after successfully exiting the inner loop
1807
1823
  vector[get_rdm_i] = new_j
1808
1824
  prmVect[get_rdm_i] = new_j
1809
1825
 
1810
1826
  b += new_j
1811
1827
  new_j = 0
1812
1828
 
1829
+
1813
1830
  if hasattr(self, 'forced_variables'):
1814
1831
  self.force_inclusion(vector)
1815
1832
 
@@ -2477,7 +2494,7 @@ class ObjectiveFunction(object):
2477
2494
  layout = vector.copy()
2478
2495
 
2479
2496
  while max_trial <= max_routine and trial_run == 1: # and max_trial <= 200:
2480
-
2497
+
2481
2498
  obj_1, model_mod = self.makeRegression(model_nature, layout=layout, **a)
2482
2499
 
2483
2500
  if obj_best is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 0.1.346
3
+ Version: 0.1.348
4
4
  Summary: Extensive Testing for Estimation of Data Count Models
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -0,0 +1 @@
1
+ 0.1.348
@@ -1 +0,0 @@
1
- 0.1.346