arviz 0.23.1__py3-none-any.whl → 0.23.3__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.
arviz/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # pylint: disable=wildcard-import,invalid-name,wrong-import-position
2
2
  """ArviZ is a library for exploratory analysis of Bayesian models."""
3
- __version__ = "0.23.1"
3
+ __version__ = "0.23.3"
4
4
 
5
5
  import logging
6
6
  import os
@@ -23,16 +23,27 @@ def _warn_once_per_day():
23
23
  import datetime
24
24
  from warnings import warn
25
25
  from pathlib import Path
26
+ from platformdirs import user_cache_dir
26
27
 
27
- warning_dir = Path.home() / "arviz_data"
28
+ def _atomic_write_text(path: Path, text: str) -> None:
29
+ """
30
+ Write text to a file atomically.
31
+
32
+ Write to a temporary file in the same directory and replace the target.
33
+ """
34
+ tmp = path.with_suffix(path.suffix + ".tmp")
35
+ tmp.write_text(text)
36
+ tmp.replace(path)
37
+
38
+ warning_dir = Path(user_cache_dir("arviz", "arviz"))
28
39
  warning_dir.mkdir(exist_ok=True)
29
40
 
30
41
  stamp_file = warning_dir / "daily_warning"
31
42
  today = datetime.date.today()
32
43
 
33
- if stamp_file.exists():
44
+ try:
34
45
  last_date = datetime.date.fromisoformat(stamp_file.read_text().strip())
35
- else:
46
+ except (FileNotFoundError, ValueError):
36
47
  last_date = None
37
48
 
38
49
  if last_date != today:
@@ -44,8 +55,7 @@ def _warn_once_per_day():
44
55
  "https://python.arviz.org/en/latest/user_guide/migration_guide.html",
45
56
  FutureWarning,
46
57
  )
47
-
48
- stamp_file.write_text(today.isoformat())
58
+ _atomic_write_text(stamp_file, today.isoformat())
49
59
 
50
60
 
51
61
  _warn_once_per_day()
@@ -9,14 +9,14 @@
9
9
  {
10
10
  "name": "rugby",
11
11
  "filename": "rugby.nc",
12
- "url": "http://figshare.com/ndownloader/files/44916469",
12
+ "url": "http://ndownloader.figshare.com/files/44916469",
13
13
  "checksum": "f4a5e699a8a4cc93f722eb97929dd7c4895c59a2183f05309f5082f3f81eb228",
14
14
  "description": "The Six Nations Championship is a yearly rugby competition between Italy, Ireland, Scotland, England, France and Wales. Fifteen games are played each year, representing all combinations of the six teams.\n\nThis example uses and includes results from 2014 - 2017, comprising 60 total games. It models latent parameters for each team's attack and defense, as well as a global parameter for home team advantage.\n\nSee https://github.com/arviz-devs/arviz_example_data/blob/main/code/rugby/rugby.ipynb for the whole model specification."
15
15
  },
16
16
  {
17
17
  "name": "rugby_field",
18
18
  "filename": "rugby_field.nc",
19
- "url": "http://figshare.com/ndownloader/files/44667112",
19
+ "url": "http://ndownloader.figshare.com/files/44667112",
20
20
  "checksum": "53a99da7ac40d82cd01bb0b089263b9633ee016f975700e941b4c6ea289a1fb0",
21
21
  "description": "A variant of the 'rugby' example dataset. The Six Nations Championship is a yearly rugby competition between Italy, Ireland, Scotland, England, France and Wales. Fifteen games are played each year, representing all combinations of the six teams.\n\nThis example uses and includes results from 2014 - 2017, comprising 60 total games. It models latent parameters for each team's attack and defense, with each team having different values depending on them being home or away team.\n\nSee https://github.com/arviz-devs/arviz_example_data/blob/main/code/rugby_field/rugby_field.ipynb for the whole model specification."
22
22
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arviz
3
- Version: 0.23.1
3
+ Version: 0.23.3
4
4
  Summary: Exploratory analysis of Bayesian models
5
5
  Home-page: http://github.com/arviz-devs/arviz
6
6
  Author: ArviZ Developers
@@ -32,6 +32,7 @@ Requires-Dist: h5netcdf>=1.0.2
32
32
  Requires-Dist: h5py
33
33
  Requires-Dist: typing_extensions>=4.1.0
34
34
  Requires-Dist: xarray-einstats>=0.3
35
+ Requires-Dist: platformdirs
35
36
  Provides-Extra: all
36
37
  Requires-Dist: numba; extra == "all"
37
38
  Requires-Dist: netcdf4; extra == "all"
@@ -1,4 +1,4 @@
1
- arviz/__init__.py,sha256=HBMDwUgE8CTGybvpN9HEjphGDofJi3ywCFFVbzt3KPc,11756
1
+ arviz/__init__.py,sha256=C8rLjlBrmkJTT9-GCriCmt0izvt49EHDIhiJc-k-ijg,12149
2
2
  arviz/labels.py,sha256=w4-t0qdJzjKrqRyhzbtk6ucoMIAxle1HpHYlH7up06Q,6828
3
3
  arviz/preview.py,sha256=GuAwiStRYSooI4mG9j7JFpr3YxBfg_93DlgroORQBUg,1644
4
4
  arviz/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,7 +25,7 @@ arviz/data/io_pystan.py,sha256=nRTU6yujilQCKERxzN7LIVwZplfvFNb-Y9Jk9YVJQLk,41700
25
25
  arviz/data/io_zarr.py,sha256=PeSBz-zHDzmwJq3sWzxASnjrfbd-hULJsl8FjK46YQQ,1163
26
26
  arviz/data/utils.py,sha256=gw1AtkCgdPA9bJsI1UTRi1h5xxFxv8erKlU_S48Nff8,4770
27
27
  arviz/data/example_data/data_local.json,sha256=8WwyEWriDDfcVT79GNQ412QDkSoOZF6FYJ7cbyGpONI,1088
28
- arviz/data/example_data/data_remote.json,sha256=UNI3hyjcICG_MtpLxAicY04Y4mQf3M-kESxRWGl9kgw,5340
28
+ arviz/data/example_data/data_remote.json,sha256=tpEz0QouqUXDslNci_Y1AMuCNp-tv6CUz8kRz16tnAw,5340
29
29
  arviz/data/example_data/code/radon/radon.json,sha256=XwpiyGRrqkBP02zWz00s6z-d00Vv_vSqfx7ZLlb4lz0,24382
30
30
  arviz/data/example_data/data/centered_eight.nc,sha256=jvw6uv4MeW65rqe2lJDU4kAKM8V1BO9JMuHHEFhJF28,654694
31
31
  arviz/data/example_data/data/non_centered_eight.nc,sha256=r7kyd10HyJTTRQs4OlSCXPVt3T-nLsPd3g-bcPYnPmA,836647
@@ -176,8 +176,8 @@ arviz/wrappers/__init__.py,sha256=d8GTUuBW_30LyDyk6qn2MAnvg-GZCeUw_i5SUPqaa1w,35
176
176
  arviz/wrappers/base.py,sha256=FNgPvd_tLCB5C2tRx1ngYjr4F5tEUuNrrLkStuyRXsE,9134
177
177
  arviz/wrappers/wrap_pymc.py,sha256=ltKv55aG0WTWXVDJuff5TXkgJJ_ESLvlT-JPlh3yHAg,1143
178
178
  arviz/wrappers/wrap_stan.py,sha256=sIy38fXg4Ln_0CM6xONDwOJg1Y6FwNM_JQErv3a-8_c,5526
179
- arviz-0.23.1.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
180
- arviz-0.23.1.dist-info/METADATA,sha256=PYF49qwd_wLFdlbmfyNVwiDg-AzZk3GPxEey5YHi6io,9109
181
- arviz-0.23.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
182
- arviz-0.23.1.dist-info/top_level.txt,sha256=5MFvqrTtYRWsIx-SjKuFIUHtrnVJq0Ngd0Nc2_etQhE,6
183
- arviz-0.23.1.dist-info/RECORD,,
179
+ arviz-0.23.3.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
180
+ arviz-0.23.3.dist-info/METADATA,sha256=PDnarYy_UbqJSrcZn8tvSbd0zu0inEY-pAJKZ8fCako,9137
181
+ arviz-0.23.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
182
+ arviz-0.23.3.dist-info/top_level.txt,sha256=5MFvqrTtYRWsIx-SjKuFIUHtrnVJq0Ngd0Nc2_etQhE,6
183
+ arviz-0.23.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5