Liking cljdoc? Tell your friends :D
Clojure only.

urpx.tz-inference

Best-effort timezone inference for URPX rate plans whose urpx:timezoneIdentifier is absent.

This namespace is opt-inurpx.schedule does not call it automatically. Callers that want plug-and-play timezone resolution compose inference with the declared field at the call site:

(or (some-> plan :urpx/timezoneIdentifier ZoneId/of)
    (:zone (urpx.tz-inference/infer-zone plan)))

Inference uses utility-identifying fields on the publishing Organization: urpx:eiaId (preferred — official US energy reporting code) and urpx:legalName (fallback). When the utility is unknown to the lookup tables, or known to operate across more than one IANA zone, infer-zone returns nil so the caller can fail loudly rather than silently pick one.

The shipped tables only cover utilities used by the clj-urpx test suite; production deployments are expected to supply their own table (e.g. derived from EIA Form 861).

Best-effort timezone inference for URPX rate plans whose
`urpx:timezoneIdentifier` is absent.

This namespace is **opt-in** — `urpx.schedule` does not call it
automatically. Callers that want plug-and-play timezone resolution
compose inference with the declared field at the call site:

    (or (some-> plan :urpx/timezoneIdentifier ZoneId/of)
        (:zone (urpx.tz-inference/infer-zone plan)))

Inference uses utility-identifying fields on the publishing
Organization: `urpx:eiaId` (preferred — official US energy reporting
code) and `urpx:legalName` (fallback). When the utility is unknown to
the lookup tables, or known to operate across more than one IANA
zone, `infer-zone` returns `nil` so the caller can fail loudly rather
than silently pick one.

The shipped tables only cover utilities used by the clj-urpx test
suite; production deployments are expected to supply their own table
(e.g. derived from EIA Form 861).
raw docstring

infer-zoneclj

(infer-zone plan)
(infer-zone plan opts)

Best-effort timezone inference for a coerced urpx:RatePlan or urpx:RatePlanModifier.

Returns nil when no reliable inference can be made (utility unknown to the tables, or known but multi-zone, or no identifying fields). Otherwise returns:

{:zone java.time.ZoneId :inferred-from {:source <:eia-id|:legal-name> :value <the field value used> :iana <the IANA zone string>}}

opts map (all optional): :eia-id->zone map of EIA-ID string -> IANA zone string; merged on top of the built-in table (caller entries win over defaults). :legal-name->zone map of legalName -> IANA zone string; likewise merged.

Inference does NOT consult urpx:timezoneIdentifier — that's the declared field, not inference. Callers compose:

(or (some-> plan :urpx/timezoneIdentifier ZoneId/of)
    (:zone (infer-zone plan)))
Best-effort timezone inference for a coerced urpx:RatePlan or
urpx:RatePlanModifier.

Returns nil when no reliable inference can be made (utility unknown
to the tables, or known but multi-zone, or no identifying fields).
Otherwise returns:

  {:zone java.time.ZoneId
   :inferred-from {:source <:eia-id|:legal-name>
                   :value  <the field value used>
                   :iana   <the IANA zone string>}}

`opts` map (all optional):
  :eia-id->zone      map of EIA-ID string -> IANA zone string;
                     merged on top of the built-in table (caller
                     entries win over defaults).
  :legal-name->zone  map of legalName -> IANA zone string;
                     likewise merged.

Inference does NOT consult `urpx:timezoneIdentifier` — that's the
declared field, not inference. Callers compose:

    (or (some-> plan :urpx/timezoneIdentifier ZoneId/of)
        (:zone (infer-zone plan)))
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close