diffindiff 2.3.7__py3-none-any.whl → 2.3.8__py3-none-any.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.
diffindiff/config.py CHANGED
@@ -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.15
8
- # Last update: 2026-03-24 18:04
7
+ # Version: 1.0.16
8
+ # Last update: 2026-04-21 20:19
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.3.7"
15
+ PACKAGE_VERSION = "2.3.8"
16
16
 
17
17
  VERBOSE = False
18
18
 
diffindiff/didanalysis.py CHANGED
@@ -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.3.7
8
- # Last update: 2026-03-24 18:37
7
+ # Version: 2.3.8
8
+ # Last update: 2026-04-21 20:31
9
9
  # Copyright (c) 2024-2026 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -1661,20 +1661,17 @@ class DiffModel:
1661
1661
  model_predictions = model_predictions.reset_index()
1662
1662
  model_predictions.rename(columns = {config.PREDICTIONS_SUMMARY_FRAME_COLS_LIST[0]: outcome_col_predicted}, inplace = True)
1663
1663
 
1664
- model_data = pd.concat ([model_data, model_predictions], axis = 1)
1664
+ model_data = pd.concat([model_data, model_predictions], axis = 1)
1665
1665
 
1666
+ if model_config["log_outcome"] and not retransform_log_outcome and y_lim is not None:
1667
+ print(f"NOTE: Outcome variable was log-transformed. Plotting is on log scale, but 'y_lim' is specified. The plot presentation might be nonsensical. Set param 'retransform_log_outcome' to True to re-transform to original scale for plotting.")
1668
+
1666
1669
  if retransform_log_outcome:
1667
1670
 
1668
1671
  if model_config["log_outcome"]:
1669
1672
 
1670
1673
  if outcome_col.startswith(f"{config.LOG_PREFIX}{config.DELIMITER}"):
1671
1674
 
1672
- model_data = model_data.rename(
1673
- columns = {
1674
- outcome_col: outcome_col[len(f"{config.LOG_PREFIX}{config.DELIMITER}"):]
1675
- }
1676
- )
1677
-
1678
1675
  outcome_col = outcome_col[len(f"{config.LOG_PREFIX}{config.DELIMITER}"):]
1679
1676
 
1680
1677
  if outcome_col_predicted.startswith(f"{config.LOG_PREFIX}{config.DELIMITER}"):
@@ -1686,8 +1683,7 @@ class DiffModel:
1686
1683
  )
1687
1684
 
1688
1685
  outcome_col_predicted = outcome_col_predicted[len(f"{config.LOG_PREFIX}{config.DELIMITER}"):]
1689
-
1690
- model_data[outcome_col] = np.exp(model_data[outcome_col])
1686
+
1691
1687
  model_data[outcome_col_predicted] = np.exp(model_data[outcome_col_predicted])
1692
1688
 
1693
1689
  model_data[config.PREDICTIONS_SUMMARY_FRAME_COLS_LIST[2]] = np.exp(model_data[config.PREDICTIONS_SUMMARY_FRAME_COLS_LIST[2]])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffindiff
3
- Version: 2.3.7
3
+ Version: 2.3.8
4
4
  Summary: diffindiff: Python library for convenient Difference-in-Differences analyses
5
5
  Author: Thomas Wieland
6
6
  Author-email: geowieland@googlemail.com
@@ -38,7 +38,7 @@ Thomas Wieland [ORCID](https://orcid.org/0000-0001-5168-9846) [EMail](mailto:geo
38
38
 
39
39
  If you use this software, please cite:
40
40
 
41
- Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.3.7) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
41
+ Wieland, T. (2026). diffindiff: A Python library for convenient difference-in-differences analyses (Version 2.3.8) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.18656820
42
42
 
43
43
 
44
44
  ## Installation
@@ -184,15 +184,7 @@ See the /tests directory for usage examples of most of the included functions.
184
184
  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).
185
185
 
186
186
 
187
- ## What's new (v2.3.7)
187
+ ## What's new (v2.3.8)
188
188
 
189
- - Extensions:
190
- - DiffModel.counterfactual() and DiffModel.plot_counterfactual(): Re-transform log-transformed outcome via parameter retransform_log_outcome
191
- - Difference between predicted and counterfactual-predicted in result df of DiffModel.counterfactual()
192
- - Extended parameters in didtools.model_wrapper() to be passed to sklearn.model_selection.train_test_split()
193
- - Extension of documentations
194
189
  - Bugfixes:
195
- - diddata.create_counterfactual(): Fixed calculation error, additional check of input parameters
196
- - didtools.is_prepost() now also checks number of observational units
197
- - didtools.is_notreatment() now checks whether data is singular with respect to 0 and 1
198
- - didtools.fit_metrics() tries to convert observed and expected if not numeric before raising TypeError
190
+ - DiffModel.plot() always shows the correct values if retransform_log_outcome is used
@@ -1,6 +1,6 @@
1
1
  diffindiff/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- diffindiff/config.py,sha256=BbNqN7oyRdCOi9BtpyRQ03FnZ9nv5igUi2EMJjO_Xys,16146
3
- diffindiff/didanalysis.py,sha256=lYfnE1iXkXXDNduhLQ68oSz_2CxXvDMoXq600HhOphs,125868
2
+ diffindiff/config.py,sha256=UFkYo5ZsaNRF-vKemjEN7et3UhekLG0sv1xYBUai9qA,16146
3
+ diffindiff/didanalysis.py,sha256=3cDsi3uAxa4-H0wS4UvY0gWdlIpX4Lc7AFuz3Z5b2aM,125864
4
4
  diffindiff/didanalysis_helper.py,sha256=ycExY8lvKOdQj9kjLnHQzv_NqRVlpFaczMu1fJ-kXt4,48841
5
5
  diffindiff/diddata.py,sha256=wwZ-azyM0nuUbQ3BfinCNBu2uw9hGxz0ddek7_auZTs,89632
6
6
  diffindiff/didtools.py,sha256=RervqMP8n1kryYZdhYtsaemuYAItidZeTsuoVPqMwYA,55163
@@ -9,7 +9,7 @@ diffindiff/tests/tests_diffindiff.py,sha256=wG-W_JaCp6ixK17OuVPjjsBJUnYKdqTfOUpN
9
9
  diffindiff/tests/data/Corona_Hesse.xlsx,sha256=HC60Bd19RQwd-xHFg22_Atij7ijY-cdNo9fRq3zSPI4,1183519
10
10
  diffindiff/tests/data/counties_DE.csv,sha256=W_UZcUNTCIyse5Fw1XyNBkx-bVd8XgG6wiEQs2bMQKA,62157
11
11
  diffindiff/tests/data/curfew_DE.csv,sha256=YIG7iQudpfjW03dp7X195QcjEvlnCTRa4DDo9bn_lc0,2429159
12
- diffindiff-2.3.7.dist-info/METADATA,sha256=QfNiFPiPR3jyTpK6Z3Dkc80hPvebl0FD_fsydQSH8ns,11039
13
- diffindiff-2.3.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
14
- diffindiff-2.3.7.dist-info/top_level.txt,sha256=ZcrJZT_ggkSA_3FTNKutKrQKNaBEG5tQDMmm8mhHm88,11
15
- diffindiff-2.3.7.dist-info/RECORD,,
12
+ diffindiff-2.3.8.dist-info/METADATA,sha256=N--AVdp7CNzdaXU49PQN8fVRArwiVz_fr0tWmQGltOg,10341
13
+ diffindiff-2.3.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
14
+ diffindiff-2.3.8.dist-info/top_level.txt,sha256=ZcrJZT_ggkSA_3FTNKutKrQKNaBEG5tQDMmm8mhHm88,11
15
+ diffindiff-2.3.8.dist-info/RECORD,,