Skip to content

Commit

Permalink
build based on 1912abe
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 20, 2024
1 parent 1b8f75a commit 0cf6a9b
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-29T09:08:48","documenter_version":"1.8.0"}}
{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-20T07:48:11","documenter_version":"1.8.0"}}
2 changes: 1 addition & 1 deletion dev/LICENSE/index.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dev/conversion/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/dates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Interoperability with Dates · Unitful.jl</title><meta name="title" content="Interoperability with Dates · Unitful.jl"/><meta property="og:title" content="Interoperability with Dates · Unitful.jl"/><meta property="twitter:title" content="Interoperability with Dates · Unitful.jl"/><meta name="description" content="Documentation for Unitful.jl."/><meta property="og:description" content="Documentation for Unitful.jl."/><meta property="twitter:description" content="Documentation for Unitful.jl."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img class="docs-light-only" src="../assets/logo.svg" alt="Unitful.jl logo"/><img class="docs-dark-only" src="../assets/logo-dark.svg" alt="Unitful.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">Unitful.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../highlights/">Highlighted features</a></li><li><a class="tocitem" href="../types/">Types</a></li><li><a class="tocitem" href="../newunits/">Defining new units</a></li><li><a class="tocitem" href="../conversion/">Conversion/promotion</a></li><li><a class="tocitem" href="../manipulations/">Manipulating units</a></li><li><a class="tocitem" href="../display/">How units are displayed</a></li><li><a class="tocitem" href="../logarithm/">Logarithmic scales</a></li><li><a class="tocitem" href="../temperature/">Temperature scales</a></li><li class="is-active"><a class="tocitem" href>Interoperability with <code>Dates</code></a><ul class="internal"><li><a class="tocitem" href="#Support-for-Dates.FixedPeriods"><span>Support for <code>Dates.FixedPeriod</code>s</span></a></li><li><a class="tocitem" href="#Support-for-Dates.CompoundPeriods"><span>Support for <code>Dates.CompoundPeriod</code>s</span></a></li></ul></li><li><a class="tocitem" href="../extending/">Extending Unitful</a></li><li><a class="tocitem" href="../trouble/">Troubleshooting</a></li><li><a class="tocitem" href="../defaultunits/">Pre-defined units and constants</a></li><li><a class="tocitem" href="../LICENSE/">License</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Interoperability with <code>Dates</code></a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Interoperability with <code>Dates</code></a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/PainterQubits/Unitful.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/PainterQubits/Unitful.jl/blob/master/docs/src/dates.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Interoperability-with-the-Dates-standard-library"><a class="docs-heading-anchor" href="#Interoperability-with-the-Dates-standard-library">Interoperability with the <code>Dates</code> standard library</a><a id="Interoperability-with-the-Dates-standard-library-1"></a><a class="docs-heading-anchor-permalink" href="#Interoperability-with-the-Dates-standard-library" title="Permalink"></a></h1><p><a href="https://docs.julialang.org/en/v1/stdlib/Dates/">Julia&#39;s <code>Dates</code> standard library</a> provides data types for representing specific points in time <code>Date</code>/<code>DateTime</code> and differences between them, i.e., periods. Unitful provides methods for using period types from the <code>Dates</code> standard library together with <code>Quantity</code>s.</p><h2 id="Support-for-Dates.FixedPeriods"><a class="docs-heading-anchor" href="#Support-for-Dates.FixedPeriods">Support for <code>Dates.FixedPeriod</code>s</a><a id="Support-for-Dates.FixedPeriods-1"></a><a class="docs-heading-anchor-permalink" href="#Support-for-Dates.FixedPeriods" title="Permalink"></a></h2><p>The <code>Dates.FixedPeriod</code> union type includes all <code>Dates.Period</code>s that represent a fixed period of time, i.e., <code>Dates.Week</code>, <code>Dates.Day</code>, <code>Dates.Hour</code>, <code>Dates.Minute</code>, <code>Dates.Second</code>, <code>Dates.Millisecond</code>, <code>Dates.Microsecond</code>, and <code>Dates.Nanosecond</code>. These types can be converted to <code>Quantity</code>s or used in place of them.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p><code>Dates.Year</code> does not represent a fixed period and cannot be converted to a <code>Quantity</code>. While Unitful&#39;s <code>yr</code> unit is exactly equal to 365.25 days, a <code>Dates.Year</code> may contain 365 or 366 days.</p></div></div><p>Each <code>FixedPeriod</code> is considered equivalent to a <code>Quantity</code>. For example, <code>Dates.Millisecond(5)</code> corresponds to the quantity <code>Int64(5)*u&quot;ms&quot;</code>. A <code>FixedPeriod</code> can be converted to the equivalent <code>Quantity</code> with a constructor:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Unitful.Quantity-Tuple{Union{Day, Hour, Microsecond, Millisecond, Minute, Nanosecond, Second, Week}}" href="#Unitful.Quantity-Tuple{Union{Day, Hour, Microsecond, Millisecond, Minute, Nanosecond, Second, Week}}"><code>Unitful.Quantity</code></a><span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Quantity(period::Dates.FixedPeriod)</code></pre><p>Create a <code>Quantity</code> that corresponds to the given <code>period</code>. The numerical value of the resulting <code>Quantity</code> is of type <code>Int64</code>.</p><p><strong>Example</strong></p><pre><code class="language-julia-repl hljs">julia&gt; using Dates: Second

julia&gt; Quantity(Second(5))
5 s</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/PainterQubits/Unitful.jl/blob/cde16df8ae71178c3b3ece39afbe6455ff33b451/src/dates.jl#L41-L55">source</a></section></article><p>In most respects, <code>FixedPeriod</code>s behave like their equivalent quantities. They can be converted to other units using <code>uconvert</code>, used in arithmetic operations with other quantities, and they have a <code>unit</code> and <code>dimension</code>:</p><pre><code class="language-julia-repl hljs">julia&gt; using Dates: Hour
5 s</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/PainterQubits/Unitful.jl/blob/1912abee8b5afb744ee275e90808d9b484640038/src/dates.jl#L41-L55">source</a></section></article><p>In most respects, <code>FixedPeriod</code>s behave like their equivalent quantities. They can be converted to other units using <code>uconvert</code>, used in arithmetic operations with other quantities, and they have a <code>unit</code> and <code>dimension</code>:</p><pre><code class="language-julia-repl hljs">julia&gt; using Dates: Hour

julia&gt; p = Hour(3)
3 hours
Expand Down Expand Up @@ -73,4 +73,4 @@
[...]

julia&gt; T = typeof(1.0u&quot;hr&quot;); T(p) # ... but it can be converted to a concrete time quantity
8766.0 hr</code></pre><p>Consequently, any operation whose result would depend on the input unit is not supported by <code>CompoundPeriod</code>s. For example:</p><ul><li><code>+(::Quantity, ::CompoundPeriod)</code> and <code>+(::CompoundPeriod, ::Quantity)</code> error, since the unit of the result depends on the units of both arguments.</li><li><code>div(::Quantity, ::CompoundPeriod)</code> and <code>div(::CompoundPeriod, ::Quantity)</code> work, since the result is a dimensionless number.</li><li><code>mod(::CompoundPeriod, ::Quantity)</code> works, but <code>mod(::Quantity, ::CompoundPeriod)</code> does not, since the second argument determines the unit of the returned quantity.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../temperature/">« Temperature scales</a><a class="docs-footer-nextpage" href="../extending/">Extending Unitful »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 29 November 2024 09:08">Friday 29 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
8766.0 hr</code></pre><p>Consequently, any operation whose result would depend on the input unit is not supported by <code>CompoundPeriod</code>s. For example:</p><ul><li><code>+(::Quantity, ::CompoundPeriod)</code> and <code>+(::CompoundPeriod, ::Quantity)</code> error, since the unit of the result depends on the units of both arguments.</li><li><code>div(::Quantity, ::CompoundPeriod)</code> and <code>div(::CompoundPeriod, ::Quantity)</code> work, since the result is a dimensionless number.</li><li><code>mod(::CompoundPeriod, ::Quantity)</code> works, but <code>mod(::Quantity, ::CompoundPeriod)</code> does not, since the second argument determines the unit of the returned quantity.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../temperature/">« Temperature scales</a><a class="docs-footer-nextpage" href="../extending/">Extending Unitful »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Friday 20 December 2024 07:48">Friday 20 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/defaultunits/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 0cf6a9b

Please sign in to comment.