xlin 0.1.29__py2.py3-none-any.whl → 0.1.30__py2.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.
xlin/statistic.py CHANGED
@@ -266,6 +266,20 @@ def generate_classification_report(predictions: List[str], labels: List[str]) ->
266
266
  return report
267
267
 
268
268
 
269
+ def convert_to_jsonable_report(report_row):
270
+ new_report_json = {}
271
+ for key, value in report_row.items():
272
+ if isinstance(value, dict):
273
+ new_report_json[key] = convert_to_jsonable_report(value)
274
+ elif isinstance(value, list):
275
+ new_report_json[key] = [convert_to_jsonable_report(item) if isinstance(item, dict) else item for item in value]
276
+ elif isinstance(value, pd.DataFrame):
277
+ new_report_json[key] = value.fillna(-1).to_dict(orient="records")
278
+ else:
279
+ new_report_json[key] = value
280
+ return new_report_json
281
+
282
+
269
283
  def print_classification_report(predictions: List[str], labels: List[str]):
270
284
  report = generate_classification_report(predictions, labels)
271
285
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xlin
3
- Version: 0.1.29
3
+ Version: 0.1.30
4
4
  Summary: toolbox for LinXueyuan
5
5
  License: MIT
6
6
  Author: LinXueyuanStdio
@@ -4,12 +4,12 @@ xlin/jsonl.py,sha256=IDRydHh2x-8iAGCxt9ScK2wfNLNA40PxNxR5hhr4v6k,7903
4
4
  xlin/metric.py,sha256=N7wJ35y-C-IaBr1I1CJ_37lTG7gA69zmn9Xg6xSwKoI,1690
5
5
  xlin/multiprocess_mapping.py,sha256=q4EVU8JPLcRAbNf9NUEzmn8rDLDfIQ3jaW0yxVKPECk,16669
6
6
  xlin/read_as_dataframe.py,sha256=MqY57L7Wp9UoWTRlZLSBKQNaZa-dKw51-ufrKvHKf8s,9041
7
- xlin/statistic.py,sha256=VS8tL0rwhs3tBR0hC4IU-7FVIlHuxImMrqJzut8JKNI,10525
7
+ xlin/statistic.py,sha256=UNyVrmJfJ-sG2b9soTQqDicatGTPnWZhs6-e3KX5npg,11111
8
8
  xlin/timing.py,sha256=XMT8dMcMolOMohDvAZOIM_BAiPMREhGQKnO1kc5s6PU,998
9
9
  xlin/util.py,sha256=TTWJaqF5D_r-gAZ_fj0kyHomvCagjwHXQZ2OPSgwd54,10976
10
10
  xlin/xls2xlsx.py,sha256=uSmXcDvIhi5Sq0LGidMXy0wErNBXdjaoa6EftYVjTXs,947
11
11
  xlin/yaml.py,sha256=kICi7G3Td5q2MaSXXt85qNTWoHMgjzt7pvn7r3C4dME,183
12
- xlin-0.1.29.dist-info/LICENSE,sha256=60ys6rRtc1dZOP8UjSUr9fAqhZudT3WpKe5WbMCralM,1066
13
- xlin-0.1.29.dist-info/METADATA,sha256=oGtT05fTogUwHLtNFuLkmV8oxd_wzLIJfC69f6Q4JYg,1098
14
- xlin-0.1.29.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
15
- xlin-0.1.29.dist-info/RECORD,,
12
+ xlin-0.1.30.dist-info/LICENSE,sha256=60ys6rRtc1dZOP8UjSUr9fAqhZudT3WpKe5WbMCralM,1066
13
+ xlin-0.1.30.dist-info/METADATA,sha256=IH7h-XO7fz-UormhwHAJ4JUmwHyBVYqxXVijNeojxGw,1098
14
+ xlin-0.1.30.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
15
+ xlin-0.1.30.dist-info/RECORD,,
File without changes
File without changes