diffindiff 2.5.2__tar.gz → 2.5.3__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 (21) hide show
  1. {diffindiff-2.5.2 → diffindiff-2.5.3}/PKG-INFO +5 -7
  2. {diffindiff-2.5.2 → diffindiff-2.5.3}/README.md +4 -6
  3. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/config.py +3 -3
  4. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/didanalysis.py +44 -8
  5. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/didtools.py +4 -4
  6. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff.egg-info/PKG-INFO +5 -7
  7. {diffindiff-2.5.2 → diffindiff-2.5.3}/setup.py +1 -1
  8. {diffindiff-2.5.2 → diffindiff-2.5.3}/MANIFEST.in +0 -0
  9. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/__init__.py +0 -0
  10. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/didanalysis_helper.py +0 -0
  11. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/diddata.py +0 -0
  12. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/tests/__init__.py +0 -0
  13. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/tests/data/Corona_Hesse.xlsx +0 -0
  14. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/tests/data/counties_DE.csv +0 -0
  15. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/tests/data/curfew_DE.csv +0 -0
  16. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff/tests/tests_diffindiff.py +0 -0
  17. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff.egg-info/SOURCES.txt +0 -0
  18. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff.egg-info/dependency_links.txt +0 -0
  19. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff.egg-info/requires.txt +0 -0
  20. {diffindiff-2.5.2 → diffindiff-2.5.3}/diffindiff.egg-info/top_level.txt +0 -0
  21. {diffindiff-2.5.2 → diffindiff-2.5.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffindiff
3
- Version: 2.5.2
3
+ Version: 2.5.3
4
4
  Summary: diffindiff: Python library for convenient Difference-in-Differences analyses
5
5
  Author: Thomas Wieland
6
6
  Author-email: geowieland@googlemail.com
@@ -29,7 +29,7 @@ A case study that utilizes the diffindiff library is available on [arXiv](https:
29
29
 
30
30
  If you use this software, please cite:
31
31
 
32
- Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.2) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
32
+ Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.3) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
33
33
 
34
34
 
35
35
  ## Installation
@@ -179,11 +179,9 @@ See the /tests directory for usage examples of most of the included functions.
179
179
  This software was developed without the use of AI-generated code. The Continue Agent in Microsoft Visual Studio Code using the GPT-5 mini model (by OpenAI) was used solely to assist in drafting and refining docstrings for documentation. The corresponding guidelines and constraints defined by the author are documented in `AGENTS-docstrings.md` in the [public GitHub repository](https://github.com/geowieland/diffindiff_official).
180
180
 
181
181
 
182
- ## What's new (v2.5.2)
182
+ ## What's new (v2.5.3)
183
183
 
184
184
  - Extensions
185
- - New functions DiffData.get_synthetic_control_weightings() and DiffData.get_synthetic_control_fitmetrics() for accessing control unit weightings and fit metrics of the synthetic control unit
185
+ - Added optional saving of plots in DiffModel plot methods
186
186
  - Bugfixes
187
- - DiffModel.placebo() now checks control group size and returns warning when no. of control units is equal to 1, not allowing any placebo test
188
- - Other
189
- - Some updates of documentation and README
187
+ - Fixed typos in messages
@@ -21,7 +21,7 @@ A case study that utilizes the diffindiff library is available on [arXiv](https:
21
21
 
22
22
  If you use this software, please cite:
23
23
 
24
- Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.2) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
24
+ Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.3) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
25
25
 
26
26
 
27
27
  ## Installation
@@ -171,11 +171,9 @@ See the /tests directory for usage examples of most of the included functions.
171
171
  This software was developed without the use of AI-generated code. The Continue Agent in Microsoft Visual Studio Code using the GPT-5 mini model (by OpenAI) was used solely to assist in drafting and refining docstrings for documentation. The corresponding guidelines and constraints defined by the author are documented in `AGENTS-docstrings.md` in the [public GitHub repository](https://github.com/geowieland/diffindiff_official).
172
172
 
173
173
 
174
- ## What's new (v2.5.2)
174
+ ## What's new (v2.5.3)
175
175
 
176
176
  - Extensions
177
- - New functions DiffData.get_synthetic_control_weightings() and DiffData.get_synthetic_control_fitmetrics() for accessing control unit weightings and fit metrics of the synthetic control unit
177
+ - Added optional saving of plots in DiffModel plot methods
178
178
  - Bugfixes
179
- - DiffModel.placebo() now checks control group size and returns warning when no. of control units is equal to 1, not allowing any placebo test
180
- - Other
181
- - Some updates of documentation and README
179
+ - Fixed typos in messages
@@ -4,15 +4,15 @@
4
4
  # Author: Thomas Wieland
5
5
  # ORCID: 0000-0001-5168-9846
6
6
  # mail: geowieland@googlemail.com
7
- # Version: 1.0.23
8
- # Last update: 2026-07-14 19:48
7
+ # Version: 1.0.24
8
+ # Last update: 2026-07-25 12:31
9
9
  # Copyright (c) 2025-2026 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
12
12
  # Basic config:
13
13
 
14
14
  PACKAGE_NAME = "diffindiff"
15
- PACKAGE_VERSION = "2.5.2"
15
+ PACKAGE_VERSION = "2.5.3"
16
16
 
17
17
  VERBOSE = False
18
18
 
@@ -4,8 +4,8 @@
4
4
  # Author: Thomas Wieland
5
5
  # ORCID: 0000-0001-5168-9846
6
6
  # mail: geowieland@googlemail.com
7
- # Version: 2.4.3
8
- # Last update: 2026-07-14 19:49
7
+ # Version: 2.4.4
8
+ # Last update: 2026-07-23 19:42
9
9
  # Copyright (c) 2024-2026 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -782,7 +782,7 @@ class DiffModel:
782
782
 
783
783
  if len(no_control_conditions) > 0:
784
784
  if len(no_control_conditions) == 1:
785
- print(f"NOTE: Treatment {no_control_conditions[0]} has no control conditions.")
785
+ print(f"NOTE: Treatment '{no_control_conditions[0]}' has no control conditions.")
786
786
  else:
787
787
  print(f"NOTE: Treatments {', '.join(no_control_conditions)} have no control conditions.")
788
788
 
@@ -829,7 +829,9 @@ class DiffModel:
829
829
  plot_size: list = [7, 6],
830
830
  scale_plot: bool = True,
831
831
  show_central_tendency: bool = False,
832
- central_tendency: str = "mean"
832
+ central_tendency: str = "mean",
833
+ save_fig: str = None,
834
+ save_fig_kwargs: dict = {}
833
835
  ):
834
836
 
835
837
  """
@@ -869,6 +871,10 @@ class DiffModel:
869
871
  Show mean/median line for estimates. Default is False.
870
872
  central_tendency : str, optional
871
873
  'mean' or 'median' for central tendency if shown. Default is 'mean'.
874
+ save_fig : str, optional
875
+ If not none, filename of plot to be saved.
876
+ save_fig_kwargs : dict, optional
877
+ Optional arguments for plt.savefig() if save_fig is not None.
872
878
 
873
879
  Returns
874
880
  -------
@@ -1006,6 +1012,9 @@ class DiffModel:
1006
1012
  if plot_grid:
1007
1013
  plt.grid(True)
1008
1014
 
1015
+ if save_fig is not None and isinstance(save_fig, str):
1016
+ plt.savefig(save_fig, **save_fig_kwargs)
1017
+
1009
1018
  plt.show()
1010
1019
 
1011
1020
  return self
@@ -1473,7 +1482,9 @@ class DiffModel:
1473
1482
  y_lim = None,
1474
1483
  plot_title: str = "Treatment time",
1475
1484
  plot_symbol: str = "o",
1476
- treatment_group_only: bool = True
1485
+ treatment_group_only: bool = True,
1486
+ save_fig: str = None,
1487
+ save_fig_kwargs: dict = {}
1477
1488
  ):
1478
1489
 
1479
1490
  """
@@ -1497,6 +1508,10 @@ class DiffModel:
1497
1508
  Symbol used for treatment timing points. Default is 'o'.
1498
1509
  treatment_group_only : bool, optional
1499
1510
  If True, only plot treated units.
1511
+ save_fig : str, optional
1512
+ If not none, filename of plot to be saved.
1513
+ save_fig_kwargs : dict, optional
1514
+ Optional arguments for plt.savefig() if save_fig is not None.
1500
1515
 
1501
1516
  Returns
1502
1517
  -------
@@ -1570,6 +1585,9 @@ class DiffModel:
1570
1585
 
1571
1586
  if y_lim is not None:
1572
1587
  ax.set_ylim(y_lim)
1588
+
1589
+ if save_fig is not None and isinstance(save_fig, str):
1590
+ plt.savefig(save_fig, **save_fig_kwargs)
1573
1591
 
1574
1592
  plt.show()
1575
1593
 
@@ -1595,7 +1613,9 @@ class DiffModel:
1595
1613
  pre_post_ticks: list = ["Pre", "Post"],
1596
1614
  pre_post_barplot = False,
1597
1615
  pre_post_bar_width = 0.5,
1598
- retransform_log_outcome: bool = False
1616
+ retransform_log_outcome: bool = False,
1617
+ save_fig: str = None,
1618
+ save_fig_kwargs: dict = {}
1599
1619
  ):
1600
1620
 
1601
1621
  """
@@ -1642,6 +1662,10 @@ class DiffModel:
1642
1662
  retransform_log_outcome : bool, optional
1643
1663
  If outcome was log-transformed, retransform to original scale for plotting.
1644
1664
  Default is False.
1665
+ save_fig : str, optional
1666
+ If not none, filename of plot to be saved.
1667
+ save_fig_kwargs : dict, optional
1668
+ Optional arguments for plt.savefig() if save_fig is not None.
1645
1669
 
1646
1670
  Returns
1647
1671
  -------
@@ -2044,7 +2068,10 @@ class DiffModel:
2044
2068
 
2045
2069
  if y_lim is not None:
2046
2070
  ax.set_ylim(y_lim)
2047
-
2071
+
2072
+ if save_fig is not None and isinstance(save_fig, str):
2073
+ plt.savefig(save_fig, **save_fig_kwargs)
2074
+
2048
2075
  plt.show()
2049
2076
 
2050
2077
  return model_data_TG_CG
@@ -2063,7 +2090,9 @@ class DiffModel:
2063
2090
  plot_legend: bool = True,
2064
2091
  plot_grid: bool = True,
2065
2092
  plot_size: list = [12, 6],
2066
- retransform_log_outcome: bool = False
2093
+ retransform_log_outcome: bool = False,
2094
+ save_fig: str = None,
2095
+ save_fig_kwargs: dict = {}
2067
2096
  ):
2068
2097
 
2069
2098
  """
@@ -2098,6 +2127,10 @@ class DiffModel:
2098
2127
  retransform_log_outcome : bool, optional
2099
2128
  If outcome was log-transformed, retransform to original scale for plotting.
2100
2129
  Default is False.
2130
+ save_fig : str, optional
2131
+ If not none, filename of plot to be saved.
2132
+ save_fig_kwargs : dict, optional
2133
+ Optional arguments for plt.savefig() if save_fig is not None.
2101
2134
 
2102
2135
  Returns
2103
2136
  -------
@@ -2227,6 +2260,9 @@ class DiffModel:
2227
2260
 
2228
2261
  if y_lim is not None:
2229
2262
  ax.set_ylim(y_lim)
2263
+
2264
+ if save_fig is not None and isinstance(save_fig, str):
2265
+ plt.savefig(save_fig, **save_fig_kwargs)
2230
2266
 
2231
2267
  plt.show()
2232
2268
 
@@ -4,8 +4,8 @@
4
4
  # Author: Thomas Wieland
5
5
  # ORCID: 0000-0001-5168-9846
6
6
  # mail: geowieland@googlemail.com
7
- # Version: 2.2.4
8
- # Last update: 2026-04-28 21:45
7
+ # Version: 2.2.5
8
+ # Last update: 2026-07-23 19:34
9
9
  # Copyright (c) 2025-2026 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -540,10 +540,10 @@ def is_simultaneous(
540
540
  print("OK")
541
541
 
542
542
  if not simultaneous and data_isnotreatment[0]:
543
- print(f"NOTE: treatment '{treatment_col}' is not simultaneous.")
543
+ print(f"NOTE: Treatment '{treatment_col}' is not simultaneous.")
544
544
 
545
545
  if simultaneous and not data_isnotreatment[0]:
546
- print(f"WARNING: treatment '{treatment_col}' is simultaneous and does not include a {config.NO_TREATMENT_CG_DESCRIPTION}")
546
+ print(f"WARNING: Treatment '{treatment_col}' is simultaneous and does not include a {config.NO_TREATMENT_CG_DESCRIPTION}")
547
547
 
548
548
  return simultaneous
549
549
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffindiff
3
- Version: 2.5.2
3
+ Version: 2.5.3
4
4
  Summary: diffindiff: Python library for convenient Difference-in-Differences analyses
5
5
  Author: Thomas Wieland
6
6
  Author-email: geowieland@googlemail.com
@@ -29,7 +29,7 @@ A case study that utilizes the diffindiff library is available on [arXiv](https:
29
29
 
30
30
  If you use this software, please cite:
31
31
 
32
- Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.2) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
32
+ Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.5.3) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
33
33
 
34
34
 
35
35
  ## Installation
@@ -179,11 +179,9 @@ See the /tests directory for usage examples of most of the included functions.
179
179
  This software was developed without the use of AI-generated code. The Continue Agent in Microsoft Visual Studio Code using the GPT-5 mini model (by OpenAI) was used solely to assist in drafting and refining docstrings for documentation. The corresponding guidelines and constraints defined by the author are documented in `AGENTS-docstrings.md` in the [public GitHub repository](https://github.com/geowieland/diffindiff_official).
180
180
 
181
181
 
182
- ## What's new (v2.5.2)
182
+ ## What's new (v2.5.3)
183
183
 
184
184
  - Extensions
185
- - New functions DiffData.get_synthetic_control_weightings() and DiffData.get_synthetic_control_fitmetrics() for accessing control unit weightings and fit metrics of the synthetic control unit
185
+ - Added optional saving of plots in DiffModel plot methods
186
186
  - Bugfixes
187
- - DiffModel.placebo() now checks control group size and returns warning when no. of control units is equal to 1, not allowing any placebo test
188
- - Other
189
- - Some updates of documentation and README
187
+ - Fixed typos in messages
@@ -7,7 +7,7 @@ def read_README():
7
7
 
8
8
  setup(
9
9
  name='diffindiff',
10
- version='2.5.2',
10
+ version='2.5.3',
11
11
  description='diffindiff: Python library for convenient Difference-in-Differences analyses',
12
12
  packages=find_packages(include=["diffindiff", "diffindiff.tests"]),
13
13
  include_package_data=True,
File without changes
File without changes