omlish 0.0.0.dev250__py3-none-any.whl → 0.0.0.dev251__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.
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev250'
2
- __revision__ = '0e6e1316b474c6f882784e2474e809a478c54732'
1
+ __version__ = '0.0.0.dev251'
2
+ __revision__ = 'a8956f3a2d8adc4189bfa777c3c83aff88b62e22'
3
3
 
4
4
 
5
5
  #
omlish/dispatch/impls.py CHANGED
@@ -1,3 +1,10 @@
1
+ """
2
+ TODO:
3
+ - generics? injected Manifests / type contexts?
4
+ - ta.Literal? support for simple scalars, enums
5
+ - multidispatch? never solved..
6
+ - just generic on tuple[A0, A1, ...]
7
+ """
1
8
  import contextlib
2
9
  import typing as ta
3
10
  import weakref
omlish/lang/params.py CHANGED
@@ -244,13 +244,13 @@ def param_render(
244
244
  render_default: ta.Callable[[ta.Any], str] | None = None,
245
245
  ) -> str:
246
246
  if isinstance(p, Param):
247
- dfl_s: str | None = None
248
247
  ann_s: str | None = None
249
- if isinstance(p, (VarParam, ValParam)) and p.annotation.present:
248
+ if p.annotation.present:
250
249
  if render_annotation is None:
251
250
  raise ValueError(f'Param {p.name} has an annotation but no annotation renderer provided')
252
251
  ann_s = render_annotation(p.annotation.must())
253
252
 
253
+ dfl_s: str | None = None
254
254
  if isinstance(p, ValParam) and p.default.present:
255
255
  if render_default is None:
256
256
  raise ValueError(f'Param {p.name} has a default but no default renderer provided')
omlish/lite/marshal.py CHANGED
@@ -331,7 +331,7 @@ _DEFAULT_OBJ_MARSHALERS: ta.Dict[ta.Any, ObjMarshaler] = {
331
331
 
332
332
  _OBJ_MARSHALER_GENERIC_MAPPING_TYPES: ta.Dict[ta.Any, type] = {
333
333
  **{t: t for t in (dict,)},
334
- **{t: dict for t in (collections.abc.Mapping, collections.abc.MutableMapping)},
334
+ **{t: dict for t in (collections.abc.Mapping, collections.abc.MutableMapping)}, # noqa
335
335
  }
336
336
 
337
337
  _OBJ_MARSHALER_GENERIC_ITERABLE_TYPES: ta.Dict[ta.Any, type] = {
omlish/math/stats.py CHANGED
@@ -191,7 +191,7 @@ class Stats(ta.Sequence[float]):
191
191
  # freedman algorithm for fixed-width bin selection
192
192
  q25, q75 = self.get_quantile(0.25), self.get_quantile(0.75)
193
193
  dx = 2 * (q75 - q25) / (len_data ** (1 / 3.0))
194
- bin_count = max(1, int(math.ceil((max_data - min_data) / dx)))
194
+ bin_count = max(1, math.ceil((max_data - min_data) / dx))
195
195
  bins = [min_data + (dx * i) for i in range(bin_count + 1)]
196
196
  bins = [b for b in bins if b < max_data]
197
197
 
@@ -301,7 +301,7 @@ class SamplingHistogram:
301
301
 
302
302
  @staticmethod
303
303
  def _calc_percentile_pos(p: float, sz: int) -> int:
304
- return int(round((p * sz) - 1))
304
+ return round((p * sz) - 1)
305
305
 
306
306
  def _calc_percentiles(self, entries: list[Entry | None]) -> list[Percentile]:
307
307
  entries = list(filter(None, entries))
@@ -81,6 +81,9 @@ def result(id: Id, result: ta.Any) -> Response: # noqa
81
81
  return Response(id, result=result)
82
82
 
83
83
 
84
+ ##
85
+
86
+
84
87
  @dc.dataclass(frozen=True)
85
88
  @msh.update_fields_metadata(['data'], omit_if=is_not_specified)
86
89
  class Error(lang.Final):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: omlish
3
- Version: 0.0.0.dev250
3
+ Version: 0.0.0.dev251
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=x26AIwDzScUvnX-p4xlq6Zc5QYrAo0Vmgf1qHc1KL_M,8253
2
- omlish/__about__.py,sha256=LCIKYHw0FYdPvCdmhqyF7FaJsL17sOU3m3dX5HFBUbg,3380
2
+ omlish/__about__.py,sha256=MFiFKUC3yK5vAd_nIoMJBCcGv-1JRmEmPlWpjfwcOkA,3380
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
5
5
  omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
@@ -237,7 +237,7 @@ omlish/dispatch/_dispatch2.py,sha256=70k1tKKvuhxtAu6v4skECfHKIKVWrmlt7G_JKLUsKEs
237
237
  omlish/dispatch/_dispatch3.py,sha256=9Zjd7bINAC3keiaBdssc4v5dY0-8OI6XooV2DR9U7Z0,2818
238
238
  omlish/dispatch/dispatch.py,sha256=KA5l49AiGLRjp4J7RDJW9RiDp9WUD1ewR1AOPEF8g38,3062
239
239
  omlish/dispatch/functions.py,sha256=8Qvj62XKn9SKfiqoVQdBD3wVRE4JUWpZDqs0oouuDIw,1519
240
- omlish/dispatch/impls.py,sha256=f7uLDjtDcykx_iFYRSmIrQYbVmXlaqXZ3qFIuOTUiD8,1967
240
+ omlish/dispatch/impls.py,sha256=0t1N3EZUHi-V3kzgOVUezE7ghevZt1G3r0eo2q_do7c,2151
241
241
  omlish/dispatch/methods.py,sha256=dr8xQo-zVRckIo_V2Wp8Reqor3NE6APuzomUfsSBGdk,5498
242
242
  omlish/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
243
243
  omlish/docker/all.py,sha256=xXRgJgLGPwAtr7bDMJ_Dp9jTfOwfGvohNhc6LsoELJc,514
@@ -415,7 +415,7 @@ omlish/lang/imports.py,sha256=Gdl6xCF89xiMOE1yDmdvKWamLq8HX-XPianO58Jdpmw,9218
415
415
  omlish/lang/iterables.py,sha256=HOjcxOwyI5bBApDLsxRAGGhTTmw7fdZl2kEckxRVl-0,1994
416
416
  omlish/lang/maybes.py,sha256=dAgrUoAhCgyrHRqa73CkaGnpXwGc-o9n-NIThrNXnbU,3416
417
417
  omlish/lang/objects.py,sha256=65XsD7UtblRdNe2ID1-brn_QvRkJhBIk5nyZWcQNeqU,4574
418
- omlish/lang/params.py,sha256=AaUHI59qBLV7I-q1qPIEPTKGvgXzSRsmkNR2jTma5ZY,6688
418
+ omlish/lang/params.py,sha256=QmNVBfJsfxjDG5ilDPgHV7sK4UwRztkSQdLTo0umb8I,6648
419
419
  omlish/lang/resolving.py,sha256=OuN2mDTPNyBUbcrswtvFKtj4xgH4H4WglgqSKv3MTy0,1606
420
420
  omlish/lang/resources.py,sha256=WKkAddC3ctMK1bvGw-elGe8ZxAj2IaUTKVSu2nfgHTo,2839
421
421
  omlish/lang/strings.py,sha256=egdv8PxLNG40-5V93agP5j2rBUDIsahCx048zV7uEbU,4690
@@ -447,7 +447,7 @@ omlish/lite/imports.py,sha256=o9WWrNrWg0hKeMvaj91giaovED_9VFanN2MyEHBGekY,1346
447
447
  omlish/lite/inject.py,sha256=-tTsOqqef-Ix5Tgl2DP_JAsNWJQDFUptERl3lk14Uzs,29007
448
448
  omlish/lite/json.py,sha256=7-02Ny4fq-6YAu5ynvqoijhuYXWpLmfCI19GUeZnb1c,740
449
449
  omlish/lite/logs.py,sha256=CWFG0NKGhqNeEgryF5atN2gkPYbUdTINEw_s1phbINM,51
450
- omlish/lite/marshal.py,sha256=UMwSLEM-QvkvnSHmcChJVkIXkGp9WAyMYyZMB-NZefw,18463
450
+ omlish/lite/marshal.py,sha256=4DCbLoimLwJakihpvMjJ_kpc7v9aZQY8P3-gkoqEGUE,18471
451
451
  omlish/lite/maybes.py,sha256=7OlHJ8Q2r4wQ-aRbZSlJY7x0e8gDvufFdlohGEIJ3P4,833
452
452
  omlish/lite/pycharm.py,sha256=pUOJevrPClSqTCEOkQBO11LKX2003tfDcp18a03QFrc,1163
453
453
  omlish/lite/reflect.py,sha256=pzOY2PPuHH0omdtglkN6DheXDrGopdL3PtTJnejyLFU,2189
@@ -523,7 +523,7 @@ omlish/marshal/trivial/nop.py,sha256=41bpwsLGeDGqIwzZ7j88lbc4wIYh0EcPROhCU98mQxo
523
523
  omlish/math/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
524
524
  omlish/math/bits.py,sha256=LC3dTgrvodNbfxy9dvlya61eQuDEy0azzQLCvEbFHj4,3476
525
525
  omlish/math/floats.py,sha256=UimhOT7KRl8LXTzOI5cQWoX_9h6WNWe_3vcOuO7-h_8,327
526
- omlish/math/stats.py,sha256=C700sib97E-IywlNKoByHFEtgA51n7Lffg7d3WSO4js,10052
526
+ omlish/math/stats.py,sha256=iQh-g6M_ig0mJJ4Frs4njxDmpw515HjGSpQSiggJH4U,10042
527
527
  omlish/multiprocessing/__init__.py,sha256=jwlWGOaSGcX8DkzyZwJ49nfkHocWWeKgKb7kMpgcj_Y,485
528
528
  omlish/multiprocessing/proxies.py,sha256=bInhGds2rv6xT9q3qRMlZuSXFAjwfspkiohXZ36aUpY,484
529
529
  omlish/multiprocessing/spawn.py,sha256=sTvPLIJGYnjjI6ASqhFzHF-97tCnaOXX7u7s-33SUMw,1875
@@ -614,7 +614,7 @@ omlish/specs/jmespath/visitor.py,sha256=yneRMO4qf3k2Mdcm2cPC0ozRgOaudzlxRVRGatzt
614
614
  omlish/specs/jsonrpc/__init__.py,sha256=E0EogYSKmbj1D-V57tBgPDTyVuD8HosHqVg0Vh1CVwM,416
615
615
  omlish/specs/jsonrpc/errors.py,sha256=-Zgmlo6bV6J8w5f8h9axQgLquIFBHDgIwcpufEH5NsE,707
616
616
  omlish/specs/jsonrpc/marshal.py,sha256=hM1rPZddoha_87qcQtBWkyaZshCXlPoHPJg6J_nBi9k,1915
617
- omlish/specs/jsonrpc/types.py,sha256=g19j2_FCVJDXFqAkQ5U4LICkL4Z7vEBMU0t_aOEqio4,2159
617
+ omlish/specs/jsonrpc/types.py,sha256=50aARffC_FdxAaRxEJMNhydygj9sP8L3Kb2fx5vQGm4,2164
618
618
  omlish/specs/jsonschema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
619
619
  omlish/specs/jsonschema/types.py,sha256=qoxExgKfrI-UZXdk3qcVZIEyp1WckFbb85_eGInEoAY,467
620
620
  omlish/specs/jsonschema/keywords/__init__.py,sha256=kZNJCujSpflCOrPNeJT8C1a5sfStn6cwiXXzbu9YPyg,753
@@ -735,9 +735,9 @@ omlish/text/mangle.py,sha256=kfzFLfvepH-chl1P89_mdc5vC4FSqyPA2aVtgzuB8IY,1133
735
735
  omlish/text/minja.py,sha256=jZC-fp3Xuhx48ppqsf2Sf1pHbC0t8XBB7UpUUoOk2Qw,5751
736
736
  omlish/text/parts.py,sha256=JkNZpyR2tv2CNcTaWJJhpQ9E4F0yPR8P_YfDbZfMtwQ,6182
737
737
  omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
738
- omlish-0.0.0.dev250.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
739
- omlish-0.0.0.dev250.dist-info/METADATA,sha256=I94K5DI1DH2JEs5HA15SkuwlyDsnTF5PYIeSr5rKrGo,4176
740
- omlish-0.0.0.dev250.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
741
- omlish-0.0.0.dev250.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
742
- omlish-0.0.0.dev250.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
743
- omlish-0.0.0.dev250.dist-info/RECORD,,
738
+ omlish-0.0.0.dev251.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
739
+ omlish-0.0.0.dev251.dist-info/METADATA,sha256=mYsGKjeHcS30unmOluKNzDF1SzqNbVkhC4jMoCs8nwI,4176
740
+ omlish-0.0.0.dev251.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
741
+ omlish-0.0.0.dev251.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
742
+ omlish-0.0.0.dev251.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
743
+ omlish-0.0.0.dev251.dist-info/RECORD,,