Skip to content

Commit

Permalink
deploy: 28a0ad0
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Jul 9, 2024
1 parent 5debaa2 commit 3fdb7fa
Show file tree
Hide file tree
Showing 255 changed files with 7,405 additions and 6,418 deletions.
33 changes: 32 additions & 1 deletion develop/_sources/dev-guide/using-sharrow.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ memory, as the variable is computed and stored for every row in the entire dataf
before it can be used in other expressions. In sharrow, temporary variables are
allocated, used, and freed for each row separately, so no extra memory is required.

### Pandas-only Expressions

In legacy mode, expressions can be evaluated using expressions that tap into the
full pandas library, including the ability to call pandas functions and methods
directly. This is not possible in sharrow, as the expressions are compiled into
numba code, which does not have access to the pandas library. If a pandas function
is needed, it must be called in a pre-processor. However, many pandas functions
can be replaced with numpy functions, which are available in numba. For example,
`df.income.fillna(0)` can be replaced with `np.nan_to_num(df.income)`.

### Switchable Expressions

As a general rule, it is best to write each utility expression in a manner that
Expand All @@ -193,13 +203,23 @@ in several examples:
`@np.log1p(size_terms.get(df.alt_dest, df.purpose)) # sharrow: np.log1p(size_terms['sizearray'])`

Here, `size_terms` is a DataFrameMatrix class instance, a special class written into
ActivitySim to facilitate reading from a DataFrame as it it were a 2-d array. As it
ActivitySim to facilitate reading from a DataFrame as if it were a 2-d array. As it
is a special purpose class written in Python, the numba compiler cannot handle it directly.
Fortunately, sharrow provides an alternative: passing the size terms as a xarray `DataArray`.
This has a slightly different interface, so the sharrow and legacy evaluation modes require
different expressions. The switching expression is used to handle the DataFrameMatrix
on the left (before "# sharrow:") and the DataArray on the right.

### Optional Variables

In some cases, a variable may be used where it is available, but is not strictly
necessary for the model to run. For example, a model may have a reference to
mode choice logsums, but the model can still run without them, if it is being used
prior to when logsums are calculated. In this case, the variable can be accessed
using the `get` method, which allows for a default value if the variable is not found.

`@df.get('mode_choice_logsum', 0)`

### Performance Considerations

Sharrow is usually expected to bring significant performance gains to ActivitySim.
Expand All @@ -222,6 +242,17 @@ compute_settings:

in the component's configuration yaml file.

In addition, by default sharrow also tries to optimize performance by setting the
`fastmath` flag to True in the numba compiler. This makes the compiler generate
faster code, by assuming that all variables have finite values (not NaN or Inf).
If the model has expressions that use variables that can contains NaN or Inf
values, the `fastmath` flag can be disabled by setting

```yaml
compute_settings:
fastmath: false
```

### Multiprocessing Performance

Sharrow leverages a number of performance enhancing techniques, including
Expand Down
2 changes: 1 addition & 1 deletion develop/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.3.0b3.dev11+gbd48d3db',
VERSION: '1.3.0b3.dev12+g28a0ad0f',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion develop/_static/scripts/pydata-sphinx-theme.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion develop/_static/scripts/pydata-sphinx-theme.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion develop/_static/styles/pydata-sphinx-theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion develop/_static/styles/pydata-sphinx-theme.css.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions develop/_static/webpack-macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
-->
{# Load FontAwesome icons #}
{% macro head_pre_icons() %}
<link href="{{ pathto('_static/vendor/fontawesome/6.5.2/css/all.min.css', 1) }}?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="{{ pathto('_static/vendor/fontawesome/6.5.2/css/all.min.css', 1) }}?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ pathto('_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2', 1) }}" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ pathto('_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2', 1) }}" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{ pathto('_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2', 1) }}" />
{% endmacro %}

{% macro head_pre_assets() %}
<!-- Loaded before other Sphinx assets -->
<link href="{{ pathto('_static/styles/theme.css', 1) }}?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="{{ pathto('_static/styles/bootstrap.css', 1) }}?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="{{ pathto('_static/styles/pydata-sphinx-theme.css', 1) }}?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="{{ pathto('_static/styles/theme.css', 1) }}?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="{{ pathto('_static/styles/bootstrap.css', 1) }}?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="{{ pathto('_static/styles/pydata-sphinx-theme.css', 1) }}?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
{% endmacro %}

{% macro head_js_preload() %}
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="{{ pathto('_static/scripts/bootstrap.js', 1) }}?digest=3ee479438cf8b5e0d341" />
<link rel="preload" as="script" href="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=3ee479438cf8b5e0d341" />
<script src="{{ pathto('_static/vendor/fontawesome/6.5.2/js/all.min.js', 1) }}?digest=3ee479438cf8b5e0d341"></script>
<link rel="preload" as="script" href="{{ pathto('_static/scripts/bootstrap.js', 1) }}?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=dfe6caa3a7d634c4db9b" />
<script src="{{ pathto('_static/vendor/fontawesome/6.5.2/js/all.min.js', 1) }}?digest=dfe6caa3a7d634c4db9b"></script>
{% endmacro %}

{% macro body_post() %}
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="{{ pathto('_static/scripts/bootstrap.js', 1) }}?digest=3ee479438cf8b5e0d341"></script>
<script src="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=3ee479438cf8b5e0d341"></script>
<script src="{{ pathto('_static/scripts/bootstrap.js', 1) }}?digest=dfe6caa3a7d634c4db9b"></script>
<script src="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=dfe6caa3a7d634c4db9b"></script>
{% endmacro %}
54 changes: 28 additions & 26 deletions develop/benchmarking.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
</script>

<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />


<link href="_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=3ee479438cf8b5e0d341" rel="stylesheet" />
<link href="_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
Expand All @@ -36,19 +36,19 @@
<link rel="stylesheet" type="text/css" href="_static/theme_overrides.css?v=86d88d25" />

<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=3ee479438cf8b5e0d341" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=3ee479438cf8b5e0d341" />
<script src="_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=3ee479438cf8b5e0d341"></script>
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>

<script src="_static/documentation_options.js?v=6ea2c554"></script>
<script src="_static/documentation_options.js?v=b20a2813"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=f281be69"></script>
<script src="_static/design-tabs.js?v=f930bc37"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'benchmarking';</script>
<script>
DOCUMENTATION_OPTIONS.theme_version = '0.15.3';
DOCUMENTATION_OPTIONS.theme_version = '0.15.4';
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://activitysim.github.io/activitysim/switcher.json';
DOCUMENTATION_OPTIONS.theme_switcher_version_match = '1.3.0';
DOCUMENTATION_OPTIONS.show_version_warning_banner = false;
Expand All @@ -59,7 +59,7 @@
<link rel="prev" title="Core Components" href="core.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docbuild:last-update" content="Jun 20, 2024"/>
<meta name="docbuild:last-update" content="Jul 09, 2024"/>
</head>


Expand Down Expand Up @@ -113,7 +113,7 @@

<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
<div class="bd-header__inner bd-page-width">
<button class="sidebar-toggle primary-toggle" aria-label="Site navigation">
<button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation">
<span class="fa-solid fa-bars"></span>
</button>

Expand All @@ -123,6 +123,8 @@
<div class="navbar-item">





<a class="navbar-brand logo" href="index.html">

Expand All @@ -142,17 +144,17 @@
<div class="me-auto navbar-header-items__center">

<div class="navbar-item">
<nav class="navbar-nav">
<nav>
<ul class="bd-navbar-elements navbar-nav">

<li class="nav-item pst-header-nav-item">
<li class="nav-item ">
<a class="nav-link nav-internal" href="users-guide/index.html">
Users Guide
</a>
</li>


<li class="nav-item pst-header-nav-item current active">
<li class="nav-item current active">
<a class="nav-link nav-internal" href="dev-guide/index.html">
Developers
</a>
Expand All @@ -171,7 +173,7 @@

<script>
document.write(`
<button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
Expand All @@ -187,7 +189,7 @@
<div class="version-switcher__container dropdown">
<button id="pst-version-switcher-button-2"
type="button"
class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle"
class="version-switcher__button btn btn-sm dropdown-toggle"
data-bs-toggle="dropdown"
aria-haspopup="listbox"
aria-controls="pst-version-switcher-list-2"
Expand All @@ -214,7 +216,7 @@

<script>
document.write(`
<button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
Expand All @@ -225,7 +227,7 @@



<button class="sidebar-toggle secondary-toggle" aria-label="On this page">
<button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="On this page">
<span class="fa-solid fa-outdent"></span>
</button>

Expand All @@ -251,17 +253,17 @@


<div class="navbar-item">
<nav class="navbar-nav">
<nav>
<ul class="bd-navbar-elements navbar-nav">

<li class="nav-item pst-header-nav-item">
<li class="nav-item ">
<a class="nav-link nav-internal" href="users-guide/index.html">
Users Guide
</a>
</li>


<li class="nav-item pst-header-nav-item current active">
<li class="nav-item current active">
<a class="nav-link nav-internal" href="dev-guide/index.html">
Developers
</a>
Expand All @@ -283,7 +285,7 @@
<div class="version-switcher__container dropdown">
<button id="pst-version-switcher-button-3"
type="button"
class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle"
class="version-switcher__button btn btn-sm dropdown-toggle"
data-bs-toggle="dropdown"
aria-haspopup="listbox"
aria-controls="pst-version-switcher-list-3"
Expand Down Expand Up @@ -788,8 +790,8 @@ <h2>Running Benchmarks for Pull Requests<a class="headerlink" href="#running-ben
</div>

<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="_static/scripts/bootstrap.js?digest=3ee479438cf8b5e0d341"></script>
<script src="_static/scripts/pydata-sphinx-theme.js?digest=3ee479438cf8b5e0d341"></script>
<script src="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>

<footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
Expand All @@ -798,7 +800,7 @@ <h2>Running Benchmarks for Pull Requests<a class="headerlink" href="#running-ben

<div class="footer-item"><!-- This will display the version of the docs -->
<p class="last-updated">
ActivitySim 1.3.0b3.dev11+gbd48d3db, documentation last updated Jun 20, 2024.<br/>
ActivitySim 1.3.0b3.dev12+g28a0ad0f, documentation last updated Jul 09, 2024.<br/>
</p></div>

<div class="footer-item">
Expand All @@ -817,7 +819,7 @@ <h2>Running Benchmarks for Pull Requests<a class="headerlink" href="#running-ben

<div class="footer-item">
<p class="theme-version">
Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.15.3.
Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.15.4.
</p></div>

</div>
Expand Down
Loading

0 comments on commit 3fdb7fa

Please sign in to comment.