LSMS_Library 0.7.3__py3-none-any.whl → 0.7.4__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.
- lsms_library/diagnostics.py +9 -2
- {lsms_library-0.7.3.dist-info → lsms_library-0.7.4.dist-info}/METADATA +1 -1
- {lsms_library-0.7.3.dist-info → lsms_library-0.7.4.dist-info}/RECORD +6 -6
- {lsms_library-0.7.3.dist-info → lsms_library-0.7.4.dist-info}/WHEEL +0 -0
- {lsms_library-0.7.3.dist-info → lsms_library-0.7.4.dist-info}/entry_points.txt +0 -0
- {lsms_library-0.7.3.dist-info → lsms_library-0.7.4.dist-info}/licenses/LICENSE.txt +0 -0
lsms_library/diagnostics.py
CHANGED
|
@@ -520,9 +520,16 @@ def food_acquired_u_code_leaks(country: str, *,
|
|
|
520
520
|
df = Country(country, preload_panel_ids=False).food_acquired()
|
|
521
521
|
if not isinstance(df, pd.DataFrame) or "u" not in (df.index.names or []):
|
|
522
522
|
return []
|
|
523
|
-
u = df.index.get_level_values("u")
|
|
523
|
+
u = df.index.get_level_values("u")
|
|
524
524
|
code = re.compile(r"^\s*\d") # leading digit => code / code-prefix / item-name
|
|
525
|
-
|
|
525
|
+
# Coerce per value and skip NaN. A *categorical* ``u`` level keeps NaN as a
|
|
526
|
+
# float through ``.astype(str)`` (unlike object dtype, where NaN -> 'nan'),
|
|
527
|
+
# which fed ``re.match`` a float and raised TypeError (master CI, post-v0.7.3).
|
|
528
|
+
# A NaN ``u`` means no unit was recorded -- not a leaked code -- so skip it.
|
|
529
|
+
return sorted({
|
|
530
|
+
s for v in u.unique()
|
|
531
|
+
if pd.notna(v) and code.match(s := str(v))
|
|
532
|
+
})
|
|
526
533
|
|
|
527
534
|
|
|
528
535
|
def _check_index_overlap_with_spine(df: pd.DataFrame, country: str) -> Check:
|
|
@@ -11530,7 +11530,7 @@ lsms_library/country.py,sha256=6wN0eMRJgfxRiyHHLr1GPkli6upT3dLrXIVmn1RVvRE,16341
|
|
|
11530
11530
|
lsms_library/data_access.py,sha256=JheECo0sNIAPKdQ11nShs8RYAqXXiUf5r87JhmlBVIM,57316
|
|
11531
11531
|
lsms_library/data_info.yml,sha256=L7p0ctYVYy48Sd7BsmYAVmkBKx86-cbKLxOgkQ3pSiU,7665
|
|
11532
11532
|
lsms_library/demands.py,sha256=eU5CNCMPh3fy9BqqsRB6Y1BjrEBQNATD92aTyqDNREw,1944
|
|
11533
|
-
lsms_library/diagnostics.py,sha256=
|
|
11533
|
+
lsms_library/diagnostics.py,sha256=pkvc983poZBopLV7HPhIGcg4-f292VQl80giL8uAMxo,66404
|
|
11534
11534
|
lsms_library/dvc_permissions.py,sha256=elwF08jl7CShIFq_-BEzQBQNC8b_qU9x0ksDfRQYLnY,5139
|
|
11535
11535
|
lsms_library/feature.py,sha256=eNj64cH6ervQV7AsAhMj5p7zsPcX0etoY87vI4iozdg,10636
|
|
11536
11536
|
lsms_library/harmony.py,sha256=hEGLJUnWBXdyGeAAr7qgCFZ0Q-KsiqjBxHrtYbZ8Ngs,2742
|
|
@@ -11543,8 +11543,8 @@ lsms_library/util/geo_audit.py,sha256=QxCZeNvz9if2riKsvZFg-G_c2nsp-8lPqrx-iEjMlC
|
|
|
11543
11543
|
lsms_library/util/orgtbl.py,sha256=SMTUFe0_WBWgzin7e37PEcRRoI0BPbG2zAJEFKjfF6E,9117
|
|
11544
11544
|
lsms_library/util/run_stage.py,sha256=nigrjAn0O6WP_8zfc4O1DgmDA09vFxyOJi791vbnj-8,3660
|
|
11545
11545
|
lsms_library/yaml_utils.py,sha256=rUsTaaVvYtN8iouW6En_GE45UFJktBmKJ7zTiE0kAdc,1741
|
|
11546
|
-
lsms_library-0.7.
|
|
11547
|
-
lsms_library-0.7.
|
|
11548
|
-
lsms_library-0.7.
|
|
11549
|
-
lsms_library-0.7.
|
|
11550
|
-
lsms_library-0.7.
|
|
11546
|
+
lsms_library-0.7.4.dist-info/METADATA,sha256=ebf10XUTG7Q2SQOgtanV9X7byjxiZm2AlgRG5lP96I8,7329
|
|
11547
|
+
lsms_library-0.7.4.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
|
|
11548
|
+
lsms_library-0.7.4.dist-info/entry_points.txt,sha256=cFJ-ZuATjsMWAmRzlK_RaTSoweSv6UyHwMeDSMmIAjU,54
|
|
11549
|
+
lsms_library-0.7.4.dist-info/licenses/LICENSE.txt,sha256=qImFXcRJwxIHS80FE7uOx6FhmLY8apd4Y12aR54QU7w,282
|
|
11550
|
+
lsms_library-0.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|