mergeron 2025.739439.6__tar.gz → 2025.739439.9__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.

Potentially problematic release.


This version of mergeron might be problematic. Click here for more details.

Files changed (21) hide show
  1. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/PKG-INFO +1 -1
  2. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/pyproject.toml +4 -2
  3. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/__init__.py +1 -1
  4. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/__init__.py +1 -10
  5. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/guidelines_boundary_functions.py +19 -18
  6. mergeron-2025.739439.9/src/mergeron/perks/__init__.py +20 -0
  7. {mergeron-2025.739439.6/src/mergeron/core → mergeron-2025.739439.9/src/mergeron/perks}/guidelines_boundary_functions_extra.py +16 -14
  8. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/README.rst +0 -0
  9. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/empirical_margin_distribution.py +0 -0
  10. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/ftc_merger_investigations_data.py +0 -0
  11. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/guidelines_boundaries.py +0 -0
  12. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/core/pseudorandom_numbers.py +0 -0
  13. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/data/__init__.py +0 -0
  14. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/data/damodaran_margin_data_serialized.zip +0 -0
  15. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/data/ftc_merger_investigations_data.zip +0 -0
  16. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/gen/__init__.py +0 -0
  17. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/gen/data_generation.py +0 -0
  18. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/gen/data_generation_functions.py +0 -0
  19. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/gen/enforcement_stats.py +0 -0
  20. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/gen/upp_tests.py +0 -0
  21. {mergeron-2025.739439.6 → mergeron-2025.739439.9}/src/mergeron/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mergeron
3
- Version: 2025.739439.6
3
+ Version: 2025.739439.9
4
4
  Summary: Python for analyzing merger enforcement policy
5
5
  License: MIT
6
6
  Keywords: merger enforcement policy,merger guidelines,merger screening,enforcement presumptions,concentration standards,diversion ratio,upward pricing pressure,GUPPI
@@ -15,7 +15,7 @@ keywords = [
15
15
  "upward pricing pressure",
16
16
  "GUPPI",
17
17
  ]
18
- version = "2025.739439.6"
18
+ version = "2025.739439.9"
19
19
  requires-python = ">=3.13,<4.0"
20
20
 
21
21
  # Classifiers list: https://pypi.org/classifiers/
@@ -170,7 +170,9 @@ ignore = [
170
170
  # sphinx (as setup here) gives different results with TypeAlias and typing statement
171
171
  "UP040",
172
172
  ]
173
- isort.split-on-trailing-comma = false
173
+
174
+ [tool.ruff.lint.isort]
175
+ split-on-trailing-comma = false
174
176
 
175
177
  [tool.ruff.lint.pydocstyle]
176
178
  convention = "numpy"
@@ -15,7 +15,7 @@ from ruamel import yaml
15
15
 
16
16
  _PKG_NAME: str = Path(__file__).parent.name
17
17
 
18
- VERSION = "2025.739439.6"
18
+ VERSION = "2025.739439.9"
19
19
 
20
20
  __version__ = VERSION
21
21
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from collections.abc import Callable, Mapping
5
+ from collections.abc import Mapping
6
6
  from decimal import Decimal
7
7
  from types import MappingProxyType
8
8
  from typing import Any
@@ -40,15 +40,6 @@ class GuidelinesBoundary:
40
40
  """Area under the boundary."""
41
41
 
42
42
 
43
- @frozen
44
- class GuidelinesBoundaryCallable:
45
- """A function to generate Guidelines boundary points, along with area and knot."""
46
-
47
- boundary_function: Callable[[ArrayDouble], ArrayDouble]
48
- area: float
49
- s_naught: float = 0
50
-
51
-
52
43
  @frozen
53
44
  class INVTableData:
54
45
  """Represents individual table of FTC merger investigations data."""
@@ -224,14 +224,14 @@ def diversion_share_boundary_wtd_avg(
224
224
  dps: int = 5,
225
225
  ) -> GuidelinesBoundary:
226
226
  R"""
227
- Share combinations on the share-weighted average diversion ratio boundary.
227
+ Share combinations on the share-weighted average diversion share boundary.
228
228
 
229
229
  Parameters
230
230
  ----------
231
231
  _delta_star
232
- Diversion share (:math:`\overline{d} / \overline{r}`)
232
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
233
233
  _r_val
234
- recapture ratio
234
+ Recapture ratio.
235
235
  agg_method
236
236
  Whether "arithmetic mean", "geometric mean", or "distance".
237
237
  weighting
@@ -424,7 +424,7 @@ def diversion_share_boundary_xact_avg(
424
424
  dps: int = 5,
425
425
  ) -> GuidelinesBoundary:
426
426
  R"""
427
- Share combinations for the exact average diversion/share-ratio boundary.
427
+ Share combinations for the exact average diversion share boundary.
428
428
 
429
429
  Notes
430
430
  -----
@@ -462,9 +462,9 @@ def diversion_share_boundary_xact_avg(
462
462
  Parameters
463
463
  ----------
464
464
  _delta_star
465
- Diversion share (:math:`\overline{d} / \overline{r}`).
465
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
466
466
  _r_val
467
- Recapture ratio
467
+ Recapture ratio.
468
468
  recapture_form
469
469
  Whether recapture-ratio is MNL-consistent ("inside-out") or has fixed
470
470
  value for both merging firms ("proportional").
@@ -591,7 +591,7 @@ def diversion_share_boundary_min(
591
591
  Parameters
592
592
  ----------
593
593
  _delta_star
594
- Diversion share (:math:`\overline{d} / \overline{r}`).
594
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
595
595
  _r_val
596
596
  Recapture ratio.
597
597
  recapture_form
@@ -635,7 +635,7 @@ def diversion_share_boundary_max(
635
635
  Parameters
636
636
  ----------
637
637
  _delta_star
638
- Diversion share (:math:`\overline{d} / \overline{r}`).
638
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
639
639
  _
640
640
  Placeholder for recapture ratio included for consistency with other
641
641
  share-ratio boundary functions.
@@ -704,9 +704,9 @@ def lerp[LerpT: (float, MPFloat, ArrayDouble, ArrayBIGINT)](
704
704
  Parameters
705
705
  ----------
706
706
  _x1, _x2
707
- bounds :math:`x_1, x_2` to interpolate between.
707
+ Interpolation bounds :math:`x_1, x_2`.
708
708
  _r
709
- interpolation weight :math:`r` assigned to :math:`x_2`
709
+ Interpolation weight :math:`r` assigned to :math:`x_2`
710
710
 
711
711
  Returns
712
712
  -------
@@ -728,14 +728,15 @@ def lerp[LerpT: (float, MPFloat, ArrayDouble, ArrayBIGINT)](
728
728
 
729
729
 
730
730
  """
731
- if not 0 <= _r <= 1:
732
- raise ValueError("Specified interpolation weight must lie in [0, 1].")
733
- elif _r == 0:
734
- return _x1
735
- elif _r == 1:
736
- return _x2
737
- else:
738
- return fma(_x2, _r, fma(_x1, -_r, _x1))
731
+ match _r:
732
+ case 0:
733
+ return _x1
734
+ case 1:
735
+ return _x2
736
+ case _:
737
+ if not 0 <= _r <= 1:
738
+ raise ValueError("Specified interpolation weight must lie in [0, 1].")
739
+ return fma(_x2, _r, fma(_x1, -_r, _x1))
739
740
 
740
741
 
741
742
  def round_cust(
@@ -0,0 +1,20 @@
1
+ """Constants, types, objects and functions used within this sub-package."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Callable
6
+
7
+ from attrs import frozen
8
+
9
+ from .. import VERSION, ArrayDouble # noqa: TID252
10
+
11
+ __version__ = VERSION
12
+
13
+
14
+ @frozen
15
+ class GuidelinesBoundaryCallable:
16
+ """A function to generate Guidelines boundary points, along with area and knot."""
17
+
18
+ boundary_function: Callable[[ArrayDouble], ArrayDouble]
19
+ area: float
20
+ s_naught: float = 0
@@ -6,17 +6,19 @@ and may provide improved precision than core functions, but tend to have
6
6
  poor performance
7
7
 
8
8
  """
9
+ from __future__ import annotations
9
10
 
10
11
  from typing import Literal
11
12
 
12
13
  import numpy as np
13
14
  from mpmath import mp, mpf # type: ignore
14
- from scipy.spatial.distance import minkowski as distance_function # type: ignore
15
+ from scipy.spatial.distance import minkowski # type: ignore
15
16
  from sympy import lambdify, simplify, solve, symbols # type: ignore
16
17
 
17
18
  from .. import DEFAULT_REC_RATIO, VERSION # noqa: TID252
18
- from . import GuidelinesBoundary, GuidelinesBoundaryCallable, MPFloat
19
- from . import guidelines_boundary_functions as gbf
19
+ from ..core import GuidelinesBoundary, MPFloat # noqa: TID252
20
+ from ..core import guidelines_boundary_functions as gbf # noqa: TID252
21
+ from . import GuidelinesBoundaryCallable
20
22
 
21
23
  __version__ = VERSION
22
24
 
@@ -108,9 +110,9 @@ def diversion_share_boundary_qdtr_wtd_avg(
108
110
  Parameters
109
111
  ----------
110
112
  _delta_star
111
- corollary to GUPPI bound (:math:`\overline{g} / (m^* \cdot \overline{r})`)
113
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
112
114
  _r_val
113
- recapture ratio
115
+ Recapture ratio.
114
116
  weighting
115
117
  Whether "own-share" or "cross-product-share" (or None for simple, unweighted average)
116
118
  recapture_form
@@ -229,9 +231,9 @@ def diversion_share_boundary_distance(
229
231
  Parameters
230
232
  ----------
231
233
  _delta_star
232
- corollary to GUPPI bound (:math:`\overline{g} / (m^* \cdot \overline{r})`)
234
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
233
235
  _r_val
234
- recapture ratio
236
+ Recapture ratio.
235
237
  agg_method
236
238
  Whether "arithmetic mean" or "distance".
237
239
  weighting
@@ -290,11 +292,11 @@ def diversion_share_boundary_distance(
290
292
 
291
293
  match agg_method:
292
294
  case "arithmetic mean":
293
- delta_test = distance_function(
295
+ delta_test = minkowski(
294
296
  (de_1, de_2), (0.0, 0.0), p=1, w=weights_i
295
297
  )
296
298
  case "distance":
297
- delta_test = distance_function(
299
+ delta_test = minkowski(
298
300
  (de_1, de_2), (0.0, 0.0), p=2, w=weights_i
299
301
  )
300
302
 
@@ -409,9 +411,9 @@ def diversion_share_boundary_xact_avg_mp(
409
411
  Parameters
410
412
  ----------
411
413
  _delta_star
412
- Diversion share (:math:`\overline{d} / \overline{r}`).
414
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
413
415
  _r_val
414
- Recapture ratio
416
+ Recapture ratio.
415
417
  recapture_form
416
418
  Whether recapture-ratio is MNL-consistent ("inside-out") or has fixed
417
419
  value for both merging firms ("proportional").
@@ -529,14 +531,14 @@ def _diversion_share_boundary_wtd_avg_autoroot(
529
531
  dps: int = 5,
530
532
  ) -> GuidelinesBoundary:
531
533
  R"""
532
- Share combinations on the share-weighted average diversion ratio boundary.
534
+ Share combinations on the share-weighted average diversion share boundary.
533
535
 
534
536
  Parameters
535
537
  ----------
536
538
  _delta_star
537
- Diversion share (:math:`\overline{d} / \overline{r}`)
539
+ Diversion share, :math:`\overline{d} / \overline{r}` or :math:`\overline{g} / (m^* \cdot \overline{r})`.
538
540
  _r_val
539
- recapture ratio
541
+ Recapture ratio.
540
542
  agg_method
541
543
  Whether "arithmetic mean", "geometric mean", or "distance".
542
544
  weighting