omlish 0.0.0.dev249__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 +2 -2
 - omlish/dispatch/impls.py +7 -0
 - omlish/lang/__init__.py +2 -2
 - omlish/lang/cached/function.py +5 -5
 - omlish/lang/params.py +53 -41
 - omlish/lang/resources.py +13 -3
 - omlish/lite/marshal.py +1 -1
 - omlish/math/stats.py +2 -2
 - omlish/specs/jsonrpc/types.py +3 -0
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/METADATA +1 -1
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/RECORD +15 -15
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/LICENSE +0 -0
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/WHEEL +0 -0
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/entry_points.txt +0 -0
 - {omlish-0.0.0.dev249.dist-info → omlish-0.0.0.dev251.dist-info}/top_level.txt +0 -0
 
    
        omlish/__about__.py
    CHANGED
    
    
    
        omlish/dispatch/impls.py
    CHANGED
    
    
    
        omlish/lang/__init__.py
    CHANGED
    
    
    
        omlish/lang/cached/function.py
    CHANGED
    
    | 
         @@ -24,7 +24,7 @@ from ..params import KwargsParam 
     | 
|
| 
       24 
24 
     | 
    
         
             
            from ..params import Param
         
     | 
| 
       25 
25 
     | 
    
         
             
            from ..params import ParamSeparator
         
     | 
| 
       26 
26 
     | 
    
         
             
            from ..params import ParamSpec
         
     | 
| 
       27 
     | 
    
         
            -
            from ..params import  
     | 
| 
      
 27 
     | 
    
         
            +
            from ..params import ValParam
         
     | 
| 
       28 
28 
     | 
    
         
             
            from ..params import param_render
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         | 
| 
         @@ -52,7 +52,7 @@ _PRE_MADE_CACHE_KEY_MAKERS = [ 
     | 
|
| 
       52 
52 
     | 
    
         | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
            _PRE_MADE_CACHE_KEY_MAKERS_BY_PARAM_SPEC: ta.Mapping[ParamSpec, CacheKeyMaker] = {
         
     | 
| 
       55 
     | 
    
         
            -
                ParamSpec. 
     | 
| 
      
 55 
     | 
    
         
            +
                ParamSpec.inspect(fn): fn  # type: ignore
         
     | 
| 
       56 
56 
     | 
    
         
             
                for fn in _PRE_MADE_CACHE_KEY_MAKERS
         
     | 
| 
       57 
57 
     | 
    
         
             
            }
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
         @@ -68,8 +68,8 @@ def _make_unwrapped_cache_key_maker( 
     | 
|
| 
       68 
68 
     | 
    
         
             
                if inspect.isgeneratorfunction(fn) or inspect.iscoroutinefunction(fn):
         
     | 
| 
       69 
69 
     | 
    
         
             
                    raise TypeError(fn)
         
     | 
| 
       70 
70 
     | 
    
         | 
| 
       71 
     | 
    
         
            -
                ps = ParamSpec. 
     | 
| 
       72 
     | 
    
         
            -
                     
     | 
| 
      
 71 
     | 
    
         
            +
                ps = ParamSpec.inspect(
         
     | 
| 
      
 72 
     | 
    
         
            +
                    fn,
         
     | 
| 
       73 
73 
     | 
    
         
             
                    offset=1 if bound else 0,
         
     | 
| 
       74 
74 
     | 
    
         
             
                    strip_annotations=True,
         
     | 
| 
       75 
75 
     | 
    
         
             
                )
         
     | 
| 
         @@ -100,7 +100,7 @@ def _make_unwrapped_cache_key_maker( 
     | 
|
| 
       100 
100 
     | 
    
         
             
                    if not isinstance(p, Param):
         
     | 
| 
       101 
101 
     | 
    
         
             
                        raise TypeError(p)
         
     | 
| 
       102 
102 
     | 
    
         | 
| 
       103 
     | 
    
         
            -
                    if isinstance(p,  
     | 
| 
      
 103 
     | 
    
         
            +
                    if isinstance(p, ValParam) and p.default.present:
         
     | 
| 
       104 
104 
     | 
    
         
             
                        ns[p.name] = p.default
         
     | 
| 
       105 
105 
     | 
    
         | 
| 
       106 
106 
     | 
    
         
             
                    src_params.append(param_render(
         
     | 
    
        omlish/lang/params.py
    CHANGED
    
    | 
         @@ -21,10 +21,12 @@ T = ta.TypeVar('T') 
     | 
|
| 
       21 
21 
     | 
    
         
             
            ##
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
            @dc.dataclass(frozen=True)
         
     | 
| 
      
 24 
     | 
    
         
            +
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
       25 
25 
     | 
    
         
             
            class Param(Sealed, Abstract):
         
     | 
| 
       26 
26 
     | 
    
         
             
                name: str
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
      
 28 
     | 
    
         
            +
                annotation: Maybe = empty()
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       28 
30 
     | 
    
         
             
                prefix: ta.ClassVar[str] = ''
         
     | 
| 
       29 
31 
     | 
    
         | 
| 
       30 
32 
     | 
    
         
             
                @property
         
     | 
| 
         @@ -35,18 +37,18 @@ class Param(Sealed, Abstract): 
     | 
|
| 
       35 
37 
     | 
    
         
             
            #
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
39 
     | 
    
         | 
| 
       38 
     | 
    
         
            -
            @dc.dataclass(frozen=True)
         
     | 
| 
       39 
     | 
    
         
            -
            class  
     | 
| 
       40 
     | 
    
         
            -
                 
     | 
| 
      
 40 
     | 
    
         
            +
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
      
 41 
     | 
    
         
            +
            class VarParam(Param, Abstract):
         
     | 
| 
      
 42 
     | 
    
         
            +
                pass
         
     | 
| 
       41 
43 
     | 
    
         | 
| 
       42 
44 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
            @dc.dataclass(frozen=True)
         
     | 
| 
       44 
     | 
    
         
            -
            class ArgsParam( 
     | 
| 
      
 45 
     | 
    
         
            +
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
      
 46 
     | 
    
         
            +
            class ArgsParam(VarParam, Final):
         
     | 
| 
       45 
47 
     | 
    
         
             
                prefix: ta.ClassVar[str] = '*'
         
     | 
| 
       46 
48 
     | 
    
         | 
| 
       47 
49 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
            @dc.dataclass(frozen=True)
         
     | 
| 
       49 
     | 
    
         
            -
            class KwargsParam( 
     | 
| 
      
 50 
     | 
    
         
            +
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
      
 51 
     | 
    
         
            +
            class KwargsParam(VarParam, Final):
         
     | 
| 
       50 
52 
     | 
    
         
             
                prefix: ta.ClassVar[str] = '**'
         
     | 
| 
       51 
53 
     | 
    
         | 
| 
       52 
54 
     | 
    
         | 
| 
         @@ -54,18 +56,17 @@ class KwargsParam(VariadicParam, Final): 
     | 
|
| 
       54 
56 
     | 
    
         | 
| 
       55 
57 
     | 
    
         | 
| 
       56 
58 
     | 
    
         
             
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
       57 
     | 
    
         
            -
            class  
     | 
| 
      
 59 
     | 
    
         
            +
            class ValParam(Param):
         
     | 
| 
       58 
60 
     | 
    
         
             
                default: Maybe = empty()
         
     | 
| 
       59 
     | 
    
         
            -
                annotation: Maybe = empty()
         
     | 
| 
       60 
61 
     | 
    
         | 
| 
       61 
62 
     | 
    
         | 
| 
       62 
63 
     | 
    
         
             
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
       63 
     | 
    
         
            -
            class PosOnlyParam( 
     | 
| 
      
 64 
     | 
    
         
            +
            class PosOnlyParam(ValParam, Final):
         
     | 
| 
       64 
65 
     | 
    
         
             
                pass
         
     | 
| 
       65 
66 
     | 
    
         | 
| 
       66 
67 
     | 
    
         | 
| 
       67 
68 
     | 
    
         
             
            @dc.dataclass(frozen=True, unsafe_hash=True)
         
     | 
| 
       68 
     | 
    
         
            -
            class KwOnlyParam( 
     | 
| 
      
 69 
     | 
    
         
            +
            class KwOnlyParam(ValParam, Final):
         
     | 
| 
       69 
70 
     | 
    
         
             
                pass
         
     | 
| 
       70 
71 
     | 
    
         | 
| 
       71 
72 
     | 
    
         | 
| 
         @@ -95,8 +96,8 @@ class ParamSpec(ta.Sequence[Param], Final): 
     | 
|
| 
       95 
96 
     | 
    
         | 
| 
       96 
97 
     | 
    
         
             
                    self._hash: int | None = None
         
     | 
| 
       97 
98 
     | 
    
         | 
| 
       98 
     | 
    
         
            -
                    self._has_defaults: bool | None = None
         
     | 
| 
       99 
99 
     | 
    
         
             
                    self._has_annotations: bool | None = None
         
     | 
| 
      
 100 
     | 
    
         
            +
                    self._has_defaults: bool | None = None
         
     | 
| 
       100 
101 
     | 
    
         | 
| 
       101 
102 
     | 
    
         
             
                    self._with_seps: tuple[Param | ParamSeparator, ...] | None = None
         
     | 
| 
       102 
103 
     | 
    
         | 
| 
         @@ -108,8 +109,8 @@ class ParamSpec(ta.Sequence[Param], Final): 
     | 
|
| 
       108 
109 
     | 
    
         
             
                        sig: inspect.Signature,
         
     | 
| 
       109 
110 
     | 
    
         
             
                        *,
         
     | 
| 
       110 
111 
     | 
    
         
             
                        offset: int = 0,
         
     | 
| 
       111 
     | 
    
         
            -
                        strip_defaults: bool = False,
         
     | 
| 
       112 
112 
     | 
    
         
             
                        strip_annotations: bool = False,
         
     | 
| 
      
 113 
     | 
    
         
            +
                        strip_defaults: bool = False,
         
     | 
| 
       113 
114 
     | 
    
         
             
                ) -> 'ParamSpec':
         
     | 
| 
       114 
115 
     | 
    
         
             
                    ps: list[Param] = []
         
     | 
| 
       115 
116 
     | 
    
         | 
| 
         @@ -118,29 +119,40 @@ class ParamSpec(ta.Sequence[Param], Final): 
     | 
|
| 
       118 
119 
     | 
    
         
             
                        if i < offset:
         
     | 
| 
       119 
120 
     | 
    
         
             
                            continue
         
     | 
| 
       120 
121 
     | 
    
         | 
| 
       121 
     | 
    
         
            -
                        dfl = _inspect_empty_to_maybe(ip.default) if not strip_defaults else empty()
         
     | 
| 
       122 
122 
     | 
    
         
             
                        ann = _inspect_empty_to_maybe(ip.annotation) if not strip_annotations else empty()
         
     | 
| 
      
 123 
     | 
    
         
            +
                        dfl = _inspect_empty_to_maybe(ip.default) if not strip_defaults else empty()
         
     | 
| 
       123 
124 
     | 
    
         | 
| 
       124 
125 
     | 
    
         
             
                        if ip.kind == inspect.Parameter.POSITIONAL_ONLY:
         
     | 
| 
       125 
     | 
    
         
            -
                            ps.append(PosOnlyParam(ip.name,  
     | 
| 
      
 126 
     | 
    
         
            +
                            ps.append(PosOnlyParam(ip.name, ann, dfl))
         
     | 
| 
       126 
127 
     | 
    
         | 
| 
       127 
128 
     | 
    
         
             
                        elif ip.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD:
         
     | 
| 
       128 
     | 
    
         
            -
                            ps.append( 
     | 
| 
      
 129 
     | 
    
         
            +
                            ps.append(ValParam(ip.name, ann, dfl))
         
     | 
| 
       129 
130 
     | 
    
         | 
| 
       130 
131 
     | 
    
         
             
                        elif ip.kind == inspect.Parameter.VAR_POSITIONAL:
         
     | 
| 
       131 
     | 
    
         
            -
                            ps.append(ArgsParam(ip.name))
         
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
                        elif ip.kind == inspect.Parameter.VAR_KEYWORD:
         
     | 
| 
       134 
     | 
    
         
            -
                            ps.append(KwargsParam(ip.name))
         
     | 
| 
      
 132 
     | 
    
         
            +
                            ps.append(ArgsParam(ip.name, ann))
         
     | 
| 
       135 
133 
     | 
    
         | 
| 
       136 
134 
     | 
    
         
             
                        elif ip.kind == inspect.Parameter.KEYWORD_ONLY:
         
     | 
| 
       137 
     | 
    
         
            -
                            ps.append(KwOnlyParam(ip.name,  
     | 
| 
      
 135 
     | 
    
         
            +
                            ps.append(KwOnlyParam(ip.name, ann, dfl))
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
                        elif ip.kind == inspect.Parameter.VAR_KEYWORD:
         
     | 
| 
      
 138 
     | 
    
         
            +
                            ps.append(KwargsParam(ip.name, ann))
         
     | 
| 
       138 
139 
     | 
    
         | 
| 
       139 
140 
     | 
    
         
             
                        else:
         
     | 
| 
       140 
141 
     | 
    
         
             
                            raise ValueError(ip.kind)
         
     | 
| 
       141 
142 
     | 
    
         | 
| 
       142 
143 
     | 
    
         
             
                    return cls(*ps)
         
     | 
| 
       143 
144 
     | 
    
         | 
| 
      
 145 
     | 
    
         
            +
                @classmethod
         
     | 
| 
      
 146 
     | 
    
         
            +
                def inspect(
         
     | 
| 
      
 147 
     | 
    
         
            +
                        cls,
         
     | 
| 
      
 148 
     | 
    
         
            +
                        obj: ta.Any,
         
     | 
| 
      
 149 
     | 
    
         
            +
                        **kwargs: ta.Any,
         
     | 
| 
      
 150 
     | 
    
         
            +
                ) -> 'ParamSpec':
         
     | 
| 
      
 151 
     | 
    
         
            +
                    return cls.of_signature(
         
     | 
| 
      
 152 
     | 
    
         
            +
                        inspect.signature(obj),
         
     | 
| 
      
 153 
     | 
    
         
            +
                        **kwargs,
         
     | 
| 
      
 154 
     | 
    
         
            +
                    )
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
       144 
156 
     | 
    
         
             
                #
         
     | 
| 
       145 
157 
     | 
    
         | 
| 
       146 
158 
     | 
    
         
             
                def __repr__(self) -> str:
         
     | 
| 
         @@ -159,26 +171,26 @@ class ParamSpec(ta.Sequence[Param], Final): 
     | 
|
| 
       159 
171 
     | 
    
         | 
| 
       160 
172 
     | 
    
         
             
                #
         
     | 
| 
       161 
173 
     | 
    
         | 
| 
      
 174 
     | 
    
         
            +
                @property
         
     | 
| 
      
 175 
     | 
    
         
            +
                def has_annotations(self) -> bool:
         
     | 
| 
      
 176 
     | 
    
         
            +
                    if (ha := self._has_annotations) is not None:
         
     | 
| 
      
 177 
     | 
    
         
            +
                        return ha
         
     | 
| 
      
 178 
     | 
    
         
            +
                    self._has_annotations = ha = any(
         
     | 
| 
      
 179 
     | 
    
         
            +
                        isinstance(p, (VarParam, ValParam)) and p.annotation.present
         
     | 
| 
      
 180 
     | 
    
         
            +
                        for p in self._ps
         
     | 
| 
      
 181 
     | 
    
         
            +
                    )
         
     | 
| 
      
 182 
     | 
    
         
            +
                    return ha
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
       162 
184 
     | 
    
         
             
                @property
         
     | 
| 
       163 
185 
     | 
    
         
             
                def has_defaults(self) -> bool:
         
     | 
| 
       164 
186 
     | 
    
         
             
                    if (hd := self._has_defaults) is not None:
         
     | 
| 
       165 
187 
     | 
    
         
             
                        return hd
         
     | 
| 
       166 
188 
     | 
    
         
             
                    self._has_defaults = hd = any(
         
     | 
| 
       167 
     | 
    
         
            -
                        isinstance(p,  
     | 
| 
      
 189 
     | 
    
         
            +
                        isinstance(p, ValParam) and p.default.present
         
     | 
| 
       168 
190 
     | 
    
         
             
                        for p in self._ps
         
     | 
| 
       169 
191 
     | 
    
         
             
                    )
         
     | 
| 
       170 
192 
     | 
    
         
             
                    return hd
         
     | 
| 
       171 
193 
     | 
    
         | 
| 
       172 
     | 
    
         
            -
                @property
         
     | 
| 
       173 
     | 
    
         
            -
                def has_annotations(self) -> bool:
         
     | 
| 
       174 
     | 
    
         
            -
                    if (ha := self._has_defaults) is not None:
         
     | 
| 
       175 
     | 
    
         
            -
                        return ha
         
     | 
| 
       176 
     | 
    
         
            -
                    self._has_annotations = ha = any(
         
     | 
| 
       177 
     | 
    
         
            -
                        isinstance(p, (VariadicParam, ValueParam)) and p.annotation.present
         
     | 
| 
       178 
     | 
    
         
            -
                        for p in self._ps
         
     | 
| 
       179 
     | 
    
         
            -
                    )
         
     | 
| 
       180 
     | 
    
         
            -
                    return ha
         
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
194 
     | 
    
         
             
                #
         
     | 
| 
       183 
195 
     | 
    
         | 
| 
       184 
196 
     | 
    
         
             
                @property
         
     | 
| 
         @@ -228,22 +240,22 @@ class ParamSpec(ta.Sequence[Param], Final): 
     | 
|
| 
       228 
240 
     | 
    
         
             
            def param_render(
         
     | 
| 
       229 
241 
     | 
    
         
             
                    p: Param | ParamSeparator,
         
     | 
| 
       230 
242 
     | 
    
         
             
                    *,
         
     | 
| 
       231 
     | 
    
         
            -
                    render_default: ta.Callable[[ta.Any], str] | None = None,
         
     | 
| 
       232 
243 
     | 
    
         
             
                    render_annotation: ta.Callable[[ta.Any], str] | None = None,
         
     | 
| 
      
 244 
     | 
    
         
            +
                    render_default: ta.Callable[[ta.Any], str] | None = None,
         
     | 
| 
       233 
245 
     | 
    
         
             
            ) -> str:
         
     | 
| 
       234 
246 
     | 
    
         
             
                if isinstance(p, Param):
         
     | 
| 
       235 
     | 
    
         
            -
                    dfl_s: str | None = None
         
     | 
| 
       236 
     | 
    
         
            -
                    if isinstance(p, ValueParam) and p.default.present:
         
     | 
| 
       237 
     | 
    
         
            -
                        if render_default is None:
         
     | 
| 
       238 
     | 
    
         
            -
                            raise ValueError(f'Param {p.name} has a default but no default renderer provided')
         
     | 
| 
       239 
     | 
    
         
            -
                        dfl_s = render_default(p.default.must())
         
     | 
| 
       240 
     | 
    
         
            -
             
     | 
| 
       241 
247 
     | 
    
         
             
                    ann_s: str | None = None
         
     | 
| 
       242 
     | 
    
         
            -
                    if  
     | 
| 
      
 248 
     | 
    
         
            +
                    if p.annotation.present:
         
     | 
| 
       243 
249 
     | 
    
         
             
                        if render_annotation is None:
         
     | 
| 
       244 
250 
     | 
    
         
             
                            raise ValueError(f'Param {p.name} has an annotation but no annotation renderer provided')
         
     | 
| 
       245 
251 
     | 
    
         
             
                        ann_s = render_annotation(p.annotation.must())
         
     | 
| 
       246 
252 
     | 
    
         | 
| 
      
 253 
     | 
    
         
            +
                    dfl_s: str | None = None
         
     | 
| 
      
 254 
     | 
    
         
            +
                    if isinstance(p, ValParam) and p.default.present:
         
     | 
| 
      
 255 
     | 
    
         
            +
                        if render_default is None:
         
     | 
| 
      
 256 
     | 
    
         
            +
                            raise ValueError(f'Param {p.name} has a default but no default renderer provided')
         
     | 
| 
      
 257 
     | 
    
         
            +
                        dfl_s = render_default(p.default.must())
         
     | 
| 
      
 258 
     | 
    
         
            +
             
     | 
| 
       247 
259 
     | 
    
         
             
                    if ann_s is not None:
         
     | 
| 
       248 
260 
     | 
    
         
             
                        if dfl_s is not None:
         
     | 
| 
       249 
261 
     | 
    
         
             
                            return f'{p.name_with_prefix}: {ann_s} = {dfl_s}'
         
     | 
    
        omlish/lang/resources.py
    CHANGED
    
    | 
         @@ -1,9 +1,19 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            import dataclasses as dc
         
     | 
| 
       2 
2 
     | 
    
         
             
            import functools
         
     | 
| 
       3 
     | 
    
         
            -
            import importlib.resources
         
     | 
| 
       4 
3 
     | 
    
         
             
            import os.path
         
     | 
| 
       5 
4 
     | 
    
         
             
            import typing as ta
         
     | 
| 
       6 
5 
     | 
    
         | 
| 
      
 6 
     | 
    
         
            +
            from .imports import proxy_import
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            if ta.TYPE_CHECKING:
         
     | 
| 
      
 10 
     | 
    
         
            +
                import importlib.resources as importlib_resources
         
     | 
| 
      
 11 
     | 
    
         
            +
            else:
         
     | 
| 
      
 12 
     | 
    
         
            +
                importlib_resources = proxy_import('importlib.resources')
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            ##
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
       7 
17 
     | 
    
         | 
| 
       8 
18 
     | 
    
         
             
            @dc.dataclass(frozen=True)
         
     | 
| 
       9 
19 
     | 
    
         
             
            class ReadableResource:
         
     | 
| 
         @@ -18,7 +28,7 @@ class ReadableResource: 
     | 
|
| 
       18 
28 
     | 
    
         
             
            def get_package_resources(anchor: str) -> ta.Mapping[str, ReadableResource]:
         
     | 
| 
       19 
29 
     | 
    
         
             
                lst: list[ReadableResource] = []
         
     | 
| 
       20 
30 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                for pf in  
     | 
| 
      
 31 
     | 
    
         
            +
                for pf in importlib_resources.files(anchor).iterdir():
         
     | 
| 
       22 
32 
     | 
    
         
             
                    lst.append(ReadableResource(
         
     | 
| 
       23 
33 
     | 
    
         
             
                        name=pf.name,
         
     | 
| 
       24 
34 
     | 
    
         
             
                        is_file=pf.is_file(),
         
     | 
| 
         @@ -65,7 +75,7 @@ def get_relative_resources( 
     | 
|
| 
       65 
75 
     | 
    
         
             
                    if num_up:
         
     | 
| 
       66 
76 
     | 
    
         
             
                        pkg_parts = pkg_parts[:-num_up]
         
     | 
| 
       67 
77 
     | 
    
         
             
                    anchor = '.'.join([*pkg_parts, *path_parts])
         
     | 
| 
       68 
     | 
    
         
            -
                    for pf in  
     | 
| 
      
 78 
     | 
    
         
            +
                    for pf in importlib_resources.files(anchor).iterdir():
         
     | 
| 
       69 
79 
     | 
    
         
             
                        lst.append(ReadableResource(
         
     | 
| 
       70 
80 
     | 
    
         
             
                            name=pf.name,
         
     | 
| 
       71 
81 
     | 
    
         
             
                            is_file=pf.is_file(),
         
     | 
    
        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,  
     | 
| 
      
 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  
     | 
| 
      
 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))
         
     | 
    
        omlish/specs/jsonrpc/types.py
    CHANGED
    
    
| 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            omlish/.manifests.json,sha256=x26AIwDzScUvnX-p4xlq6Zc5QYrAo0Vmgf1qHc1KL_M,8253
         
     | 
| 
       2 
     | 
    
         
            -
            omlish/__about__.py,sha256= 
     | 
| 
      
 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= 
     | 
| 
      
 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
         
     | 
| 
         @@ -400,7 +400,7 @@ omlish/iterators/iterators.py,sha256=iTQQwBE6Wzoy36dnbPIws17zbjE3zNN4KwVw4Fzh-gY 
     | 
|
| 
       400 
400 
     | 
    
         
             
            omlish/iterators/recipes.py,sha256=53mkexitMhkwXQZbL6DrhpT0WePQ_56uXd5Jaw3DfzI,467
         
     | 
| 
       401 
401 
     | 
    
         
             
            omlish/iterators/tools.py,sha256=Pi4ybXytUXVZ3xwK89xpPImQfYYId9p1vIFQvVqVLqA,2551
         
     | 
| 
       402 
402 
     | 
    
         
             
            omlish/iterators/unique.py,sha256=0jAX3kwzVfRNhe0Tmh7kVP_Q2WBIn8POo_O-rgFV0rQ,1390
         
     | 
| 
       403 
     | 
    
         
            -
            omlish/lang/__init__.py,sha256= 
     | 
| 
      
 403 
     | 
    
         
            +
            omlish/lang/__init__.py,sha256=TKxKq0L7Q34kdV0_UcxC81Umx64Uz_TPUgH6cy7Uzck,4892
         
     | 
| 
       404 
404 
     | 
    
         
             
            omlish/lang/attrs.py,sha256=fofCKN0X8TMu1yGqHpLpNLih9r9HWl3D3Vn3b6O791w,3891
         
     | 
| 
       405 
405 
     | 
    
         
             
            omlish/lang/clsdct.py,sha256=sJYadm-fwzti-gsi98knR5qQUxriBmOqQE_qz3RopNk,1743
         
     | 
| 
       406 
406 
     | 
    
         
             
            omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
         
     | 
| 
         @@ -415,14 +415,14 @@ 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= 
     | 
| 
      
 418 
     | 
    
         
            +
            omlish/lang/params.py,sha256=QmNVBfJsfxjDG5ilDPgHV7sK4UwRztkSQdLTo0umb8I,6648
         
     | 
| 
       419 
419 
     | 
    
         
             
            omlish/lang/resolving.py,sha256=OuN2mDTPNyBUbcrswtvFKtj4xgH4H4WglgqSKv3MTy0,1606
         
     | 
| 
       420 
     | 
    
         
            -
            omlish/lang/resources.py,sha256= 
     | 
| 
      
 420 
     | 
    
         
            +
            omlish/lang/resources.py,sha256=WKkAddC3ctMK1bvGw-elGe8ZxAj2IaUTKVSu2nfgHTo,2839
         
     | 
| 
       421 
421 
     | 
    
         
             
            omlish/lang/strings.py,sha256=egdv8PxLNG40-5V93agP5j2rBUDIsahCx048zV7uEbU,4690
         
     | 
| 
       422 
422 
     | 
    
         
             
            omlish/lang/sys.py,sha256=UoZz_PJYVKLQAKqYxxn-LHz1okK_38I__maZgnXMcxU,406
         
     | 
| 
       423 
423 
     | 
    
         
             
            omlish/lang/typing.py,sha256=Zdad9Zv0sa-hIaUXPrzPidT7sDVpRcussAI7D-j-I1c,3296
         
     | 
| 
       424 
424 
     | 
    
         
             
            omlish/lang/cached/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
         
     | 
| 
       425 
     | 
    
         
            -
            omlish/lang/cached/function.py,sha256= 
     | 
| 
      
 425 
     | 
    
         
            +
            omlish/lang/cached/function.py,sha256=3AeTVfpzovMMWbnjFuT5mM7kT1dBuk7fa66FOJKikYw,9188
         
     | 
| 
       426 
426 
     | 
    
         
             
            omlish/lang/cached/property.py,sha256=kzbao_35PlszdK_9oJBWrMmFFlVK_Xhx7YczHhTJ6cc,2764
         
     | 
| 
       427 
427 
     | 
    
         
             
            omlish/lang/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
         
     | 
| 
       428 
428 
     | 
    
         
             
            omlish/lang/classes/abstract.py,sha256=bIcuAetV_aChhpSURypmjjcqP07xi20uVYPKh1kvQNU,3710
         
     | 
| 
         @@ -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= 
     | 
| 
      
 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= 
     | 
| 
      
 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= 
     | 
| 
      
 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. 
     | 
| 
       739 
     | 
    
         
            -
            omlish-0.0.0. 
     | 
| 
       740 
     | 
    
         
            -
            omlish-0.0.0. 
     | 
| 
       741 
     | 
    
         
            -
            omlish-0.0.0. 
     | 
| 
       742 
     | 
    
         
            -
            omlish-0.0.0. 
     | 
| 
       743 
     | 
    
         
            -
            omlish-0.0.0. 
     | 
| 
      
 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,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |