diff --git a/docs/build/doctrees/binary_c_parameters.doctree b/docs/build/doctrees/binary_c_parameters.doctree index 3576f8f30d0241045bf36be47a029efb094dcf7b..cf305410f445c73af0d6be545245094c96876506 100644 Binary files a/docs/build/doctrees/binary_c_parameters.doctree and b/docs/build/doctrees/binary_c_parameters.doctree differ diff --git a/docs/build/doctrees/custom_logging_functions.doctree b/docs/build/doctrees/custom_logging_functions.doctree index 642a5964b72e1ff2a2c36feb480750939f837194..51585946ea244d40eb9fd0b2a05a807c4cfe89e3 100644 Binary files a/docs/build/doctrees/custom_logging_functions.doctree and b/docs/build/doctrees/custom_logging_functions.doctree differ diff --git a/docs/build/doctrees/dicts.doctree b/docs/build/doctrees/dicts.doctree new file mode 100644 index 0000000000000000000000000000000000000000..bf5f8fa240944372ae8354c459cfafb47c2aeb2d Binary files /dev/null and b/docs/build/doctrees/dicts.doctree differ diff --git a/docs/build/doctrees/distribution_functions.doctree b/docs/build/doctrees/distribution_functions.doctree deleted file mode 100644 index dc4c5d1108d5f1a4b221d3a813ec874f611f7ffc..0000000000000000000000000000000000000000 Binary files a/docs/build/doctrees/distribution_functions.doctree and /dev/null differ diff --git a/docs/build/doctrees/ensemble.doctree b/docs/build/doctrees/ensemble.doctree new file mode 100644 index 0000000000000000000000000000000000000000..b2e45fa648091d57c2646e6f4be1567142c547f3 Binary files /dev/null and b/docs/build/doctrees/ensemble.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 383ae9c0ca2273b1673f808c60b5bfd024acacbd..db96aa4e090bd234cd47c2e2301dd6abc7469249 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/example_notebooks.doctree b/docs/build/doctrees/example_notebooks.doctree index 0ab96e4a2d0c0f64d340eab011927aef5793ad2d..6d021fc5f3371b321fb06c102711a6e978cb8e23 100644 Binary files a/docs/build/doctrees/example_notebooks.doctree and b/docs/build/doctrees/example_notebooks.doctree differ diff --git a/docs/build/doctrees/examples/notebook_BHBH.doctree b/docs/build/doctrees/examples/notebook_BHBH.doctree index 87d1089f58c156d520f02167f2953443b0c2a5a2..c09d847bcec7347860659b7f5e60f269c472d11a 100644 Binary files a/docs/build/doctrees/examples/notebook_BHBH.doctree and b/docs/build/doctrees/examples/notebook_BHBH.doctree differ diff --git a/docs/build/doctrees/examples/notebook_HRD.doctree b/docs/build/doctrees/examples/notebook_HRD.doctree index 926ff29530b8a05ae9ffea69e1eb488ceaa229e3..282fb895e389b41478d190cd84a43128290474b8 100644 Binary files a/docs/build/doctrees/examples/notebook_HRD.doctree and b/docs/build/doctrees/examples/notebook_HRD.doctree differ diff --git a/docs/build/doctrees/examples/notebook_api_functionality.doctree b/docs/build/doctrees/examples/notebook_api_functionality.doctree index 684826e9184082c3149350b122c147becd697e78..89d3468a7d48104544a2ddd73bd6163d583890d5 100644 Binary files a/docs/build/doctrees/examples/notebook_api_functionality.doctree and b/docs/build/doctrees/examples/notebook_api_functionality.doctree differ diff --git a/docs/build/doctrees/examples/notebook_common_envelope_evolution.doctree b/docs/build/doctrees/examples/notebook_common_envelope_evolution.doctree index c5b8bc5085038a43018ddf8f5871fdafa5632c42..e37fd7001b9688004a318ddfcc7c344f026a7592 100644 Binary files a/docs/build/doctrees/examples/notebook_common_envelope_evolution.doctree and b/docs/build/doctrees/examples/notebook_common_envelope_evolution.doctree differ diff --git a/docs/build/doctrees/examples/notebook_custom_logging.doctree b/docs/build/doctrees/examples/notebook_custom_logging.doctree index d64124b4407bff166a9c6d2377d0dca16050b9e5..d22e13968ec7b15b3540b8fe01c1d884e1c689ca 100644 Binary files a/docs/build/doctrees/examples/notebook_custom_logging.doctree and b/docs/build/doctrees/examples/notebook_custom_logging.doctree differ diff --git a/docs/build/doctrees/examples/notebook_extra_features.doctree b/docs/build/doctrees/examples/notebook_extra_features.doctree index f61a55866eb232d41c7e0071ce1582a46c42dbf5..2177b0affba5e37d9aeaddd01f502ef9d04500e1 100644 Binary files a/docs/build/doctrees/examples/notebook_extra_features.doctree and b/docs/build/doctrees/examples/notebook_extra_features.doctree differ diff --git a/docs/build/doctrees/examples/notebook_individual_systems.doctree b/docs/build/doctrees/examples/notebook_individual_systems.doctree index e67858541c311d86f97d1371dafa52a3963d287f..77ffa8d59620bf2b44b7a69e7e1a2c17de177f5c 100644 Binary files a/docs/build/doctrees/examples/notebook_individual_systems.doctree and b/docs/build/doctrees/examples/notebook_individual_systems.doctree differ diff --git a/docs/build/doctrees/examples/notebook_luminosity_function_binaries.doctree b/docs/build/doctrees/examples/notebook_luminosity_function_binaries.doctree index 53566badc2f81499d9a727d25450ddd668e39d85..e561576c40fc7828ce780a9226bcbaf13ac8234e 100644 Binary files a/docs/build/doctrees/examples/notebook_luminosity_function_binaries.doctree and b/docs/build/doctrees/examples/notebook_luminosity_function_binaries.doctree differ diff --git a/docs/build/doctrees/examples/notebook_luminosity_function_single.doctree b/docs/build/doctrees/examples/notebook_luminosity_function_single.doctree index ea877efa9980675d64db311a5be47cdbeaae2ebc..019c0078ec2a9213d267912382d284e80e36898a 100644 Binary files a/docs/build/doctrees/examples/notebook_luminosity_function_single.doctree and b/docs/build/doctrees/examples/notebook_luminosity_function_single.doctree differ diff --git a/docs/build/doctrees/examples/notebook_massive_remnants.doctree b/docs/build/doctrees/examples/notebook_massive_remnants.doctree index b4ab5e7ae17cd0d2675f4966a58b794ed723bb92..fd71cbfc44537a8a89fe481f90f4568b0995540c 100644 Binary files a/docs/build/doctrees/examples/notebook_massive_remnants.doctree and b/docs/build/doctrees/examples/notebook_massive_remnants.doctree differ diff --git a/docs/build/doctrees/examples/notebook_population.doctree b/docs/build/doctrees/examples/notebook_population.doctree index 0305266b6d228df0f843644d247d6a9a7930e940..14c9b35f4e77b5c108af1ba71d035128f82e8895 100644 Binary files a/docs/build/doctrees/examples/notebook_population.doctree and b/docs/build/doctrees/examples/notebook_population.doctree differ diff --git a/docs/build/doctrees/examples/notebook_solar_system.doctree b/docs/build/doctrees/examples/notebook_solar_system.doctree index 56c3375ce9c83cbcb3e6f93e97283c2061c596e3..1c469f935789e3b5ff3c8c40b19924be7c911fb5 100644 Binary files a/docs/build/doctrees/examples/notebook_solar_system.doctree and b/docs/build/doctrees/examples/notebook_solar_system.doctree differ diff --git a/docs/build/doctrees/examples/old/basic_example.doctree b/docs/build/doctrees/examples/old/basic_example.doctree index 63c9b29f85a533e1fb840314daa3a24e8039fd88..1e70ff402cdaed71164f6a02d118a0a4ae47b6e3 100644 Binary files a/docs/build/doctrees/examples/old/basic_example.doctree and b/docs/build/doctrees/examples/old/basic_example.doctree differ diff --git a/docs/build/doctrees/examples/old/workshop_example_notebook.doctree b/docs/build/doctrees/examples/old/workshop_example_notebook.doctree index a3b9462409aeda6860fb26ddfeec3446f72723e4..49f080853e875625a189e83e44cf9255e3bb2787 100644 Binary files a/docs/build/doctrees/examples/old/workshop_example_notebook.doctree and b/docs/build/doctrees/examples/old/workshop_example_notebook.doctree differ diff --git a/docs/build/doctrees/functions.doctree b/docs/build/doctrees/functions.doctree index b4036fe2e12b415839a127aca024fb8edce95787..35b607eede09ade1ce809077ca202eee40068fb3 100644 Binary files a/docs/build/doctrees/functions.doctree and b/docs/build/doctrees/functions.doctree differ diff --git a/docs/build/doctrees/grid.doctree b/docs/build/doctrees/grid.doctree index 2bfa07a68a07de11eaa828cdd17c4cafa77d4415..8a2560c2b14351f019d43d981e618fe31e2f0467 100644 Binary files a/docs/build/doctrees/grid.doctree and b/docs/build/doctrees/grid.doctree differ diff --git a/docs/build/doctrees/grid_options_defaults.doctree b/docs/build/doctrees/grid_options_defaults.doctree deleted file mode 100644 index a32c2aa286a8233f08760d46e8c9bb40c47196cb..0000000000000000000000000000000000000000 Binary files a/docs/build/doctrees/grid_options_defaults.doctree and /dev/null differ diff --git a/docs/build/doctrees/grid_options_descriptions.doctree b/docs/build/doctrees/grid_options_descriptions.doctree index ffa9f997be094ec9a7e20d7e3f998786dab9e2be..a30f23bf781d9fea56d69873b03d092eddbe044d 100644 Binary files a/docs/build/doctrees/grid_options_descriptions.doctree and b/docs/build/doctrees/grid_options_descriptions.doctree differ diff --git a/docs/build/doctrees/hpc_functions.doctree b/docs/build/doctrees/hpc_functions.doctree deleted file mode 100644 index 71962fe2476d80d669b4b41995b4d8ffe1c01138..0000000000000000000000000000000000000000 Binary files a/docs/build/doctrees/hpc_functions.doctree and /dev/null differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index a55d235a1b7c6d8d207609ff118f7a1be251ce13..f7ca0740c94d8be9c760cb46606669f6a317b94a 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/modules.doctree b/docs/build/doctrees/modules.doctree index a3a49172753426fe960a5fec4d10be45e2be407a..8b38873c1495f2a343a40c2341c2d309ef859ead 100644 Binary files a/docs/build/doctrees/modules.doctree and b/docs/build/doctrees/modules.doctree differ diff --git a/docs/build/doctrees/plot_functions.doctree b/docs/build/doctrees/plot_functions.doctree index 8003f00e749609b458e28e350e09c435dbbee54f..2b585f215ddc9d9dc9bc3fdeddc881fc98721bc6 100644 Binary files a/docs/build/doctrees/plot_functions.doctree and b/docs/build/doctrees/plot_functions.doctree differ diff --git a/docs/build/doctrees/population_extensions/HPC.doctree b/docs/build/doctrees/population_extensions/HPC.doctree new file mode 100644 index 0000000000000000000000000000000000000000..7f3f4486e0792606e4bc8e8107849dbdf6c71aee Binary files /dev/null and b/docs/build/doctrees/population_extensions/HPC.doctree differ diff --git a/docs/build/doctrees/population_extensions/analytics.doctree b/docs/build/doctrees/population_extensions/analytics.doctree new file mode 100644 index 0000000000000000000000000000000000000000..b8486789a371ba40334e577a3a7291288d709ffd Binary files /dev/null and b/docs/build/doctrees/population_extensions/analytics.doctree differ diff --git a/docs/build/doctrees/population_extensions/cache.doctree b/docs/build/doctrees/population_extensions/cache.doctree new file mode 100644 index 0000000000000000000000000000000000000000..2a6cfe15a933be223dfce71f32db91091610bacc Binary files /dev/null and b/docs/build/doctrees/population_extensions/cache.doctree differ diff --git a/docs/build/doctrees/population_extensions/condor.doctree b/docs/build/doctrees/population_extensions/condor.doctree new file mode 100644 index 0000000000000000000000000000000000000000..505f42e7fb7b1e5809e47db68649487b346c1a8a Binary files /dev/null and b/docs/build/doctrees/population_extensions/condor.doctree differ diff --git a/docs/build/doctrees/population_extensions/dataIO.doctree b/docs/build/doctrees/population_extensions/dataIO.doctree new file mode 100644 index 0000000000000000000000000000000000000000..e097c33e06fd9c090ce43d048018f260640487e0 Binary files /dev/null and b/docs/build/doctrees/population_extensions/dataIO.doctree differ diff --git a/docs/build/doctrees/population_extensions/distribution_functions.doctree b/docs/build/doctrees/population_extensions/distribution_functions.doctree new file mode 100644 index 0000000000000000000000000000000000000000..96bca7a874a242ece5740c73063373ee23d1fbcc Binary files /dev/null and b/docs/build/doctrees/population_extensions/distribution_functions.doctree differ diff --git a/docs/build/doctrees/population_extensions/grid_options_defaults.doctree b/docs/build/doctrees/population_extensions/grid_options_defaults.doctree new file mode 100644 index 0000000000000000000000000000000000000000..799676cbfbb11a9fe13b9cd15bd7301b121745d7 Binary files /dev/null and b/docs/build/doctrees/population_extensions/grid_options_defaults.doctree differ diff --git a/docs/build/doctrees/population_extensions/gridcode.doctree b/docs/build/doctrees/population_extensions/gridcode.doctree new file mode 100644 index 0000000000000000000000000000000000000000..7b0fbd3f7fc9950c2fc53002bb3f305c9a5c5284 Binary files /dev/null and b/docs/build/doctrees/population_extensions/gridcode.doctree differ diff --git a/docs/build/doctrees/population_extensions/metadata.doctree b/docs/build/doctrees/population_extensions/metadata.doctree new file mode 100644 index 0000000000000000000000000000000000000000..3d870a43da2ac47ff0734f068fae807fe56fc597 Binary files /dev/null and b/docs/build/doctrees/population_extensions/metadata.doctree differ diff --git a/docs/build/doctrees/population_extensions/slurm.doctree b/docs/build/doctrees/population_extensions/slurm.doctree new file mode 100644 index 0000000000000000000000000000000000000000..5492e77e43dd767561fb22d4b37907c3b87fafca Binary files /dev/null and b/docs/build/doctrees/population_extensions/slurm.doctree differ diff --git a/docs/build/doctrees/population_extensions/spacing_functions.doctree b/docs/build/doctrees/population_extensions/spacing_functions.doctree new file mode 100644 index 0000000000000000000000000000000000000000..62f661214282ec7b3dff5a3def0650c7a1568e70 Binary files /dev/null and b/docs/build/doctrees/population_extensions/spacing_functions.doctree differ diff --git a/docs/build/doctrees/population_extensions/version_info.doctree b/docs/build/doctrees/population_extensions/version_info.doctree new file mode 100644 index 0000000000000000000000000000000000000000..3cf2968d205d94ec82e2527f09d86eee58cea2b9 Binary files /dev/null and b/docs/build/doctrees/population_extensions/version_info.doctree differ diff --git a/docs/build/doctrees/readme_link.doctree b/docs/build/doctrees/readme_link.doctree index e45e9ef09072cf3c1aba1f656eae8bc230de3dd9..3ad6e60171f701515c7485c1a7ce4e7a8b97d56f 100644 Binary files a/docs/build/doctrees/readme_link.doctree and b/docs/build/doctrees/readme_link.doctree differ diff --git a/docs/build/doctrees/run_system_wrapper.doctree b/docs/build/doctrees/run_system_wrapper.doctree index 01cb764f78bd605cd598a302b61227ad9204cd4d..2e8b97a5a6144d4ab616d7e1f2ab7376b36e6347 100644 Binary files a/docs/build/doctrees/run_system_wrapper.doctree and b/docs/build/doctrees/run_system_wrapper.doctree differ diff --git a/docs/build/doctrees/spacing_functions.doctree b/docs/build/doctrees/spacing_functions.doctree deleted file mode 100644 index d7e00f2c5cae7d5f753e23a6e248b9130911f6e4..0000000000000000000000000000000000000000 Binary files a/docs/build/doctrees/spacing_functions.doctree and /dev/null differ diff --git a/docs/build/doctrees/stellar_types.doctree b/docs/build/doctrees/stellar_types.doctree index 6a55f0ef4b6403ed5769de31b69987b1bb048a81..51dd8575d91a5dfb679d8ac93ef9f74888780ca4 100644 Binary files a/docs/build/doctrees/stellar_types.doctree and b/docs/build/doctrees/stellar_types.doctree differ diff --git a/docs/build/doctrees/useful_funcs.doctree b/docs/build/doctrees/useful_funcs.doctree index c0356d02164d9fb2ef4c03b53af58202144a0988..c3ee61ea0427b5b2e77b894409866d6f84e7c7cb 100644 Binary files a/docs/build/doctrees/useful_funcs.doctree and b/docs/build/doctrees/useful_funcs.doctree differ diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index 858b45b13c13972d71e57763c4614684be375ac4..9b0a6c759080f146c82f042d08f11512d9584925 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: a4f8e3a1f92628ed08655c4ea1d03fa6 +config: e979aa9eb24450dd330ad22ac37f144a tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_images/test_coverage.svg b/docs/build/html/_images/test_coverage.svg index bc3407c38eb421a1b578d6d7c04aed07dbd6ab83..4f8c1853c8aad23ace8aaa782014952e6375bcf3 100644 --- a/docs/build/html/_images/test_coverage.svg +++ b/docs/build/html/_images/test_coverage.svg @@ -9,13 +9,13 @@ </mask> <g mask="url(#a)"> <path fill="#555" d="M0 0h63v20H0z"/> - <path fill="#e05d44" d="M63 0h36v20H63z"/> + <path fill="#fe7d37" d="M63 0h36v20H63z"/> <path fill="url(#b)" d="M0 0h99v20H0z"/> </g> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> <text x="31.5" y="14">coverage</text> - <text x="80" y="15" fill="#010101" fill-opacity=".3">23%</text> - <text x="80" y="14">23%</text> + <text x="80" y="15" fill="#010101" fill-opacity=".3">50%</text> + <text x="80" y="14">50%</text> </g> </svg> diff --git a/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html b/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html index bf6cb61f8a39e6992498e996bd116fd7269a5e8f..70510fa0e9d923921c4b6fed48d177d6e3a636a0 100644 --- a/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.custom_logging_functions — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.custom_logging_functions</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.custom_logging_functions</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Module containing functions for the custom logging functionality.</span> @@ -620,48 +538,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/dicts.html b/docs/build/html/_modules/binarycpython/utils/dicts.html new file mode 100644 index 0000000000000000000000000000000000000000..59412ca68e03e8246c5c1e9ef474d0fd83e4fdde --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/dicts.html @@ -0,0 +1,925 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.dicts — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> + <script src="../../../_static/jquery.js"></script> + <script src="../../../_static/underscore.js"></script> + <script src="../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../genindex.html" /> + <link rel="search" title="Search" href="../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../index.html">Module code</a> »</li> + <li>binarycpython.utils.dicts</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.dicts</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing functions that binary_c-python uses to modify dictionaries.</span> +<span class="sd">"""</span> + +<span class="kn">import</span> <span class="nn">collections</span> + +<span class="kn">import</span> <span class="nn">astropy.units</span> <span class="k">as</span> <span class="nn">u</span> +<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> + +<div class="viewcode-block" id="keys_to_floats"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.keys_to_floats">[docs]</a><span class="k">def</span> <span class="nf">keys_to_floats</span><span class="p">(</span><span class="n">json_data</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to convert all the keys of the dictionary to float to float</span> + +<span class="sd"> we need to convert keys to floats:</span> +<span class="sd"> this is ~ a factor 10 faster than David's recursive_change_key_to_float routine, probably because this version only does the float conversion, nothing else.</span> +<span class="sd"> """</span> + + <span class="c1"># assumes nested dicts ...</span> + <span class="c1"># new_data = {}</span> + + <span class="c1"># but this copies the variable type, but has some</span> + <span class="c1"># pointless copying</span> + <span class="c1"># new_data = copy.copy(json_data)</span> + <span class="c1"># new_data.clear()</span> + + <span class="c1"># this adopts the type correctly *and* is fast</span> + <span class="n">new_data</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_data</span><span class="p">)()</span> + + <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">json_data</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> + <span class="c1"># convert key to a float, if we can</span> + <span class="c1"># otherwise leave as is</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">newkey</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> + <span class="n">newkey</span> <span class="o">=</span> <span class="n">k</span> + + <span class="c1"># act on value(s)</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> + <span class="c1"># list data</span> + <span class="n">new_data</span><span class="p">[</span><span class="n">newkey</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> + <span class="n">keys_to_floats</span><span class="p">(</span><span class="n">item</span><span class="p">)</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">abc</span><span class="o">.</span><span class="n">Mapping</span><span class="p">)</span> + <span class="k">else</span> <span class="n">item</span> + <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">v</span> + <span class="p">]</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">abc</span><span class="o">.</span><span class="n">Mapping</span><span class="p">):</span> + <span class="c1"># dict, ordereddict, etc. data</span> + <span class="n">new_data</span><span class="p">[</span><span class="n">newkey</span><span class="p">]</span> <span class="o">=</span> <span class="n">keys_to_floats</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># assume all other data are scalars</span> + <span class="n">new_data</span><span class="p">[</span><span class="n">newkey</span><span class="p">]</span> <span class="o">=</span> <span class="n">v</span> + + <span class="k">return</span> <span class="n">new_data</span></div> + + +<div class="viewcode-block" id="recursive_change_key_to_float"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.recursive_change_key_to_float">[docs]</a><span class="k">def</span> <span class="nf">recursive_change_key_to_float</span><span class="p">(</span><span class="n">input_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to recursively change the key to float</span> + +<span class="sd"> This only works if the dict contains just sub-dicts or numbers/strings.</span> +<span class="sd"> Does not work with lists as values</span> +<span class="sd"> """</span> + + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">()</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">input_dict</span><span class="p">:</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">)):</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">num_key</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">num_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">recursive_change_key_to_float</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">recursive_change_key_to_float</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">num_key</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">num_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="recursive_change_key_to_string"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.recursive_change_key_to_string">[docs]</a><span class="k">def</span> <span class="nf">recursive_change_key_to_string</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="n">custom_format</span><span class="o">=</span><span class="s2">"</span><span class="si">{:g}</span><span class="s2">"</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to recursively change the key back to a string but this time in a format that we decide</span> +<span class="sd"> """</span> + + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">()</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">input_dict</span><span class="p">:</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">)):</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">)):</span> + <span class="n">string_key</span> <span class="o">=</span> <span class="n">custom_format</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">string_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">recursive_change_key_to_string</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">recursive_change_key_to_string</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">)):</span> + <span class="n">string_key</span> <span class="o">=</span> <span class="n">custom_format</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">string_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<span class="k">def</span> <span class="nf">_nested_set</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span> <span class="n">keys</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Code to set a value of a nested dict based on a list of keys. We take into account the fact that the vallue in the dict might not be set at all by the setdefault call and the reverse looping of the keys</span> + +<span class="sd"> https://stackoverflow.com/questions/13687924/setting-a-value-in-a-nested-python-dictionary-given-a-list-of-indices-and-value</span> + +<span class="sd"> TODO: describe better</span> +<span class="sd"> """</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]:</span> + <span class="n">dic</span> <span class="o">=</span> <span class="n">dic</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="p">{})</span> + <span class="n">dic</span><span class="p">[</span><span class="n">keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">value</span> + + +<span class="k">def</span> <span class="nf">_nested_get</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span> <span class="n">keys</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Code to get a value of a nested dict based on a list of keys. We take into account the fact that the vallue in the dict might not be set at all by the setdefault call and the reverse looping of the keys</span> + +<span class="sd"> TODO: unused. Remove?</span> +<span class="sd"> """</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]:</span> + <span class="n">dic</span> <span class="o">=</span> <span class="n">dic</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="p">{})</span> + <span class="k">return</span> <span class="n">dic</span><span class="p">[</span><span class="n">keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> + + +<span class="k">def</span> <span class="nf">_recursive_normalize_floats</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">d</span><span class="p">,</span> <span class="n">const</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ignore</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> function to walk through the dictionary, multiplying only float values by a const</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">parent</span><span class="p">:</span> + <span class="n">parent</span> <span class="o">=</span> <span class="n">d</span> + + <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">d</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> + <span class="k">if</span> <span class="n">ignore</span> <span class="ow">and</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">ignore</span><span class="p">:</span> + <span class="k">continue</span> + + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">float</span><span class="p">):</span> + <span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> + <span class="c1"># must be a float, multiply by the constant</span> + <span class="n">_nested_set</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">v</span> <span class="o">*</span> <span class="n">const</span><span class="p">)</span> + <span class="n">path</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">)):</span> + <span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> + <span class="c1"># do nothing to strings or ints</span> + <span class="n">path</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> + <span class="k">elif</span> <span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> + <span class="n">path</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> + + <span class="c1"># dicts</span> + <span class="c1"># note: isinstance isn't enough, we need to check the Mapping</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">abc</span><span class="o">.</span><span class="n">Mapping</span><span class="p">):</span> + <span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> + <span class="c1"># nested dict</span> + <span class="n">_recursive_normalize_floats</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">const</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">)</span> + <span class="n">path</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"###Type </span><span class="si">{}</span><span class="s2"> not recognized: </span><span class="si">{}</span><span class="s2">.</span><span class="si">{}</span><span class="s2">=</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">),</span> <span class="s2">"."</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> + <span class="p">)</span> + <span class="p">)</span> + + +<div class="viewcode-block" id="multiply_float_values"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.multiply_float_values">[docs]</a><span class="k">def</span> <span class="nf">multiply_float_values</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">const</span><span class="p">,</span> <span class="n">ignore</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> multiply_float_values : A function to recursively multiply values of a (nested) dictionary that are floats by a constant. Nested dictionaries call this function recursively.</span> + +<span class="sd"> Args:</span> +<span class="sd"> d = the dictionary</span> +<span class="sd"> const = the constant that multiplies float values</span> +<span class="sd"> """</span> + <span class="n">path</span> <span class="o">=</span> <span class="p">[]</span> + <span class="n">_recursive_normalize_floats</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">d</span><span class="p">,</span> <span class="n">const</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="n">d</span><span class="p">,</span> <span class="n">ignore</span><span class="o">=</span><span class="n">ignore</span><span class="p">)</span></div> + + +<div class="viewcode-block" id="subtract_dicts"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.subtract_dicts">[docs]</a><span class="k">def</span> <span class="nf">subtract_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">dict_2</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to subtract two dictionaries.</span> + +<span class="sd"> Only allows values to be either a dict or a numerical type</span> + +<span class="sd"> For the overlapping keys (key name present in both dicts):</span> +<span class="sd"> When the keys are of the same type:</span> +<span class="sd"> - If the types are of numerical type: subtract the value at dict 2 from dict 1.</span> +<span class="sd"> - If the types are both dictionaries: call this function with the subdicts</span> + +<span class="sd"> When the keys are not of the same type:</span> +<span class="sd"> - if the keys are all of numerical types</span> + +<span class="sd"> For the unique keys:</span> +<span class="sd"> - if the key is from dict 1: adds the value to the new dict (be it numerical value or dict)</span> +<span class="sd"> - If the key is from dict 2: Adds the negative of its value in case of numerical type.</span> +<span class="sd"> if the type is a dict, the result of subtract_dicts({}, dict_2[key]) will be set</span> + +<span class="sd"> If the result is 0, the key will be removed from the resulting dict.</span> +<span class="sd"> If that results in an empty dict, the dict will be removed too.</span> + +<span class="sd"> Args:</span> +<span class="sd"> dict_1: first dictionary</span> +<span class="sd"> dict_2: second dictionary</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Subtracted dictionary</span> +<span class="sd"> """</span> + + <span class="c1"># Set up new dict</span> + <span class="n">new_dict</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># Define allowed numerical types</span> + <span class="n">ALLOWED_NUMERICAL_TYPES</span> <span class="o">=</span> <span class="p">(</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span> + + <span class="c1">#</span> + <span class="n">keys_1</span> <span class="o">=</span> <span class="n">dict_1</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">keys_2</span> <span class="o">=</span> <span class="n">dict_2</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1"># Find overlapping keys of both dicts</span> + <span class="n">overlapping_keys</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + + <span class="c1"># Find the keys that are unique</span> + <span class="n">unique_to_dict_1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + <span class="n">unique_to_dict_2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">))</span> + + <span class="c1"># Add the unique keys to the new dict</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_1</span><span class="p">:</span> + <span class="c1"># If these items are numerical types</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">ALLOWED_NUMERICAL_TYPES</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">if</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Error: using unsupported type for key </span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Add the unique keys to the new dict</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_2</span><span class="p">:</span> + <span class="c1"># If these items are numerical type, we should add the negative of the value</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">ALLOWED_NUMERICAL_TYPES</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">if</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Else we should place the negative of that dictionary in the new place</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">subtract_dicts</span><span class="p">({},</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Error: using unsupported type for key </span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Go over the common keys:</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">overlapping_keys</span><span class="p">:</span> + + <span class="c1"># See whether the types are actually the same</span> + <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]):</span> + <span class="c1"># Exceptions:</span> + <span class="k">if</span> <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">in</span> <span class="n">ALLOWED_NUMERICAL_TYPES</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span> + <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">in</span> <span class="n">ALLOWED_NUMERICAL_TYPES</span> + <span class="p">):</span> + <span class="c1"># We can safely subtract the values since they are all numeric</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">-</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">if</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Error key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value1}</span><span class="s2"> type: </span><span class="si">{type}</span><span class="s2"> and key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value2}</span><span class="s2"> type: </span><span class="si">{type2}</span><span class="s2"> are not of the same type and cannot be merged"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">,</span> + <span class="n">value1</span><span class="o">=</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="nb">type</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="n">value2</span><span class="o">=</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="n">type2</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># This is where the keys are the same</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># If these items are numeric types</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">ALLOWED_NUMERICAL_TYPES</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">-</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Remove entry if the value is 0</span> + <span class="k">if</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">subtract_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + + <span class="c1"># Remove entry if it results in an empty dict</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Error: using unsupported type for key </span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1">#</span> + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="AutoVivificationDict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.AutoVivificationDict">[docs]</a><span class="k">class</span> <span class="nc">AutoVivificationDict</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Implementation of perl's autovivification feature, by overriding the</span> +<span class="sd"> get item and the __iadd__ operator (https://docs.python.org/3/reference/datamodel.html?highlight=iadd#object.__iadd__)</span> + +<span class="sd"> This allows to set values within a subdict that might not exist yet:</span> + +<span class="sd"> Example:</span> +<span class="sd"> newdict = {}</span> +<span class="sd"> newdict['example']['mass'] += 10</span> +<span class="sd"> print(newdict)</span> +<span class="sd"> >>> {'example': {'mass': 10}}</span> +<span class="sd"> """</span> + +<div class="viewcode-block" id="AutoVivificationDict.__getitem__"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.AutoVivificationDict.__getitem__">[docs]</a> <span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Getitem function for the autovivication dict</span> +<span class="sd"> """</span> + + <span class="k">try</span><span class="p">:</span> + <span class="k">return</span> <span class="nb">dict</span><span class="o">.</span><span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="p">[</span><span class="n">item</span><span class="p">]</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)()</span> + <span class="k">return</span> <span class="n">value</span></div> + +<div class="viewcode-block" id="AutoVivificationDict.__iadd__"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.AutoVivificationDict.__iadd__">[docs]</a> <span class="k">def</span> <span class="fm">__iadd__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> iadd function (handling the +=) for the autovivication dict.</span> +<span class="sd"> """</span> + + <span class="c1"># if a value does not exist, assume it is 0.0</span> + <span class="k">try</span><span class="p">:</span> + <span class="bp">self</span> <span class="o">+=</span> <span class="n">other</span> + <span class="k">except</span><span class="p">:</span> + <span class="bp">self</span> <span class="o">=</span> <span class="n">other</span> + <span class="k">return</span> <span class="bp">self</span></div></div> + + +<div class="viewcode-block" id="inspect_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.inspect_dict">[docs]</a><span class="k">def</span> <span class="nf">inspect_dict</span><span class="p">(</span> + <span class="n">input_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">indent</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">print_structure</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> +<span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to (recursively) inspect a (nested) dictionary.</span> +<span class="sd"> The object that is returned is a dictionary containing the key of the input_dict, but as value</span> +<span class="sd"> it will return the type of what the value would be in the input_dict</span> + +<span class="sd"> In this way we inspect the structure of these dictionaries, rather than the exact contents.</span> + +<span class="sd"> Args:</span> +<span class="sd"> input_dict: dictionary you want to inspect</span> +<span class="sd"> print_structure: (optional, default = True)</span> +<span class="sd"> indent: (optional, default = 0) indent of the first output</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Dictionary that has the same structure as the input_dict, but as values it has the</span> +<span class="sd"> type(input_dict[key]) (except if the value is a dict)</span> +<span class="sd"> """</span> + + <span class="n">structure_dict</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">()</span> + + <span class="c1">#</span> + <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">input_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> + <span class="n">structure_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">print_structure</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\t</span><span class="s2">"</span> <span class="o">*</span> <span class="n">indent</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">))</span> + + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">structure_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">inspect_dict</span><span class="p">(</span> + <span class="n">value</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="n">indent</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">print_structure</span><span class="o">=</span><span class="n">print_structure</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="n">structure_dict</span></div> + + +<div class="viewcode-block" id="count_keys_recursive"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.count_keys_recursive">[docs]</a><span class="k">def</span> <span class="nf">count_keys_recursive</span><span class="p">(</span><span class="n">input_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to count the total number of keys in a dictionary</span> +<span class="sd"> """</span> + + <span class="n">local_count</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">input_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="n">local_count</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">)):</span> + <span class="n">local_count</span> <span class="o">+=</span> <span class="n">count_keys_recursive</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">return</span> <span class="n">local_count</span></div> + + +<div class="viewcode-block" id="merge_dicts"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.merge_dicts">[docs]</a><span class="k">def</span> <span class="nf">merge_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">dict_2</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to merge two dictionaries in a custom way.</span> + +<span class="sd"> Behaviour:</span> + +<span class="sd"> When dict keys are only present in one of either:</span> +<span class="sd"> - we just add the content to the new dict</span> + +<span class="sd"> When dict keys are present in both, we decide based on the value types how to combine them:</span> +<span class="sd"> - dictionaries will be merged by calling recursively calling this function again</span> +<span class="sd"> - numbers will be added</span> +<span class="sd"> - (opt) lists will be appended</span> +<span class="sd"> - booleans are merged with logical OR</span> +<span class="sd"> - identical strings are just set to the string</span> +<span class="sd"> - non-identical strings are concatenated</span> +<span class="sd"> - NoneTypes are set to None</span> +<span class="sd"> - In the case that the instances do not match: for now I will raise an error</span> + +<span class="sd"> Args:</span> +<span class="sd"> dict_1: first dictionary</span> +<span class="sd"> dict_2: second dictionary</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Merged dictionary</span> + +<span class="sd"> """</span> + + <span class="c1"># Set up new dict</span> + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">()</span> + + <span class="c1">#</span> + <span class="n">keys_1</span> <span class="o">=</span> <span class="n">dict_1</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">keys_2</span> <span class="o">=</span> <span class="n">dict_2</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1"># Find overlapping keys of both dicts</span> + <span class="n">overlapping_keys</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + + <span class="c1"># Find the keys that are unique</span> + <span class="n">unique_to_dict_1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + <span class="n">unique_to_dict_2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">))</span> + + <span class="c1"># Add the unique keys to the new dict</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_1</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_2</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Go over the common keys:</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">overlapping_keys</span><span class="p">:</span> + + <span class="c1"># If they keys are not the same, it depends on their type whether we still deal with them at all, or just raise an error</span> + <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]):</span> + <span class="c1"># Exceptions: numbers can be added</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">))</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span> + <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span> + <span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Exceptions: versions of dicts can be merged</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span> + <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">AutoVivificationDict</span><span class="p">))</span> + <span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span> + <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">AutoVivificationDict</span><span class="p">))</span> + <span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">merge_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + + <span class="c1"># string-int clash : convert both to ints and save</span> + <span class="k">elif</span> <span class="p">(</span> + <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">)</span> + <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">int</span><span class="p">)</span> + <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">int</span><span class="p">)</span> + <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">)</span> + <span class="p">):</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">: Failed to convert string (either '</span><span class="si">{}</span><span class="s2">' or '</span><span class="si">{}</span><span class="s2">') to an int"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span> + + <span class="c1"># string-float clash : convert both to floats and save</span> + <span class="k">elif</span> <span class="p">(</span> + <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">)</span> + <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">float</span><span class="p">)</span> + <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">float</span><span class="p">)</span> + <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">)</span> + <span class="p">):</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="o">+</span> <span class="nb">float</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">: Failed to convert string (either '</span><span class="si">{}</span><span class="s2">' or '</span><span class="si">{}</span><span class="s2">') to an float"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span> + + <span class="c1"># If the above cases have not dealt with it, then we should raise an error</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"merge_dicts error: key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value1}</span><span class="s2"> type: </span><span class="si">{type1}</span><span class="s2"> and key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value2}</span><span class="s2"> type: </span><span class="si">{type2}</span><span class="s2"> are not of the same type and cannot be merged"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">,</span> + <span class="n">value1</span><span class="o">=</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="n">type1</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="n">value2</span><span class="o">=</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="n">type2</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Here the keys are the same type</span> + <span class="c1"># Here we check for the cases that we want to explicitly catch. Ints will be added,</span> + <span class="c1"># floats will be added, lists will be appended (though that might change) and dicts will be</span> + <span class="c1"># dealt with by calling this function again.</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># ints</span> + <span class="c1"># Booleans (has to be the type Bool, not just a 0 or 1)</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">bool</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">bool</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="ow">or</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">int</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">int</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># floats</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">float</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">float</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># lists</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">list</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Astropy quantities (using a dummy type representing the numpy array)</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="p">])</span> <span class="o">*</span> <span class="n">u</span><span class="o">.</span><span class="n">m</span><span class="p">))</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span> + <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="p">])</span> <span class="o">*</span> <span class="n">u</span><span class="o">.</span><span class="n">m</span><span class="p">)</span> + <span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># dicts</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">merge_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + + <span class="c1"># strings</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">str</span><span class="p">):</span> + <span class="k">if</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">==</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]:</span> + <span class="c1"># same strings</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># different strings: just concatenate them</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># None types</span> + <span class="k">elif</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Object types </span><span class="si">{}</span><span class="s2">: </span><span class="si">{}</span><span class="s2"> (</span><span class="si">{}</span><span class="s2">), </span><span class="si">{}</span><span class="s2"> (</span><span class="si">{}</span><span class="s2">) not supported."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="p">,</span> + <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1">#</span> + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="update_dicts"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.update_dicts">[docs]</a><span class="k">def</span> <span class="nf">update_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">dict_2</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to update dict_1 with values of dict_2 in a recursive way.</span> + +<span class="sd"> Behaviour:</span> + +<span class="sd"> When dict keys are only present in one of either:</span> +<span class="sd"> - we just add the content to the new dict</span> + +<span class="sd"> When dict keys are present in both, we decide based on the value types how to combine them:</span> +<span class="sd"> - value of dict2 will be taken</span> + +<span class="sd"> Args:</span> +<span class="sd"> dict_1: first dictionary</span> +<span class="sd"> dict_2: second dictionary</span> + +<span class="sd"> Returns:</span> +<span class="sd"> New dictionary with Updated values</span> + +<span class="sd"> """</span> + + <span class="c1"># Set up new dict of the same type as dict_1</span> + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">dict_1</span><span class="o">.</span><span class="vm">__class__</span><span class="p">()</span> + + <span class="c1"># Get keys</span> + <span class="n">keys_1</span> <span class="o">=</span> <span class="n">dict_1</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">keys_2</span> <span class="o">=</span> <span class="n">dict_2</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1"># Find overlapping keys of both dicts</span> + <span class="n">overlapping_keys</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + + <span class="c1"># Find the keys that are unique</span> + <span class="n">unique_to_dict_1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">))</span> + <span class="n">unique_to_dict_2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">keys_2</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">keys_1</span><span class="p">))</span> + + <span class="c1"># Add the unique keys to the new dict</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_1</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">unique_to_dict_2</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># Go over the common keys:</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">overlapping_keys</span><span class="p">:</span> + + <span class="c1"># See whether the types are actually the same</span> + <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]):</span> + <span class="c1"># Exceptions:</span> + <span class="k">if</span> <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">in</span> <span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="ow">and</span> <span class="p">(</span> + <span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="ow">in</span> <span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> + <span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Error key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value1}</span><span class="s2"> type: </span><span class="si">{type1}</span><span class="s2"> and key: </span><span class="si">{key}</span><span class="s2"> value: </span><span class="si">{value2}</span><span class="s2"> type: </span><span class="si">{type2}</span><span class="s2"> are not of the same type and cannot be merged"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">,</span> + <span class="n">value1</span><span class="o">=</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="n">type1</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="n">value2</span><span class="o">=</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> + <span class="n">type2</span><span class="o">=</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]),</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span> + + <span class="c1"># Here we check for the cases that we want to explicitly catch. Ints will be added,</span> + <span class="c1"># floats will be added, lists will be appended (though that might change) and dicts will be</span> + <span class="c1"># dealt with by calling this function again.</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># dicts</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">update_dicts</span><span class="p">(</span><span class="n">dict_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">dict_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="c1">#</span> + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="multiply_values_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.multiply_values_dict">[docs]</a><span class="k">def</span> <span class="nf">multiply_values_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="n">factor</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that goes over dictionary recursively and multiplies the value if possible by a factor</span> + +<span class="sd"> If the key equals "general_info", the multiplication gets skipped</span> +<span class="sd"> """</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">input_dict</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">key</span> <span class="o">==</span> <span class="s2">"general_info"</span><span class="p">:</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">)):</span> + <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">multiply_values_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">factor</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">)):</span> + <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">*</span> <span class="n">factor</span> + + <span class="k">return</span> <span class="n">input_dict</span></div> + + +<div class="viewcode-block" id="custom_sort_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.custom_sort_dict">[docs]</a><span class="k">def</span> <span class="nf">custom_sort_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Returns a dictionary that is ordered, but can handle numbers better than normal OrderedDict</span> + +<span class="sd"> When the keys of the current dictionary are of mixed type, we first find all the unique types.</span> +<span class="sd"> Sort that list of type names. Then find the values that fit that type.</span> +<span class="sd"> Sort those and append them to the sorted keys list.</span> +<span class="sd"> This is done until all the keys are sorted.</span> + +<span class="sd"> All objects other than dictionary types are directly return as they are</span> +<span class="sd"> """</span> + + <span class="c1"># If the new input is a dictionary, then try to sort it</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="p">(</span><span class="nb">dict</span><span class="p">,</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">)):</span> + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">OrderedDict</span><span class="p">()</span> + + <span class="n">keys</span> <span class="o">=</span> <span class="n">input_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1"># Check if types are the same</span> + <span class="n">all_types_keys</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> <span class="ow">in</span> <span class="n">all_types_keys</span><span class="p">:</span> + <span class="n">all_types_keys</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">key</span><span class="p">))</span> + + <span class="c1"># If there are multiple types, then we loop over them and do a piece wise sort</span> + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">all_types_keys</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Different types in the same dictionary key set"</span> + <span class="nb">print</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Create a string repr of the type name to sort them afterwards</span> + <span class="n">str_types</span> <span class="o">=</span> <span class="p">{</span><span class="nb">repr</span><span class="p">(</span><span class="n">el</span><span class="p">):</span> <span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">all_types_keys</span><span class="p">}</span> + + <span class="c1"># Set up sorted keys list</span> + <span class="n">sorted_keys</span> <span class="o">=</span> <span class="p">[]</span> + + <span class="k">for</span> <span class="n">key_str_type</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">str_types</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span> + <span class="n">cur_type</span> <span class="o">=</span> <span class="n">str_types</span><span class="p">[</span><span class="n">key_str_type</span><span class="p">]</span> + + <span class="n">cur_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">cur_type</span><span class="p">)]</span> + <span class="n">cur_sorted_list</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">cur_list</span><span class="p">)</span> + + <span class="n">sorted_keys</span> <span class="o">=</span> <span class="n">sorted_keys</span> <span class="o">+</span> <span class="n">cur_sorted_list</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">sorted_keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">sorted_keys</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">custom_sort_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> + + <span class="k">return</span> <span class="n">new_dict</span> + + <span class="k">return</span> <span class="n">input_dict</span></div> + + +<div class="viewcode-block" id="filter_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.filter_dict">[docs]</a><span class="k">def</span> <span class="nf">filter_dict</span><span class="p">(</span><span class="n">arg_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">filter_list</span><span class="p">:</span> <span class="nb">list</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to filter out keys that are contains in filter_list</span> + +<span class="sd"> Args:</span> +<span class="sd"> arg_dict: dictionary containing the argument + default key pairs of binary_c</span> +<span class="sd"> filter_list: lists of keys to be filtered out</span> +<span class="sd"> Returns:</span> +<span class="sd"> filtered dictionary</span> +<span class="sd"> """</span> + + <span class="n">new_dict</span> <span class="o">=</span> <span class="n">arg_dict</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">filter_list</span><span class="p">:</span> + <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">new_dict</span><span class="p">:</span> + <span class="k">del</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="filter_dict_through_values"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.filter_dict_through_values">[docs]</a><span class="k">def</span> <span class="nf">filter_dict_through_values</span><span class="p">(</span><span class="n">arg_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">filter_list</span><span class="p">:</span> <span class="nb">list</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to filter out keys that contain values included in filter_list</span> + +<span class="sd"> Args:</span> +<span class="sd"> arg_dict: dictionary containing the argument + default key pairs of binary_c</span> +<span class="sd"> filter_list: lists of values to be filtered out</span> +<span class="sd"> Returns:</span> +<span class="sd"> filtered dictionary</span> +<span class="sd"> """</span> + + <span class="n">new_dict</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">arg_dict</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">arg_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="ow">in</span> <span class="n">filter_list</span><span class="p">:</span> + <span class="n">new_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">arg_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">new_dict</span></div> + + +<div class="viewcode-block" id="prepare_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.prepare_dict">[docs]</a><span class="k">def</span> <span class="nf">prepare_dict</span><span class="p">(</span><span class="n">global_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">list_of_sub_keys</span><span class="p">:</span> <span class="nb">list</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that makes sure that the global dict is prepared to have a value set there.</span> +<span class="sd"> This dictionary will store values and factors for the distribution functions,</span> +<span class="sd"> so that they don't have to be calculated each time.</span> + +<span class="sd"> Args:</span> +<span class="sd"> global_dict: globally accessible dictionary where factors are stored in</span> +<span class="sd"> list_of_sub_keys: List of keys that must become be(come) present in the global_dict</span> +<span class="sd"> """</span> + + <span class="n">internal_dict_value</span> <span class="o">=</span> <span class="n">global_dict</span> + + <span class="c1"># This loop almost mimics a recursive loop into the dictionary.</span> + <span class="c1"># It checks whether the first key of the list is present, if not; set it with an empty dict.</span> + <span class="c1"># Then it overrides itself to be that (new) item, and goes on to do that again, until the list</span> + <span class="c1"># exhausted</span> + <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">list_of_sub_keys</span><span class="p">:</span> + <span class="c1"># If the sub key doesnt exist then make an empty dict</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">internal_dict_value</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">internal_dict_value</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">internal_dict_value</span> <span class="o">=</span> <span class="n">internal_dict_value</span><span class="p">[</span><span class="n">k</span><span class="p">]</span></div> + + +<div class="viewcode-block" id="set_opts"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.set_opts">[docs]</a><span class="k">def</span> <span class="nf">set_opts</span><span class="p">(</span><span class="n">opts</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">newopts</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to take a default dict and override it with newer values.</span> + +<span class="sd"> # TODO: consider changing this to just a dict.update</span> + +<span class="sd"> Args:</span> +<span class="sd"> opts: dictionary with default values</span> +<span class="sd"> newopts: dictionary with new values</span> + +<span class="sd"> Returns:</span> +<span class="sd"> returns an updated dictionary</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">newopts</span><span class="p">:</span> + <span class="k">for</span> <span class="n">opt</span> <span class="ow">in</span> <span class="n">newopts</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="k">if</span> <span class="n">opt</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="n">opts</span><span class="p">[</span><span class="n">opt</span><span class="p">]</span> <span class="o">=</span> <span class="n">newopts</span><span class="p">[</span><span class="n">opt</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">opts</span></div> + + +<div class="viewcode-block" id="normalize_dict"><a class="viewcode-back" href="../../../dicts.html#binarycpython.utils.dicts.normalize_dict">[docs]</a><span class="k">def</span> <span class="nf">normalize_dict</span><span class="p">(</span><span class="n">result_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to normalise a dictionary</span> +<span class="sd"> """</span> + + <span class="n">sum_result</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">result_dict</span><span class="o">.</span><span class="n">values</span><span class="p">()))</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">result_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="n">result_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">result_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">/</span> <span class="n">sum_result</span> + + <span class="k">return</span> <span class="n">result_dict</span></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/ensemble.html b/docs/build/html/_modules/binarycpython/utils/ensemble.html new file mode 100644 index 0000000000000000000000000000000000000000..c6dd375c2b17c0586d108a77cb793d1dcac66cbe --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/ensemble.html @@ -0,0 +1,488 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.ensemble — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> + <script src="../../../_static/jquery.js"></script> + <script src="../../../_static/underscore.js"></script> + <script src="../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../genindex.html" /> + <link rel="search" title="Search" href="../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../index.html">Module code</a> »</li> + <li>binarycpython.utils.ensemble</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.ensemble</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing functions to interact with binary_c's</span> +<span class="sd">population ensemble using the binarycpython package</span> + +<span class="sd">"""</span> + +<span class="kn">import</span> <span class="nn">sys</span> +<span class="kn">import</span> <span class="nn">bz2</span> +<span class="kn">import</span> <span class="nn">time</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span> +<span class="kn">import</span> <span class="nn">gc</span> +<span class="kn">import</span> <span class="nn">gzip</span> +<span class="kn">import</span> <span class="nn">inspect</span> + +<span class="kn">from</span> <span class="nn">halo</span> <span class="kn">import</span> <span class="n">Halo</span> +<span class="kn">import</span> <span class="nn">msgpack</span> +<span class="kn">import</span> <span class="nn">py_rinterpolate</span> + +<span class="kn">import</span> <span class="nn">simplejson</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.dicts</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">keys_to_floats</span><span class="p">,</span> + <span class="n">recursive_change_key_to_float</span><span class="p">,</span> + <span class="n">custom_sort_dict</span><span class="p">,</span> + <span class="n">recursive_change_key_to_string</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="n">verbose_print</span> + + +<div class="viewcode-block" id="ensemble_setting"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.ensemble_setting">[docs]</a><span class="k">def</span> <span class="nf">ensemble_setting</span><span class="p">(</span><span class="n">ensemble</span><span class="p">,</span> <span class="n">parameter_name</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to get the setting of parameter_name in the given ensemble, or return the default value.</span> +<span class="sd"> """</span> + <span class="n">value</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">try</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="n">ensemble</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">][</span><span class="s2">"population_settings"</span><span class="p">][</span><span class="s2">"bse_options"</span><span class="p">][</span> + <span class="n">parameter_name</span> + <span class="p">]</span> + <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="n">ensemble</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">][</span><span class="s2">"population_settings"</span><span class="p">][</span> + <span class="s2">"grid_options"</span> + <span class="p">][</span><span class="n">parameter_name</span><span class="p">]</span> + <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="n">ensemble</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">][</span><span class="s2">"population_settings"</span><span class="p">][</span> + <span class="s2">"custom_options"</span> + <span class="p">][</span><span class="n">parameter_name</span><span class="p">]</span> + <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># not found, try the default</span> + <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="n">ensemble</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">][</span><span class="s2">"binary_c_defaults"</span><span class="p">][</span> + <span class="n">parameter_name</span> + <span class="p">]</span> + <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> + <span class="n">value</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">return</span> <span class="n">value</span></div> + + +<div class="viewcode-block" id="open_ensemble"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.open_ensemble">[docs]</a><span class="k">def</span> <span class="nf">open_ensemble</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to open an ensemble at filename for reading and decompression if required.</span> +<span class="sd"> """</span> + + <span class="n">compression</span> <span class="o">=</span> <span class="n">ensemble_compression</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + <span class="k">if</span> <span class="n">ensemble_file_type</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="o">==</span> <span class="s2">"msgpack"</span><span class="p">:</span> + <span class="n">flags</span> <span class="o">=</span> <span class="s2">"rb"</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">flags</span> <span class="o">=</span> <span class="s2">"rt"</span> + <span class="k">if</span> <span class="n">compression</span> <span class="o">==</span> <span class="s2">"bzip2"</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="n">bz2</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">)</span> + <span class="k">elif</span> <span class="n">compression</span> <span class="o">==</span> <span class="s2">"gzip"</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="n">gzip</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">)</span> + <span class="k">return</span> <span class="n">file_object</span></div> + + +<div class="viewcode-block" id="ensemble_compression"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.ensemble_compression">[docs]</a><span class="k">def</span> <span class="nf">ensemble_compression</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return the compression type of the ensemble file, based on its filename extension.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">filename</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">".bz2"</span><span class="p">):</span> + <span class="k">return</span> <span class="s2">"bzip2"</span> + <span class="k">if</span> <span class="n">filename</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">".gz"</span><span class="p">):</span> + <span class="k">return</span> <span class="s2">"gzip"</span> + <span class="k">return</span> <span class="kc">None</span></div> + + +<div class="viewcode-block" id="ensemble_file_type"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.ensemble_file_type">[docs]</a><span class="k">def</span> <span class="nf">ensemble_file_type</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Returns the file type of an ensemble file.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="s2">".json"</span> <span class="ow">in</span> <span class="n">filename</span><span class="p">:</span> + <span class="n">filetype</span> <span class="o">=</span> <span class="s2">"JSON"</span> + <span class="k">elif</span> <span class="s2">".msgpack"</span> <span class="ow">in</span> <span class="n">filename</span><span class="p">:</span> + <span class="n">filetype</span> <span class="o">=</span> <span class="s2">"msgpack"</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">filetype</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">filetype</span></div> + + +<div class="viewcode-block" id="load_ensemble"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.load_ensemble">[docs]</a><span class="k">def</span> <span class="nf">load_ensemble</span><span class="p">(</span> + <span class="n">filename</span><span class="p">,</span> <span class="n">convert_float_keys</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">select_keys</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">timing</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">flush</span><span class="o">=</span><span class="kc">False</span> +<span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to load an ensemeble file, even if it is compressed,</span> +<span class="sd"> and return its contents to as a Python dictionary.</span> + +<span class="sd"> Args:</span> +<span class="sd"> convert_float_keys : if True, converts strings to floats.</span> +<span class="sd"> select_keys : a list of keys to be selected from the ensemble.</span> +<span class="sd"> """</span> + + <span class="c1"># open the file</span> + + <span class="c1"># load with some info to the terminal</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Loading JSON..."</span><span class="p">,</span> <span class="n">flush</span><span class="o">=</span><span class="n">flush</span><span class="p">)</span> + + <span class="c1"># open the ensemble and get the file type</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="n">open_ensemble</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + <span class="n">filetype</span> <span class="o">=</span> <span class="n">ensemble_file_type</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">filetype</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">file_object</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Unknown filetype : your ensemble should be saved either as JSON or msgpack data."</span><span class="p">,</span> + <span class="n">flush</span><span class="o">=</span><span class="n">flush</span><span class="p">,</span> + <span class="p">)</span> + <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span> + + <span class="k">with</span> <span class="n">Halo</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s2">"Loading"</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mi">250</span><span class="p">,</span> <span class="n">spinner</span><span class="o">=</span><span class="s2">"moon"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"yellow"</span><span class="p">):</span> + <span class="n">tstart</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> + <span class="n">_loaded</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="k">def</span> <span class="nf">_hook</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Hook to load ensemble</span> +<span class="sd"> """</span> + + <span class="k">nonlocal</span> <span class="n">_loaded</span> + <span class="k">if</span> <span class="n">_loaded</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span> + <span class="n">_loaded</span> <span class="o">=</span> <span class="kc">True</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">Loaded </span><span class="si">{}</span><span class="s2"> data, now putting in a dictionary"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">filetype</span><span class="p">),</span> + <span class="n">flush</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">return</span> <span class="n">obj</span> + + <span class="k">if</span> <span class="n">filetype</span> <span class="o">==</span> <span class="s2">"JSON"</span><span class="p">:</span> + <span class="c1"># orjson promises to be fast, but it doesn't seem to be</span> + <span class="c1"># and fails on "Infinity"... oops</span> + <span class="c1"># data = orjson.loads(file_object.read())</span> + + <span class="c1"># simplejson is faster than standard json and "just works"</span> + <span class="c1"># on the big Moe set in 37s</span> + <span class="n">data</span> <span class="o">=</span> <span class="n">simplejson</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">file_object</span><span class="p">,</span> <span class="n">object_hook</span><span class="o">=</span><span class="n">_hook</span><span class="p">)</span> + + <span class="c1"># standard json module</span> + <span class="c1"># on the big Moe set takes 42s</span> + <span class="c1"># data = json.load(file_object,</span> + <span class="c1"># object_hook=_hook)</span> + <span class="k">elif</span> <span class="n">filetype</span> <span class="o">==</span> <span class="s2">"msgpack"</span><span class="p">:</span> + <span class="n">data</span> <span class="o">=</span> <span class="n">msgpack</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">file_object</span><span class="p">,</span> <span class="n">object_hook</span><span class="o">=</span><span class="n">_hook</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">timing</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n\n</span><span class="s2">Took </span><span class="si">{}</span><span class="s2"> s to load the data</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">tstart</span><span class="p">),</span> + <span class="n">flush</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># strip non-selected keys, if a list is given in select_keys</span> + <span class="k">if</span> <span class="n">select_keys</span><span class="p">:</span> + <span class="n">keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">select_keys</span><span class="p">:</span> + <span class="k">del</span> <span class="n">data</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">][</span><span class="n">key</span><span class="p">]</span> + + <span class="c1"># perhaps convert floats?</span> + <span class="n">tstart</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> + <span class="k">if</span> <span class="n">convert_float_keys</span><span class="p">:</span> + <span class="c1"># timings are for 100 iterations on the big Moe data set</span> + <span class="c1"># data = format_ensemble_results(data) # 213s</span> + <span class="c1"># data = recursive_change_key_to_float(data) # 61s</span> + <span class="n">data</span> <span class="o">=</span> <span class="n">keys_to_floats</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="c1"># 6.94s</span> + + <span class="k">if</span> <span class="n">timing</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n\n</span><span class="s2">Took </span><span class="si">{}</span><span class="s2"> s to convert floats</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">tstart</span><span class="p">),</span> + <span class="n">flush</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># return data</span> + <span class="k">return</span> <span class="n">data</span></div> + + +<span class="c1">#####</span> +<div class="viewcode-block" id="extract_ensemble_json_from_string"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.extract_ensemble_json_from_string">[docs]</a><span class="k">def</span> <span class="nf">extract_ensemble_json_from_string</span><span class="p">(</span><span class="n">binary_c_output</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to extract the ensemble_json information from a raw binary_c output string</span> + +<span class="sd"> Args:</span> +<span class="sd"> binary_c_output: raw binary_c output string</span> + +<span class="sd"> Returns:</span> +<span class="sd"> JSON dictionary with the parsed ENSEMBLE_JSON data</span> +<span class="sd"> """</span> + + <span class="n">json_dict</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">try</span><span class="p">:</span> + <span class="c1"># If there is no output just return an empty dict:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">binary_c_output</span><span class="p">:</span> + <span class="n">json_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">return</span> <span class="n">json_dict</span> + + <span class="n">ensemble_jsons_strings</span> <span class="o">=</span> <span class="p">[</span> + <span class="n">line</span> + <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">binary_c_output</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span> + <span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"ENSEMBLE_JSON"</span><span class="p">)</span> + <span class="p">]</span> + + <span class="n">json_dict</span> <span class="o">=</span> <span class="n">handle_ensemble_string_to_json</span><span class="p">(</span> + <span class="n">ensemble_jsons_strings</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nb">len</span><span class="p">(</span><span class="s2">"ENSEMBLE_JSON "</span><span class="p">)</span> <span class="p">:]</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">ensemble_jsons_strings</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Warning: There is more than one line starting with ENSEMBLE_JSON. Taking the first, but you should check this out."</span><span class="p">,</span> + <span class="mi">1</span><span class="p">,</span> + <span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Error: Couldn't extract the ensemble information from the output string"</span><span class="p">,</span> + <span class="mi">0</span><span class="p">,</span> + <span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="n">json_dict</span></div> + + +<div class="viewcode-block" id="handle_ensemble_string_to_json"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.handle_ensemble_string_to_json">[docs]</a><span class="k">def</span> <span class="nf">handle_ensemble_string_to_json</span><span class="p">(</span><span class="n">raw_output</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that deals with the raw output of the ensemble and</span> +<span class="sd"> creates a working JSON dictionary out of it.</span> + +<span class="sd"> Having this wrapper makes it easy to</span> + +<span class="sd"> Args:</span> +<span class="sd"> raw_output: raw output of the ensemble dump by binary_c</span> + +<span class="sd"> Returns:</span> +<span class="sd"> json.loads(raw_output, cls=binarycDecoder)</span> + +<span class="sd"> """</span> + <span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">raw_output</span><span class="p">,</span> <span class="bp">cls</span><span class="o">=</span><span class="n">binarycDecoder</span><span class="p">)</span></div> + + +<div class="viewcode-block" id="binaryc_json_serializer"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.binaryc_json_serializer">[docs]</a><span class="k">def</span> <span class="nf">binaryc_json_serializer</span><span class="p">(</span><span class="n">obj</span><span class="p">:</span> <span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Any</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Custom serialiser for binary_c to use when functions are present in the dictionary</span> +<span class="sd"> that we want to export.</span> + +<span class="sd"> Function objects will be turned into str representations of themselves</span> + +<span class="sd"> Args:</span> +<span class="sd"> obj: The object that might not be serialisable</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Either string representation of object if the object is a function, or the object itself</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">inspect</span><span class="o">.</span><span class="n">isfunction</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">):</span> + <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> + <span class="k">return</span> <span class="n">obj</span></div> + + +<div class="viewcode-block" id="binarycDecoder"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.binarycDecoder">[docs]</a><span class="k">class</span> <span class="nc">binarycDecoder</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">JSONDecoder</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Custom decoder to transform the numbers that are strings to actual floats</span> +<span class="sd"> """</span> + +<div class="viewcode-block" id="binarycDecoder.decode"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.binarycDecoder.decode">[docs]</a> <span class="k">def</span> <span class="nf">decode</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">s</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Entry point function for decoding</span> +<span class="sd"> """</span> + + <span class="n">result</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span> + <span class="n">s</span> + <span class="p">)</span> <span class="c1"># result = super(Decoder, self).decode(s) for Python 2.x</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_decode</span><span class="p">(</span><span class="n">result</span><span class="p">)</span></div> + + <span class="k">def</span> <span class="nf">_decode</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">o</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Depending on the type of object is will determine whether to loop over the elements,</span> +<span class="sd"> or try to change the type of the object from string to float</span> + +<span class="sd"> The try except might be a somewhat rough solution but it catches all cases.</span> +<span class="sd"> """</span> + + <span class="c1"># Check if we can turn it into a float</span> + <span class="c1"># if isinstance(o, str) or isinstance(o, unicode):</span> + <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> + <span class="k">try</span><span class="p">:</span> + <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> + <span class="k">return</span> <span class="n">o</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> + <span class="k">return</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_decode</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">o</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> + <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> + <span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_decode</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">o</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">return</span> <span class="n">o</span></div> + + +<div class="viewcode-block" id="BinaryCEncoder"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.BinaryCEncoder">[docs]</a><span class="k">class</span> <span class="nc">BinaryCEncoder</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">JSONEncoder</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Encoding class function to attempt to convert things to strings.</span> +<span class="sd"> """</span> + +<div class="viewcode-block" id="BinaryCEncoder.default"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.BinaryCEncoder.default">[docs]</a> <span class="k">def</span> <span class="nf">default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">o</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Converting function. Well, could be more precise. look at the JSON module</span> +<span class="sd"> """</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">str_repr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span> + <span class="k">pass</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">return</span> <span class="n">str_repr</span> + + <span class="c1"># Let the base class default method raise the TypeError</span> + <span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">JSONEncoder</span><span class="o">.</span><span class="n">default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">o</span><span class="p">)</span></div></div> + + +<div class="viewcode-block" id="format_ensemble_results"><a class="viewcode-back" href="../../../ensemble.html#binarycpython.utils.ensemble.format_ensemble_results">[docs]</a><span class="k">def</span> <span class="nf">format_ensemble_results</span><span class="p">(</span><span class="n">ensemble_dictionary</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to handle all the steps of formatting the ensemble output again.</span> + +<span class="sd"> Input:</span> +<span class="sd"> ensemble_dictionary: dictionary containing all the ensemble results</span> +<span class="sd"> """</span> + + <span class="n">original_ensemble_results</span> <span class="o">=</span> <span class="n">ensemble_dictionary</span> + + <span class="n">float_format_ensemble_results</span> <span class="o">=</span> <span class="n">recursive_change_key_to_float</span><span class="p">(</span> + <span class="n">original_ensemble_results</span> + <span class="p">)</span> + <span class="k">del</span> <span class="n">original_ensemble_results</span> + <span class="n">gc</span><span class="o">.</span><span class="n">collect</span><span class="p">()</span> + + <span class="c1"># Then sort the dictionary</span> + <span class="n">sorted_ensemble_results</span> <span class="o">=</span> <span class="n">custom_sort_dict</span><span class="p">(</span><span class="n">float_format_ensemble_results</span><span class="p">)</span> + <span class="k">del</span> <span class="n">float_format_ensemble_results</span> + <span class="n">gc</span><span class="o">.</span><span class="n">collect</span><span class="p">()</span> + + <span class="c1"># Then Change the keys back to a string but with a %g format.</span> + <span class="n">reformatted_ensemble_results</span> <span class="o">=</span> <span class="n">recursive_change_key_to_string</span><span class="p">(</span> + <span class="n">sorted_ensemble_results</span> + <span class="p">)</span> + <span class="k">del</span> <span class="n">sorted_ensemble_results</span> + <span class="n">gc</span><span class="o">.</span><span class="n">collect</span><span class="p">()</span> + + <span class="c1"># Put back in the dictionary</span> + <span class="k">return</span> <span class="n">reformatted_ensemble_results</span></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/functions.html b/docs/build/html/_modules/binarycpython/utils/functions.html index 9ff146e6c9abbc25f624ce2e211bc6b4e484eb40..c4d2b9787cc0198eb8a2ced22b0dd01553ab5352 100644 --- a/docs/build/html/_modules/binarycpython/utils/functions.html +++ b/docs/build/html/_modules/binarycpython/utils/functions.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.functions — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.functions</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.functions</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Module containing most of the utility functions for the binarycpython package</span> @@ -1326,48 +1244,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/grid.html b/docs/build/html/_modules/binarycpython/utils/grid.html index 4fb724020ddc8afa443f08ba297fed342de4ae1a..59782ad4776fa375bf044d47ac6e4e12dc096498 100644 --- a/docs/build/html/_modules/binarycpython/utils/grid.html +++ b/docs/build/html/_modules/binarycpython/utils/grid.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.grid — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,72 +46,38 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.grid</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.grid</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Module containing the Population grid class object.</span> <span class="sd">Here all the functionality of a Population object is defined.</span> +<span class="sd">TODO: the save_snapshots and save_snapshot, are they actually distinct?</span> + <span class="sd">Tasks:</span> <span class="sd"> - TODO: add functionality to 'on-init' set arguments</span> <span class="sd"> - TODO: add functionality to return the initial_abundance_hash</span> @@ -220,18 +140,18 @@ <span class="n">keys_to_floats</span><span class="p">,</span> <span class="p">)</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._analytics</span> <span class="kn">import</span> <span class="n">analytics</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._cache</span> <span class="kn">import</span> <span class="n">cache</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._dataIO</span> <span class="kn">import</span> <span class="n">dataIO</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._distribution_functions</span> <span class="kn">import</span> <span class="n">distribution_functions</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._grid_logging</span> <span class="kn">import</span> <span class="n">grid_logging</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._grid_options_defaults</span> <span class="kn">import</span> <span class="n">grid_options_defaults</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._gridcode</span> <span class="kn">import</span> <span class="n">gridcode</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._HPC</span> <span class="kn">import</span> <span class="n">HPC</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._metadata</span> <span class="kn">import</span> <span class="n">metadata</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._Moe_di_Stefano_2017</span> <span class="kn">import</span> <span class="n">Moe_di_Stefano_2017</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._spacing_functions</span> <span class="kn">import</span> <span class="n">spacing_functions</span> -<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions._version_info</span> <span class="kn">import</span> <span class="n">version_info</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.analytics</span> <span class="kn">import</span> <span class="n">analytics</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.cache</span> <span class="kn">import</span> <span class="n">cache</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.dataIO</span> <span class="kn">import</span> <span class="n">dataIO</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.distribution_functions</span> <span class="kn">import</span> <span class="n">distribution_functions</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.grid_logging</span> <span class="kn">import</span> <span class="n">grid_logging</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.grid_options_defaults</span> <span class="kn">import</span> <span class="n">grid_options_defaults</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.gridcode</span> <span class="kn">import</span> <span class="n">gridcode</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.HPC</span> <span class="kn">import</span> <span class="n">HPC</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.metadata</span> <span class="kn">import</span> <span class="n">metadata</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.Moe_di_Stefano_2017</span> <span class="kn">import</span> <span class="n">Moe_di_Stefano_2017</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.spacing_functions</span> <span class="kn">import</span> <span class="n">spacing_functions</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.version_info</span> <span class="kn">import</span> <span class="n">version_info</span> <span class="kn">from</span> <span class="nn">binarycpython</span> <span class="kn">import</span> <span class="n">_binary_c_bindings</span> @@ -301,6 +221,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_defaults_dict</span><span class="p">())</span> <span class="c1"># Custom options</span> + <span class="c1"># TODO: is this really necessary here? The custom options should be empty on start i think</span> <span class="bp">self</span><span class="o">.</span><span class="n">custom_options</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"save_snapshot"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="p">}</span> @@ -325,7 +246,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">get_Moe_di_Stefano_2017_default_options</span><span class="p">()</span> <span class="p">)</span> - <span class="c1"># Write MOE2017 options to a file. NOTE: not sure why i put this here anymore</span> + <span class="c1"># Write MOE2017 options to a file. NOTE: (david) not sure why i put this here anymore</span> <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"tmp_dir"</span><span class="p">],</span> <span class="s2">"moe_distefano"</span><span class="p">),</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span> <span class="p">)</span> @@ -375,6 +296,10 @@ <span class="c1"># add metadata</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_system_metadata</span><span class="p">()</span> + <span class="c1"># set up function cache.</span> + <span class="c1"># NOTE: (david) I added this here to be able to test the distributions functions without actually running anything.</span> + <span class="bp">self</span><span class="o">.</span><span class="n">setup_function_cache</span><span class="p">()</span> + <div class="viewcode-block" id="Population.jobID"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.jobID">[docs]</a> <span class="k">def</span> <span class="nf">jobID</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">"""</span> <span class="sd"> Function to return the job ID number of this process</span> @@ -2530,48 +2455,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/plot_functions.html b/docs/build/html/_modules/binarycpython/utils/plot_functions.html index 1b413402048aa2d3439d5a849837ff11cf70209f..4f611d853d56dd84e0a879f2b2368b087aa57ef7 100644 --- a/docs/build/html/_modules/binarycpython/utils/plot_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/plot_functions.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.plot_functions — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.plot_functions</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.plot_functions</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Module that contains functionality to plot some properties of (binary) systems.</span> @@ -781,48 +699,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/HPC.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/HPC.html new file mode 100644 index 0000000000000000000000000000000000000000..dabe0db4f28a7ac6c39bb9371c87ffd2f53727e4 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/HPC.html @@ -0,0 +1,823 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.HPC — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.HPC</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.HPC</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the functions to HPC functionality</span> + +<span class="sd">These functions form a single API through which you can access HPC resources.</span> + +<span class="sd">Generally, you should call an HPC function rather than the Slurm or Condor interface</span> +<span class="sd">directly. The HPC function then decides which interface to use, so that all the</span> +<span class="sd">other modules can use a single API rather than have to choose to use the Slurm or</span> +<span class="sd">Condor API.</span> + +<span class="sd">This class object is an extension to the population grid object</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">glob</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">import</span> <span class="nn">os</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">now</span><span class="p">,</span> +<span class="p">)</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.slurm</span> <span class="kn">import</span> <span class="n">slurm</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.condor</span> <span class="kn">import</span> <span class="n">condor</span> + + +<div class="viewcode-block" id="HPC"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC">[docs]</a><span class="k">class</span> <span class="nc">HPC</span><span class="p">(</span><span class="n">condor</span><span class="p">,</span> <span class="n">slurm</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Extension to the population grid object that contains functionality to handle handle the Moe & distefano distributions</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the gridcode class</span> +<span class="sd"> """</span> + + <span class="n">condor</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> + <span class="n">slurm</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> + +<div class="viewcode-block" id="HPC.HPC_njobs"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_njobs">[docs]</a> <span class="k">def</span> <span class="nf">HPC_njobs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the number of jobs this HPC jobs will use, as an int.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_njobs"</span><span class="p">]</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_njobs"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">n</span><span class="p">)</span></div> + +<div class="viewcode-block" id="HPC.HPC_make_joiningfile"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_make_joiningfile">[docs]</a> <span class="k">def</span> <span class="nf">HPC_make_joiningfile</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">hpc_jobid</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hpc_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">n</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">error_on_overwrite</span><span class="o">=</span><span class="kc">False</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to make the joiningfile file that contains the filenames of results from each job. When all these exist, we can join.</span> + +<span class="sd"> Note: you normally don't need to set any of the option arguments.</span> + +<span class="sd"> Args:</span> +<span class="sd"> hpc_jobid : the job ID number, or self.HPC_jobID_tuple()[0] if None (default=None).</span> +<span class="sd"> hpc_dir : the HPC directory, or self.HPC_dir() if None (default=None).</span> +<span class="sd"> n : the number of jobs, or self.HPC_njobs() if None (default=None).</span> +<span class="sd"> overwrite : if True, overwrite an existing joiningfile (default=False)</span> +<span class="sd"> error_on_overwite : if True, and we try to overwrite, issue and error and exit (default=False)</span> + +<span class="sd"> Returns:</span> +<span class="sd"> True if the file is made, False otherwise.</span> + +<span class="sd"> """</span> + + <span class="c1"># defaults</span> + <span class="k">if</span> <span class="n">hpc_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">hpc_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_dir</span><span class="p">()</span> + <span class="k">if</span> <span class="n">n</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">()</span> + <span class="k">if</span> <span class="n">hpc_jobid</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">hpc_jobid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID_tuple</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> + + <span class="c1"># make path and filename</span> + <span class="n">prefix</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">hpc_dir</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">)</span> + <span class="n">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">hpc_jobid</span> <span class="o">+</span> <span class="s2">".all"</span><span class="p">)</span> + + <span class="c1"># make the output before checking anything, we do</span> + <span class="c1"># this to remove any asynchronicity</span> + <span class="n">lines</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span> + <span class="n">lines</span> <span class="o">+=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="s2">"</span><span class="si">{hpc_jobid}</span><span class="s2">.</span><span class="si">{i}</span><span class="s2">.gz</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">hpc_jobid</span><span class="o">=</span><span class="n">hpc_jobid</span><span class="p">,</span> <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="p">))]</span> + <span class="n">string</span> <span class="o">=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lines</span><span class="p">)</span> + + <span class="c1"># check the joiningfile doesn't exist</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">overwrite</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">file</span><span class="p">):</span> + <span class="c1"># file already exists</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Cannot make joiningfile at </span><span class="si">{file}</span><span class="s2"> because it already exists, instead I am waiting for it to be unlocked."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="o">=</span><span class="n">file</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_unlock</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + <span class="n">joinfiles</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_load_joinfiles_list</span><span class="p">(</span><span class="n">joinlist</span><span class="o">=</span><span class="n">file</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Unlocked and got </span><span class="si">{}</span><span class="s2"> should be </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">len</span><span class="p">(</span><span class="n">joinfiles</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">()</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="c1"># perhaps exit here? (e.g. for debugging)</span> + <span class="k">if</span> <span class="n">error_on_overwrite</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># open the file, but locked so we have first unique access</span> + <span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">lock</span><span class="p">)</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">locked_open_for_write</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + + <span class="c1"># write to it if we are first to obtain unique access</span> + <span class="k">if</span> <span class="n">lock</span> <span class="ow">and</span> <span class="n">f</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Making joiningfile list range (0,</span><span class="si">{}</span><span class="s2">) at </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span> + <span class="n">os</span><span class="o">.</span><span class="n">fsync</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">fileno</span><span class="p">())</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">True</span> + <span class="bp">self</span><span class="o">.</span><span class="n">locked_close</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">lock</span><span class="p">)</span> + <span class="n">os</span><span class="o">.</span><span class="n">sync</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Checking joiningfile </span><span class="si">{}</span><span class="s2"> length (size = </span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">getsize</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">joinfiles</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_load_joinfiles_list</span><span class="p">(</span><span class="n">joinlist</span><span class="o">=</span><span class="n">file</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Got </span><span class="si">{}</span><span class="s2"> should be </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">joinfiles</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">()))</span> + + <span class="k">else</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">False</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Joiningfile failed to get lock: waiting for it to be unlocked"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_unlock</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + <span class="k">return</span> <span class="n">x</span></div> + +<div class="viewcode-block" id="HPC.HPC_joinlist"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_joinlist">[docs]</a> <span class="k">def</span> <span class="nf">HPC_joinlist</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">joinlist</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the default HPC joinlist file.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">joinlist</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">joinlist</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"joinlist"</span><span class="p">]</span> + <span class="k">return</span> <span class="n">joinlist</span></div> + +<div class="viewcode-block" id="HPC.HPC_load_joinfiles_list"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_load_joinfiles_list">[docs]</a> <span class="k">def</span> <span class="nf">HPC_load_joinfiles_list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">joinlist</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to load in the list of files we should join, and return it.</span> + +<span class="sd"> If grid_options['HPC_rebuild_joinlist'] is True, we rebuild it.</span> +<span class="sd"> """</span> + + <span class="n">prefix</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">HPC_dir</span><span class="p">(),</span> <span class="s2">"results"</span><span class="p">)</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"HPC_rebuild_joinlist"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="c1"># we should rebuild the joinlist from the</span> + <span class="c1"># files we find at the prefix directory</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Rebuild joinlist from existing files"</span><span class="p">)</span> + <span class="n">joinlist</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"/*.gz"</span><span class="p">)</span> + <span class="k">return</span> <span class="n">joinlist</span> + + <span class="n">joinlist</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_joinlist</span><span class="p">(</span><span class="n">joinlist</span><span class="o">=</span><span class="n">joinlist</span><span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_unlock</span><span class="p">(</span><span class="n">joinlist</span><span class="p">)</span> + <span class="n">f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">joinlist</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + <span class="n">joinlist</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + + <span class="k">if</span> <span class="kc">False</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"HPC_load_joinfiles_list read joinlist </span><span class="si">{joinlist}</span><span class="s2"> -> gave file joinlist of length </span><span class="si">{len_joinlist}</span><span class="s2"> with contents </span><span class="si">{joinlist}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">joinlist</span><span class="o">=</span><span class="n">joinlist</span><span class="p">,</span> <span class="n">len_joinlist</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">joinlist</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Failed to open joinlist at </span><span class="si">{joinlist}</span><span class="s2"> : </span><span class="si">{e}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">joinlist</span><span class="o">=</span><span class="n">joinlist</span><span class="p">,</span> <span class="n">e</span><span class="o">=</span><span class="n">e</span><span class="p">))</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">joinlist</span></div> + +<div class="viewcode-block" id="HPC.HPC_join_from_files"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_from_files">[docs]</a> <span class="k">def</span> <span class="nf">HPC_join_from_files</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">newobj</span><span class="p">,</span> <span class="n">joinfiles</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Merge the results from the list joinfiles into newobj.</span> +<span class="sd"> """</span> + <span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">joinfiles</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Join data in"</span><span class="p">,</span> <span class="n">file</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">merge_populations_from_file</span><span class="p">(</span><span class="n">newobj</span><span class="p">,</span> <span class="n">file</span><span class="p">)</span> + <span class="k">return</span> <span class="n">newobj</span></div> + +<div class="viewcode-block" id="HPC.HPC_can_join"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_can_join">[docs]</a> <span class="k">def</span> <span class="nf">HPC_can_join</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">joinfiles</span><span class="p">,</span> <span class="n">joiningfile</span><span class="p">,</span> <span class="n">vb</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Check the joinfiles to make sure they all exist</span> +<span class="sd"> and their .saved equivalents also exist</span> +<span class="sd"> """</span> + + <span class="nb">print</span><span class="p">(</span><span class="s2">"HPC check if we can join at </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">now</span><span class="p">()))</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"HPC_force_join"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">):</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"cannot join : joiningfile exists at </span><span class="si">{}</span><span class="s2"> (check 1)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">joiningfile</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span> <span class="kc">False</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"joiningfile (at </span><span class="si">{}</span><span class="s2">) does not exist"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">))</span> + + <span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">joinfiles</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"check for </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">file</span><span class="p">))</span> + + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s1">'cannot join : file "</span><span class="si">{}</span><span class="s1">" does not exist'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">file</span><span class="p">))</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="n">savedfile</span> <span class="o">=</span> <span class="n">file</span> <span class="o">+</span> <span class="s2">".saved"</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"check for </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">savedfile</span><span class="p">))</span> + + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">savedfile</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s1">'cannot join : savedfile "</span><span class="si">{}</span><span class="s1">" does not exist'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">savedfile</span><span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="c1"># found both files</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"found </span><span class="si">{}</span><span class="s2"> and </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="n">savedfile</span><span class="p">))</span> + + <span class="c1"># check for joiningfile again</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"HPC_force_join"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Forcing join because HPC_force_join is set"</span><span class="p">)</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">True</span> + <span class="k">elif</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">):</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"cannot join: joiningfile exists at </span><span class="si">{}</span><span class="s2"> (check 2)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">joiningfile</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">elif</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"joiningfile at </span><span class="si">{}</span><span class="s2"> does not exist : can join"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">))</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">True</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"returning </span><span class="si">{}</span><span class="s2"> from HPC_can_join()"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="p">))</span> + + <span class="k">return</span> <span class="n">x</span></div> + +<div class="viewcode-block" id="HPC.HPC_job"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job">[docs]</a> <span class="k">def</span> <span class="nf">HPC_job</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return True if we're running an HPC (Slurm or Condor) job, False otherwise.</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span></div> + +<div class="viewcode-block" id="HPC.HPC_job_task"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_task">[docs]</a> <span class="k">def</span> <span class="nf">HPC_job_task</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the HPC task number, which is 1 when setting</span> +<span class="sd"> up and running the scripts, 2 when joining data.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">return</span> <span class="n">x</span></div> + +<div class="viewcode-block" id="HPC.HPC_job_type"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_type">[docs]</a> <span class="k">def</span> <span class="nf">HPC_job_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return a string telling us the type of an HPC job, i.e.</span> +<span class="sd"> "slurm", "condor" or "None".</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">hpc_type</span> <span class="o">=</span> <span class="s2">"slurm"</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">hpc_type</span> <span class="o">=</span> <span class="s2">"condor"</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">hpc_type</span> <span class="o">=</span> <span class="s2">"None"</span> + <span class="k">return</span> <span class="n">hpc_type</span></div> + +<div class="viewcode-block" id="HPC.HPC_jobID"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID">[docs]</a> <span class="k">def</span> <span class="nf">HPC_jobID</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return an HPC (Slurm or Condor) job id in the form x.y. Returns None if not an HPC job.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">hpc_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurmID</span><span class="p">()</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">hpc_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condorID</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># not an HPC job</span> + <span class="n">hpc_id</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">hpc_id</span></div> + +<div class="viewcode-block" id="HPC.HPC_jobID_tuple"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID_tuple">[docs]</a> <span class="k">def</span> <span class="nf">HPC_jobID_tuple</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return the job ID as a tuple of ints, (x,y), or (None,None) on failure</span> +<span class="sd"> """</span> + <span class="n">hpc_jobid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID</span><span class="p">()</span> + + <span class="k">if</span> <span class="n">hpc_jobid</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">id</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"None"</span><span class="p">):</span> + <span class="n">t</span> <span class="o">=</span> <span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">():</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"JOBID"</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span> + <span class="n">t</span> <span class="o">=</span> <span class="nb">id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</span><span class="p">)</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">t</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span> + <span class="n">t</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">t</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span> + <span class="n">t</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">t</span><span class="p">)</span></div> + +<div class="viewcode-block" id="HPC.HPC_set_status"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_set_status">[docs]</a> <span class="k">def</span> <span class="nf">HPC_set_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Set the appropriate HPC job (Condor or Slurm) status file to whatever is given in string.</span> + +<span class="sd"> Arguments:</span> +<span class="sd"> string : the new contents of the status file</span> + +<span class="sd"> Returns:</span> +<span class="sd"> True if the status was set, False otherwise.</span> +<span class="sd"> (As returned by either the appropriate Condor or Slurm function)</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">set_slurm_status</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">set_condor_status</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">return</span> <span class="n">status</span></div> + +<div class="viewcode-block" id="HPC.HPC_get_status"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_get_status">[docs]</a> <span class="k">def</span> <span class="nf">HPC_get_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">job_id</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">job_index</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hpc_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Get and return the appropriate HPC job (Condor or Slurm) status string for this job (or, if given, the job at id.index)</span> + +<span class="sd"> Args:</span> +<span class="sd"> hpc_dir : optional HPC run directory. If not set, the default (e.g. slurm_dir or condor_dir)</span> +<span class="sd"> is used.</span> +<span class="sd"> job_id,job_index : the id and index of the job to be queried</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_slurm_status</span><span class="p">(</span> + <span class="n">jobid</span><span class="o">=</span><span class="n">job_id</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="n">job_index</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="n">hpc_dir</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_condor_status</span><span class="p">(</span> + <span class="n">ClusterID</span><span class="o">=</span><span class="n">job_id</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="n">job_index</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="n">hpc_dir</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">status</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">return</span> <span class="n">status</span></div> + +<div class="viewcode-block" id="HPC.HPC_dirs"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dirs">[docs]</a> <span class="k">def</span> <span class="nf">HPC_dirs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return a list of directories required for this HPC job.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">dirs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurm_dirs</span><span class="p">()</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">dirs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condor_dirs</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">dirs</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">return</span> <span class="n">dirs</span></div> + +<div class="viewcode-block" id="HPC.HPC_grid"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_grid">[docs]</a> <span class="k">def</span> <span class="nf">HPC_grid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">makejoiningfile</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to call the appropriate HPC grid function</span> +<span class="sd"> (e.g. Slurm or Condor) and return what it returns.</span> + +<span class="sd"> Args:</span> +<span class="sd"> makejoiningfile : if True, and we're the first job with self.HPC_task() == 2, we build the joiningfile. (default=True) This option exists in case you don't want to overwrite an existing joiningfile, or want to build it in another way (e.g. in the HPC scripts).</span> +<span class="sd"> """</span> + + <span class="n">jobid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID_tuple</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> + + <span class="c1"># give some current status about the HPC run</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_dump_status</span><span class="p">(</span><span class="s2">"HPC grid before"</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">makejoiningfile</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_task</span><span class="p">()</span> <span class="o">==</span> <span class="mi">2</span> <span class="ow">and</span> <span class="n">jobid</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_make_joiningfile</span><span class="p">()</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurm_grid</span><span class="p">()</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condor_grid</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># should not happen</span> + + <span class="c1"># give some current status about the HPC run</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_dump_status</span><span class="p">(</span><span class="s2">"HPC grid after"</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">x</span></div> + +<div class="viewcode-block" id="HPC.HPC_check_requirements"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_check_requirements">[docs]</a> <span class="k">def</span> <span class="nf">HPC_check_requirements</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to check HPC option requirements have been met. Returns a tuple: (True,"") if all is ok, (False,<warning string>) otherwise.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">t</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurm_check_requirements</span><span class="p">()</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">t</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condor_check_requirements</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">t</span> <span class="o">=</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="k">return</span> <span class="n">t</span></div> + +<div class="viewcode-block" id="HPC.HPC_id_filename"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_filename">[docs]</a> <span class="k">def</span> <span class="nf">HPC_id_filename</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> HPC jobs have a filename in their directory which specifies the job id. This function returns the contents of that file as a string, or None on failure.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">filename</span> <span class="o">=</span> <span class="s2">"jobid"</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">filename</span> <span class="o">=</span> <span class="s2">"ClusterID"</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">filename</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">filename</span></div> + +<div class="viewcode-block" id="HPC.HPC_id_from_dir"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_from_dir">[docs]</a> <span class="k">def</span> <span class="nf">HPC_id_from_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hpc_dir</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the ID of an HPC run given its (already existing) directory.</span> +<span class="sd"> """</span> + + <span class="n">filename</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_id_filename</span><span class="p">()</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">filename</span><span class="p">:</span> + <span class="k">return</span> <span class="kc">None</span> + + <span class="n">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">hpc_dir</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span> + <span class="n">f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">f</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Error: could not open </span><span class="si">{file}</span><span class="s2"> to read the HPC jobid of the directory </span><span class="si">{hpc_dir}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="o">=</span><span class="n">file</span><span class="p">,</span> <span class="n">hpc_dir</span><span class="o">=</span><span class="n">hpc_dir</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="n">oldjobid</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">oldjobid</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Error: could not find jobid in </span><span class="si">{hpc_dir}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">hpc_dir</span><span class="o">=</span><span class="n">hpc_dir</span><span class="p">))</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="k">return</span> <span class="n">oldjobid</span></div> + +<div class="viewcode-block" id="HPC.HPC_restore"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_restore">[docs]</a> <span class="k">def</span> <span class="nf">HPC_restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Set grid_options['restore_from_snapshot_file'] so that we restore data from existing</span> +<span class="sd"> an HPC run if self.grid_options[hpc_job_type+'_restart_dir'], where hpc_job_type is "slurm" or "condor",</span> +<span class="sd"> is provided, otherwise do nothing. This only works if grid_options[hpc_job_type] == self.HPC_job_task() == 2, which is</span> +<span class="sd"> the run-grid stage of the process.</span> +<span class="sd"> """</span> + + <span class="n">hpc_job_type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_type</span><span class="p">()</span> + <span class="k">if</span> <span class="n">hpc_job_type</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> + + <span class="n">key</span> <span class="o">=</span> <span class="n">hpc_job_type</span> <span class="o">+</span> <span class="s2">"_restart_dir"</span> + <span class="k">if</span> <span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">:</span> + <span class="k">return</span> + + <span class="c1"># get restart directory</span> + <span class="n">hpc_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">hpc_job_type</span> <span class="o">+</span> <span class="s2">"_restart_dir"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">hpc_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> + + <span class="c1"># get HPC job index</span> + <span class="n">index</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID_tuple</span><span class="p">()[</span><span class="mi">1</span><span class="p">]</span> + <span class="k">if</span> <span class="n">index</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_task</span><span class="p">()</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> <span class="c1"># (same as) self.grid_options[hpc_job_type] == 2:</span> + <span class="n">old_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_id_from_dir</span><span class="p">(</span><span class="n">hpc_dir</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Restart from hpc_dir </span><span class="si">{hpc_dir}</span><span class="s2"> which was has (old) ID </span><span class="si">{old_id}</span><span class="s2">, we are job index </span><span class="si">{index}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">hpc_dir</span><span class="o">=</span><span class="n">hpc_dir</span><span class="p">,</span> <span class="n">old_id</span><span class="o">=</span><span class="n">old_id</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="n">index</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1"># check status: if "finished", we don't have to do anything</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_get_status</span><span class="p">(</span><span class="n">hpc_dir</span><span class="o">=</span><span class="n">hpc_dir</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">status</span> <span class="o">==</span> <span class="s2">"finished"</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Status is finished, cannot and do not need to restart."</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> + + <span class="n">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="nb">dir</span><span class="p">,</span> <span class="s2">"snapshots"</span><span class="p">,</span> <span class="s2">"</span><span class="si">{id}</span><span class="s2">.</span><span class="si">{index}</span><span class="s2">.gz"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">old_id</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="n">index</span><span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">file</span><span class="p">):</span> + <span class="c1"># have data from which we can restore, set it in</span> + <span class="c1"># the appropriate grid option</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Restore this run from snapshot </span><span class="si">{file}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">file</span><span class="o">=</span><span class="n">file</span><span class="p">))</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"restore_from_snapshot_file"</span><span class="p">]</span> <span class="o">=</span> <span class="n">file</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># no snapshot: so no need to restore, just exit</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Expected snapshot at </span><span class="si">{file}</span><span class="s2"> but none was found"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">file</span><span class="o">=</span><span class="n">file</span><span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> + <span class="k">return</span></div> + +<div class="viewcode-block" id="HPC.HPC_join_previous"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_previous">[docs]</a> <span class="k">def</span> <span class="nf">HPC_join_previous</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to join previously generated datasets.</span> +<span class="sd"> """</span> + <span class="c1"># check that our job has finished</span> + <span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_get_status</span><span class="p">()</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Job status"</span><span class="p">,</span> <span class="n">status</span><span class="p">)</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"HPC_force_join"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">status</span> <span class="o">!=</span> <span class="s2">"finished"</span><span class="p">:</span> + <span class="c1"># job did not finish : save a snapshot</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"This job did not finish (status is </span><span class="si">{status}</span><span class="s2">) : cannot join"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">status</span><span class="o">=</span><span class="n">status</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># our job has finished</span> + <span class="n">HPC_status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_status</span><span class="p">()</span> + + <span class="c1"># HPC_queue_stats = self.HPC_queue_stats()</span> + + <span class="k">if</span> <span class="n">HPC_status</span><span class="p">[</span><span class="s2">"status"</span><span class="p">][</span><span class="s2">"finished"</span><span class="p">]</span> <span class="o">!=</span> <span class="n">HPC_status</span><span class="p">[</span><span class="s2">"njobs"</span><span class="p">]:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"HPC_status reports </span><span class="si">{}</span><span class="s2"> finished jobs out of </span><span class="si">{}</span><span class="s2">. We cannot join because not all the jobs are finished. Exiting."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">HPC_status</span><span class="p">[</span><span class="s2">"status"</span><span class="p">][</span><span class="s2">"finished"</span><span class="p">],</span> <span class="n">HPC_status</span><span class="p">[</span><span class="s2">"njobs"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + + <span class="n">joinfiles</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_load_joinfiles_list</span><span class="p">()</span> + <span class="n">joiningfile</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_path</span><span class="p">(</span><span class="s2">"joining"</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Joinfile list n=</span><span class="si">{n}</span><span class="s2"> (should be </span><span class="si">{m}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">n</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">joinfiles</span><span class="p">),</span> <span class="n">m</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">()</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Joingingfile path : "</span><span class="p">,</span> <span class="n">joiningfile</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">joinfiles</span><span class="p">)</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">():</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Number of joinfiles != njobs : this is wrong, exiting."</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_can_join</span><span class="p">(</span><span class="n">joinfiles</span><span class="p">,</span> <span class="n">joiningfile</span><span class="p">,</span> <span class="n">vb</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> + <span class="c1"># join object files</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"We can join"</span><span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="c1"># touch joiningfile</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"HPC_force_join"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Making joiningfile at </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">))</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_touch</span><span class="p">(</span><span class="n">joiningfile</span><span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Calling HPC_join_from_files()"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_join_from_files</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">joinfiles</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Join gave exception"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span> + <span class="c1"># disable analytics calculations : use the</span> + <span class="c1"># values we just loaded</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"do_analytics"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">return</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"pass </span><span class="si">{}</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span> + <span class="k">pass</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"cannot join : other tasks are not yet finished</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Finished this job : exiting"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span></div> + +<div class="viewcode-block" id="HPC.HPC_path"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_path">[docs]</a> <span class="k">def</span> <span class="nf">HPC_path</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to file the filename of this HPC job's file at path.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">p</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurmpath</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">p</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">p</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">p</span></div> + +<div class="viewcode-block" id="HPC.HPC_snapshot_filename"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_snapshot_filename">[docs]</a> <span class="k">def</span> <span class="nf">HPC_snapshot_filename</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return an HPC job's snapshot filename.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">():</span> + <span class="n">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">HPC_dir</span><span class="p">,</span> <span class="s2">"snapshots"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID</span><span class="p">()</span> <span class="o">+</span> <span class="s2">".gz"</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">file</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">file</span></div> + +<div class="viewcode-block" id="HPC.HPC_dir"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dir">[docs]</a> <span class="k">def</span> <span class="nf">HPC_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return an HPC job's directory.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">d</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">d</span></div> + +<div class="viewcode-block" id="HPC.HPC_touch"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_touch">[docs]</a> <span class="k">def</span> <span class="nf">HPC_touch</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">string</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to touch the file at filename, put into it the job number</span> +<span class="sd"> and (if given) the string passed in.</span> +<span class="sd"> """</span> + + <span class="k">try</span><span class="p">:</span> + <span class="n">f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">f</span><span class="p">:</span> + <span class="n">job</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID</span><span class="p">()</span> + <span class="n">jobtype</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_type</span><span class="p">()</span> + <span class="k">if</span> <span class="n">job</span><span class="p">:</span> + <span class="n">s</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">job</span><span class="p">)</span> + <span class="k">if</span> <span class="n">jobtype</span><span class="p">:</span> + <span class="n">s</span> <span class="o">+=</span> <span class="s2">" "</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">jobtype</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="k">if</span> <span class="n">string</span><span class="p">:</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + <span class="k">except</span><span class="p">:</span> + <span class="k">pass</span></div> + +<div class="viewcode-block" id="HPC.HPC_status"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_status">[docs]</a> <span class="k">def</span> <span class="nf">HPC_status</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return a dict of useful information about the current status</span> +<span class="sd"> of this HPC run.</span> +<span class="sd"> """</span> + <span class="n">d</span> <span class="o">=</span> <span class="p">{}</span> <span class="c1"># returned</span> + <span class="n">_id</span><span class="p">,</span> <span class="n">_index</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_jobID_tuple</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"job_id"</span><span class="p">]</span> <span class="o">=</span> <span class="n">_id</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"job_index"</span><span class="p">]</span> <span class="o">=</span> <span class="n">_index</span> + <span class="k">if</span> <span class="n">_id</span> <span class="ow">and</span> <span class="n">_index</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_njobs</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"njobs"</span><span class="p">]</span> <span class="o">=</span> <span class="n">n</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"job_task"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_task</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"job_type"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job_type</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"job_status"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_get_status</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"dir"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_dir</span><span class="p">()</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"dirs"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_dirs</span><span class="p">()</span> + + <span class="c1"># get fellow jobs' status</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"joblist"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># default types</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"running"</span><span class="p">,</span> <span class="s2">"starting"</span><span class="p">,</span> <span class="s2">"finishing"</span><span class="p">,</span> <span class="s2">"finished"</span><span class="p">,</span> <span class="s2">"killed"</span><span class="p">]:</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"status"</span><span class="p">][</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"joblist"</span><span class="p">][</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> + + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span> + <span class="n">s</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_get_status</span><span class="p">(</span><span class="n">job_id</span><span class="o">=</span><span class="n">_id</span><span class="p">,</span> <span class="n">job_index</span><span class="o">=</span><span class="n">i</span><span class="p">)</span> + <span class="k">if</span> <span class="n">s</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">s</span> <span class="o">=</span> <span class="s2">"unknown"</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]:</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"status"</span><span class="p">][</span><span class="n">s</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"status"</span><span class="p">][</span><span class="n">s</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="s2">"joblist"</span><span class="p">]:</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"joblist"</span><span class="p">][</span><span class="n">s</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">_id</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">d</span><span class="p">[</span><span class="s2">"joblist"</span><span class="p">][</span><span class="n">s</span><span class="p">]</span> <span class="o">+=</span> <span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">_id</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)]</span> + + <span class="k">return</span> <span class="n">d</span></div> + +<div class="viewcode-block" id="HPC.HPC_dump_status"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dump_status">[docs]</a> <span class="k">def</span> <span class="nf">HPC_dump_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to print the status of the HPC grid</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">string</span><span class="p">:</span> + <span class="n">string</span> <span class="o">=</span> <span class="s2">""</span> + + <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_status</span><span class="p">()</span> + + <span class="nb">print</span><span class="p">(</span><span class="s2">"############################################################"</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"HPC job status "</span> <span class="o">+</span> <span class="n">string</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"############################################################"</span><span class="p">)</span></div> + +<div class="viewcode-block" id="HPC.HPC_queue_stats"><a class="viewcode-back" href="../../../../population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_queue_stats">[docs]</a> <span class="k">def</span> <span class="nf">HPC_queue_stats</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the queue stats for the HPC grid</span> +<span class="sd"> TODO: the slurm_queue_stats doesntt actually return anything</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurm_queue_stats</span><span class="p">()</span> + <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condor_queue_stats</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">x</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">return</span> <span class="n">x</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/analytics.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/analytics.html new file mode 100644 index 0000000000000000000000000000000000000000..f882bd942aa5eb59b9dd6300f5e89c6c09922ec0 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/analytics.html @@ -0,0 +1,226 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.analytics — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.analytics</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.analytics</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">The class extension for the population object that contains analytics functionality</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">time</span> + +<div class="viewcode-block" id="analytics"><a class="viewcode-back" href="../../../../population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics">[docs]</a><span class="k">class</span> <span class="nc">analytics</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension for the Population class containing the functions for analytics</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the analytics class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + + <span class="c1">#######################</span> + <span class="c1"># time used functions</span> + <span class="c1">#######################</span> + +<div class="viewcode-block" id="analytics.make_analytics_dict"><a class="viewcode-back" href="../../../../population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.make_analytics_dict">[docs]</a> <span class="k">def</span> <span class="nf">make_analytics_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to create the analytics dictionary</span> +<span class="sd"> """</span> + + <span class="nb">print</span><span class="p">(</span><span class="s2">"Do analytics"</span><span class="p">)</span> + + <span class="n">analytics_dict</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"do_analytics"</span><span class="p">]:</span> + <span class="c1"># Put all interesting stuff in a variable and output that afterwards, as analytics of the run.</span> + <span class="n">analytics_dict</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"population_id"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_population_id"</span><span class="p">],</span> + <span class="s2">"evolution_type"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">],</span> + <span class="s2">"failed_count"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_failed_count"</span><span class="p">],</span> + <span class="s2">"failed_prob"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_failed_prob"</span><span class="p">],</span> + <span class="s2">"failed_systems_error_codes"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"_failed_systems_error_codes"</span> + <span class="p">]</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span> + <span class="s2">"errors_exceeded"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_errors_exceeded"</span><span class="p">],</span> + <span class="s2">"errors_found"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_errors_found"</span><span class="p">],</span> + <span class="s2">"total_probability"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_probtot"</span><span class="p">],</span> + <span class="s2">"total_count"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_count"</span><span class="p">],</span> + <span class="s2">"start_timestamp"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_start_time_evolution"</span><span class="p">],</span> + <span class="s2">"end_timestamp"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_end_time_evolution"</span><span class="p">],</span> + <span class="s2">"time_elapsed"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">time_elapsed</span><span class="p">(),</span> + <span class="s2">"total_mass_run"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_total_mass_run"</span><span class="p">],</span> + <span class="s2">"total_probability_weighted_mass_run"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"_total_probability_weighted_mass_run"</span> + <span class="p">],</span> + <span class="s2">"zero_prob_stars_skipped"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"_zero_prob_stars_skipped"</span> + <span class="p">],</span> + <span class="p">}</span> + + <span class="k">if</span> <span class="s2">"metadata"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">:</span> + <span class="c1"># Add analytics dict to the metadata too:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">analytics_dict</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">add_system_metadata</span><span class="p">()</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># use existing analytics dict</span> + <span class="n">analytics_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"metadata"</span><span class="p">,</span> <span class="p">{})</span> + + <span class="k">return</span> <span class="n">analytics_dict</span></div> + +<div class="viewcode-block" id="analytics.set_time"><a class="viewcode-back" href="../../../../population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.set_time">[docs]</a> <span class="k">def</span> <span class="nf">set_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">when</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to set the timestamp at when, where when is 'start' or 'end'.</span> + +<span class="sd"> If when == end, we also calculate the time elapsed.</span> +<span class="sd"> """</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_"</span> <span class="o">+</span> <span class="n">when</span> <span class="o">+</span> <span class="s2">"_time_evolution"</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> + <span class="k">if</span> <span class="n">when</span> <span class="o">==</span> <span class="s2">"end"</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_time_elapsed"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">time_elapsed</span><span class="p">(</span><span class="n">force</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div> + +<div class="viewcode-block" id="analytics.time_elapsed"><a class="viewcode-back" href="../../../../population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.time_elapsed">[docs]</a> <span class="k">def</span> <span class="nf">time_elapsed</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">force</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return how long a population object has been running.</span> + +<span class="sd"> We return the cached value if it's available, and calculate</span> +<span class="sd"> the time elapsed if otherwise or if force is True</span> +<span class="sd"> """</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"_start_time_evolution"</span><span class="p">,</span> <span class="s2">"_end_time_evolution"</span><span class="p">]:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">x</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> + <span class="c1"># print("{} missing : {}".format(x, self.grid_options[x]))</span> + + <span class="k">if</span> <span class="n">force</span> <span class="ow">or</span> <span class="s2">"_time_elapsed"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_time_elapsed"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_end_time_evolution"</span><span class="p">]</span> + <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_start_time_evolution"</span><span class="p">]</span> + <span class="p">)</span> + <span class="c1"># print(</span> + <span class="c1"># "set time elapsed = {} - {} = {}".format(</span> + <span class="c1"># self.grid_options["_end_time_evolution"],</span> + <span class="c1"># self.grid_options["_start_time_evolution"],</span> + <span class="c1"># self.grid_options["_time_elapsed"],</span> + <span class="c1"># )</span> + <span class="c1"># )</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_time_elapsed"</span><span class="p">]</span></div> + +<div class="viewcode-block" id="analytics.CPU_time"><a class="viewcode-back" href="../../../../population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.CPU_time">[docs]</a> <span class="k">def</span> <span class="nf">CPU_time</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return how much CPU time we've used</span> +<span class="sd"> """</span> + <span class="n">dt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_time_elapsed"</span><span class="p">]</span> + + <span class="n">ncpus</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"num_processes"</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> + + <span class="c1"># print("CPU time : dt={} n={} -> {}".format(dt, ncpus, dt * ncpus))</span> + + <span class="k">return</span> <span class="n">dt</span> <span class="o">*</span> <span class="n">ncpus</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/cache.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/cache.html new file mode 100644 index 0000000000000000000000000000000000000000..d6382eaa0e0a0bb1e1f2a468dcb15336afef8d57 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/cache.html @@ -0,0 +1,472 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.cache — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.cache</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.cache</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">File containing the class extension for the population object that contains cache functionality</span> + +<span class="sd">Module containing (e.g. LRU) cache functionality for binary_c-python.</span> + +<span class="sd">We use cachetools when possible because this allows us to set up the</span> +<span class="sd">cache of the appropriate size for the task in the grid_options dict.</span> +<span class="sd">Please see the LRU_* options in there.</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">import</span> <span class="nn">time</span> +<span class="kn">import</span> <span class="nn">tempfile</span> +<span class="kn">import</span> <span class="nn">importlib</span> +<span class="kn">import</span> <span class="nn">getpass</span> +<span class="kn">import</span> <span class="nn">contextlib</span> + +<span class="kn">import</span> <span class="nn">cachetools</span> + + +<div class="viewcode-block" id="cache"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache">[docs]</a><span class="k">class</span> <span class="nc">cache</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Class extension for the population object that contains cache functionality</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the spacing_functions class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="cache.default_cache_dir"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.default_cache_dir">[docs]</a> <span class="k">def</span> <span class="nf">default_cache_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return a default cache directory path for binary_c-python, or None if we cannot find one. This is used in grid_options_defaults.py</span> +<span class="sd"> """</span> + + <span class="n">error_string</span> <span class="o">=</span> <span class="s2">"__*ERR*__"</span> <span class="c1"># string that cannot be a path</span> + <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="p">[</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"HOME"</span><span class="p">,</span> <span class="n">error_string</span><span class="p">),</span> <span class="s2">".cache"</span><span class="p">),</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"TMP"</span><span class="p">,</span> <span class="n">error_string</span><span class="p">),</span> <span class="s2">"cache"</span><span class="p">),</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s2">"var"</span><span class="p">,</span> <span class="s2">"tmp"</span><span class="p">,</span> <span class="n">getpass</span><span class="o">.</span><span class="n">getuser</span><span class="p">(),</span> <span class="s2">"cache"</span><span class="p">),</span> + <span class="p">]:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">error_string</span> <span class="ow">in</span> <span class="n">path</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">path</span><span class="p">):</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">"binary_c"</span><span class="p">)</span> + <span class="k">return</span> <span class="kc">None</span></div> + +<div class="viewcode-block" id="cache.NullCache"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache">[docs]</a> <span class="k">class</span> <span class="nc">NullCache</span><span class="p">(</span><span class="n">cachetools</span><span class="o">.</span><span class="n">Cache</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> A cachetools cache object that does as little as possible and never matches.</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the spacing_functions class</span> +<span class="sd"> </span> +<span class="sd"> TODO: is this class necesarry to be defined *within* the cache class? can't it just be outside?</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="kc">None</span> + +<div class="viewcode-block" id="cache.NullCache.popitem"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.popitem">[docs]</a> <span class="k">def</span> <span class="nf">popitem</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> pop function placeholder</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="c1"># do nothing</span></div> + +<div class="viewcode-block" id="cache.NullCache.__getitem__"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__getitem__">[docs]</a> <span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> getter function placeholder</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="fm">__missing__</span><span class="p">(</span><span class="n">key</span><span class="p">)</span></div> + +<div class="viewcode-block" id="cache.NullCache.__setitem__"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__setitem__">[docs]</a> <span class="k">def</span> <span class="fm">__setitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Setter function placeholder</span> +<span class="sd"> """</span> + + <span class="k">return</span></div> + +<div class="viewcode-block" id="cache.NullCache.__delitem__"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__delitem__">[docs]</a> <span class="k">def</span> <span class="fm">__delitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> deleter function placeholder</span> +<span class="sd"> """</span> + + <span class="k">return</span></div></div> + +<div class="viewcode-block" id="cache.setup_function_cache"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.setup_function_cache">[docs]</a> <span class="k">def</span> <span class="nf">setup_function_cache</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">vb</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cachetype</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to wrap binary_c-python's functions in function cache.</span> + +<span class="sd"> The functions listed in self.grid_options['function_cache_functions'] are</span> +<span class="sd"> given caches of size self.grid_options['function_cache_size'][func]</span> + +<span class="sd"> Args: None</span> +<span class="sd"> """</span> + + <span class="c1"># add our custom NullCache to the cachetools selection</span> + <span class="nb">setattr</span><span class="p">(</span><span class="n">cachetools</span><span class="p">,</span> <span class="s2">"NullCache"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">NullCache</span><span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache"</span><span class="p">]:</span> + <span class="c1"># no function cache: set all to NullCache</span> + <span class="c1"># TODO: This cachetype(Nullcache) is wrong.</span> + <span class="k">for</span> <span class="n">func</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_functions"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="bp">self</span><span class="o">.</span><span class="n">function_cache</span><span class="p">[</span><span class="n">func</span><span class="p">]</span> <span class="o">=</span> <span class="n">cachetype</span><span class="p">(</span><span class="n">NullCache</span><span class="p">)</span> + + <span class="k">for</span> <span class="n">func</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_functions"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> + <span class="p">(</span><span class="n">maxsize</span><span class="p">,</span> <span class="n">cachetype</span><span class="p">,</span> <span class="n">testargs</span><span class="p">)</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"function_cache_functions"</span> + <span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">func</span><span class="p">)</span> + + <span class="c1"># which cache should we use?</span> + <span class="k">if</span> <span class="n">cachetype</span><span class="p">:</span> + <span class="c1"># use type passed in, if given</span> + <span class="n">usecachetype</span> <span class="o">=</span> <span class="n">cachetype</span> + <span class="k">elif</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache"</span><span class="p">]:</span> + <span class="c1"># function cache is disabled, use NoCache</span> + <span class="n">usecachetype</span> <span class="o">=</span> <span class="s2">"NoCache"</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="n">cachetype</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="c1"># use the default type</span> + <span class="n">usecachetype</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_default_type"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># use type passed in</span> + <span class="n">usecachetype</span> <span class="o">=</span> <span class="n">cachetype</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Setup cache for func </span><span class="si">{func}</span><span class="s2"> : maxsize=</span><span class="si">{maxsize}</span><span class="s2">, cachetype=</span><span class="si">{cachetype}</span><span class="s2">, testargs=</span><span class="si">{testargs}</span><span class="s2">-> use </span><span class="si">{usecachetype}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">func</span><span class="o">=</span><span class="n">func</span><span class="p">,</span> + <span class="n">maxsize</span><span class="o">=</span><span class="n">maxsize</span><span class="p">,</span> + <span class="n">cachetype</span><span class="o">=</span><span class="n">cachetype</span><span class="p">,</span> + <span class="n">testargs</span><span class="o">=</span><span class="n">testargs</span><span class="p">,</span> + <span class="n">usecachetype</span><span class="o">=</span><span class="n">usecachetype</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">usecachetype</span> <span class="o">==</span> <span class="s2">"TTLCache"</span><span class="p">:</span> + <span class="n">extra_cacheargs</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_TTL"</span><span class="p">]]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">extra_cacheargs</span> <span class="o">=</span> <span class="p">[]</span> + + <span class="c1"># detect if the function is already wrapped</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">func</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</span><span class="p">)</span> + <span class="n">modulename</span> <span class="o">=</span> <span class="s2">"binarycpython.utils.population_extensions."</span> <span class="o">+</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">module</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">import_module</span><span class="p">(</span><span class="n">modulename</span><span class="p">)</span> + <span class="n">_method</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="s2">"module.</span><span class="si">{}</span><span class="s2">.</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span> <span class="c1"># TODO: we can do this differently with some .get call instead of eval</span> + <span class="n">_wrapped</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">_method</span><span class="p">,</span> <span class="s2">"__wrapped__"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> + + <span class="c1"># if function is wrapped...</span> + <span class="k">if</span> <span class="n">_wrapped</span> <span class="ow">and</span> <span class="nb">id</span><span class="p">(</span><span class="n">_method</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">id</span><span class="p">(</span><span class="n">_wrapped</span><span class="p">):</span> + <span class="c1"># save the wrapped function (this calls the cache)</span> + <span class="k">if</span> <span class="n">func</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cached_function_cache</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">cached_function_cache</span><span class="p">[</span><span class="n">func</span><span class="p">]</span> <span class="o">=</span> <span class="n">_method</span> + <span class="bp">self</span><span class="o">.</span><span class="n">original_function_cache</span><span class="p">[</span><span class="n">func</span><span class="p">]</span> <span class="o">=</span> <span class="n">_wrapped</span> + + <span class="k">if</span> <span class="n">usecachetype</span> <span class="o">==</span> <span class="s2">"NoCache"</span><span class="p">:</span> + <span class="c1"># unwrap if we're after NoCache</span> + <span class="n">_code</span> <span class="o">=</span> <span class="s2">"module.</span><span class="si">{}</span><span class="s2">.</span><span class="si">{}</span><span class="s2"> = _wrapped"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> + <span class="n">exec</span><span class="p">(</span><span class="n">_code</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># function isn't wrapped, which means it was previously</span> + <span class="c1"># unwrapped, so rewrap it if not using NoCache</span> + <span class="k">if</span> <span class="n">usecachetype</span> <span class="o">!=</span> <span class="s2">"NoCache"</span> <span class="ow">and</span> <span class="n">func</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">cached_function_cache</span><span class="p">:</span> + <span class="n">_code</span> <span class="o">=</span> <span class="s1">'module.</span><span class="si">{}</span><span class="s1">.</span><span class="si">{}</span><span class="s1"> = self.cached_function_cache["</span><span class="si">{}</span><span class="s1">"]'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">func</span> + <span class="p">)</span> + <span class="n">exec</span><span class="p">(</span><span class="n">_code</span><span class="p">)</span> + + <span class="c1"># check we're not still wrapped</span> + <span class="n">_method</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="s2">"module"</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s2">"."</span> <span class="o">+</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> + <span class="n">_wrapped</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">_method</span><span class="p">,</span> <span class="s2">"__wrapped__"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> + + <span class="c1"># if NoCache (explicity use no cache), just use NullCache</span> + <span class="c1"># (it's never actually set)</span> + <span class="k">if</span> <span class="n">usecachetype</span> <span class="o">==</span> <span class="s2">"NoCache"</span><span class="p">:</span> + <span class="n">cachetools_func</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">cachetools</span><span class="p">,</span> <span class="s2">"NullCache"</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">cachetools_func</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">cachetools</span><span class="p">,</span> <span class="n">usecachetype</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">maxsize</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">maxsize</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_default_maxsize"</span><span class="p">]</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Make function cache for func </span><span class="si">{func}</span><span class="s2">, maxsize </span><span class="si">{maxsize}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">func</span><span class="o">=</span><span class="n">func</span><span class="p">,</span> <span class="n">maxsize</span><span class="o">=</span><span class="n">maxsize</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1"># set up cache function args</span> + <span class="k">if</span> <span class="n">maxsize</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="mi">2</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="n">maxsize</span><span class="p">]</span> + <span class="n">args</span> <span class="o">+=</span> <span class="n">extra_cacheargs</span> + + <span class="c1"># clear any existing cache</span> + <span class="k">if</span> <span class="n">func</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="n">func</span><span class="p">]</span><span class="o">.</span><span class="n">cache_clear</span><span class="p">()</span> + <span class="k">except</span><span class="p">:</span> + <span class="k">pass</span> + <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="n">func</span><span class="p">]</span> + + <span class="c1"># set up new cache using the appropriate cachetools function</span> + <span class="k">if</span> <span class="n">usecachetype</span> <span class="o">!=</span> <span class="s2">"NoCache"</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="n">func</span><span class="p">]</span> <span class="o">=</span> <span class="n">cachetools_func</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span></div> + +<div class="viewcode-block" id="cache.test_caches"><a class="viewcode-back" href="../../../../population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.test_caches">[docs]</a> <span class="k">def</span> <span class="nf">test_caches</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dt</span><span class="o">=</span><span class="mf">5.0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to test cache speeds of the functions that binary_c-python automatically caches.</span> + +<span class="sd"> Args:</span> +<span class="sd"> dt (default 5) in seconds the length of each test. Long is more accurate, but takes longer.</span> +<span class="sd"> """</span> + + <span class="c1"># loop lists</span> + <span class="n">cachetypes</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"NoCache"</span><span class="p">,</span> <span class="s2">"NullCache"</span><span class="p">,</span> <span class="s2">"FIFOCache"</span><span class="p">,</span> <span class="s2">"LRUCache"</span><span class="p">,</span> <span class="s2">"TTLCache"</span><span class="p">)</span> + <span class="n">functions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_functions"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">maxsizes</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">16</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">64</span><span class="p">,</span> <span class="mi">128</span><span class="p">,</span> <span class="mi">256</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span> + <span class="k">for</span> <span class="n">n</span><span class="p">,</span> <span class="n">func</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">functions</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Cache speed test of function </span><span class="si">{func}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="n">func</span><span class="p">))</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{:18s}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="s2">""</span><span class="p">),</span> <span class="n">end</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span> + <span class="k">for</span> <span class="n">x</span><span class="p">,</span> <span class="n">maxsize</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">maxsizes</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{:>9s}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">maxsize</span><span class="p">)),</span> <span class="n">end</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span> + + <span class="n">best</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">best_type</span> <span class="o">=</span> <span class="kc">None</span> + <span class="n">best_maxsize</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">for</span> <span class="n">y</span><span class="p">,</span> <span class="nb">type</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">cachetypes</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{:18s}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">type</span><span class="p">),</span> <span class="n">end</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"function_cache_default_type"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">type</span> + <span class="bp">self</span><span class="o">.</span><span class="n">setup_function_cache</span><span class="p">()</span> + <span class="p">(</span><span class="n">maxsize</span><span class="p">,</span> <span class="n">cachetype</span><span class="p">,</span> <span class="n">testargs</span><span class="p">)</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"function_cache_functions"</span> + <span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">func</span><span class="p">)</span> + + <span class="c1"># TODO: Make this part better: needs to be able to handle any depth</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">func</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</span><span class="p">)</span> + <span class="n">modulename</span> <span class="o">=</span> <span class="s2">"binarycpython.utils.population_extensions."</span> <span class="o">+</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">module</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">import_module</span><span class="p">(</span><span class="n">modulename</span><span class="p">)</span> + <span class="n">_method</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="s2">"module.</span><span class="si">{}</span><span class="s2">.</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span> + + <span class="k">if</span> <span class="n">testargs</span><span class="p">:</span> + <span class="k">def</span> <span class="nf">_func_wrap</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> wrap to return args and kwargs</span> +<span class="sd"> </span> +<span class="sd"> TODO: i think this function can be defined elsewhere</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">)</span> + + <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="s2">"_func_wrap(</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">testargs</span><span class="p">))</span> + <span class="k">for</span> <span class="n">x</span><span class="p">,</span> <span class="n">maxsize</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">maxsizes</span><span class="p">):</span> + <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"NoCache"</span> <span class="ow">and</span> <span class="n">maxsize</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="k">continue</span> + + <span class="c1"># redirect stdout to prevent lots of output</span> + <span class="k">with</span> <span class="n">contextlib</span><span class="o">.</span><span class="n">redirect_stdout</span><span class="p">(</span><span class="kc">None</span><span class="p">):</span> + + <span class="c1"># loop for dt seconds</span> + <span class="n">tfin</span> <span class="o">=</span> <span class="n">dt</span> <span class="o">+</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> + <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">try</span><span class="p">:</span> + <span class="k">while</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o"><</span> <span class="n">tfin</span><span class="p">:</span> + <span class="n">_method</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="c1"># TODO: specify the exception</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Cache call failed:"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">count</span> <span class="o"><</span> <span class="mi">99999</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{:9d}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">count</span><span class="p">),</span> <span class="n">end</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{:9.2e}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">count</span><span class="p">)),</span> <span class="n">end</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">count</span> <span class="o">></span> <span class="n">best</span><span class="p">:</span> + <span class="n">best</span> <span class="o">=</span> <span class="n">count</span> + <span class="n">best_type</span> <span class="o">=</span> <span class="nb">type</span> + <span class="n">best_maxsize</span> <span class="o">=</span> <span class="n">maxsize</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Best cache type </span><span class="si">{type}</span><span class="s2"> with maxsize </span><span class="si">{maxsize}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">type</span><span class="o">=</span><span class="n">best_type</span><span class="p">,</span> <span class="n">maxsize</span><span class="o">=</span><span class="n">best_maxsize</span> + <span class="p">)</span> + <span class="p">)</span></div> + + + <span class="sd">"""</span> +<span class="sd">Cache speed test of function distribution_functions.powerlaw_constant</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 6.28e+07</span> +<span class="sd">NullCache 6.39e+07 6.40e+07 6.41e+07 6.39e+07 6.44e+07 6.43e+07 6.37e+07 6.40e+07 6.38e+07 6.40e+07</span> +<span class="sd">FIFOCache 6.41e+07 6.37e+07 6.40e+07 6.39e+07 6.40e+07 6.37e+07 6.41e+07 6.40e+07 6.41e+07 6.40e+07</span> +<span class="sd">LRUCache 6.42e+07 6.41e+07 6.42e+07 6.41e+07 6.38e+07 6.43e+07 6.41e+07 6.43e+07 6.40e+07 6.41e+07</span> +<span class="sd">TTLCache 6.41e+07 6.35e+07 6.37e+07 6.39e+07 6.37e+07 6.42e+07 6.39e+07 6.38e+07 6.37e+07 6.38e+07</span> +<span class="sd">Best cache type NullCache with maxsize 8</span> + +<span class="sd">Cache speed test of function distribution_functions.calculate_constants_three_part_powerlaw</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 1.44e+07</span> +<span class="sd">NullCache 9.13e+06 9.18e+06 9.20e+06 9.21e+06 9.20e+06 9.12e+06 9.18e+06 9.18e+06 9.15e+06 9.12e+06</span> +<span class="sd">FIFOCache 2.53e+07 2.52e+07 2.51e+07 2.50e+07 2.51e+07 2.52e+07 2.52e+07 2.52e+07 2.52e+07 2.51e+07</span> +<span class="sd">LRUCache 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07 1.62e+07</span> +<span class="sd">TTLCache 1.43e+07 1.43e+07 1.43e+07 1.43e+07 1.43e+07 1.44e+07 1.42e+07 1.43e+07 1.43e+07 1.43e+07</span> +<span class="sd">Best cache type FIFOCache with maxsize 0</span> + +<span class="sd">Cache speed test of function distribution_functions.gaussian_normalizing_const</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 64183</span> +<span class="sd">NullCache 64340 64339 64544 64260 64491 64382 64400 63974 63954 64338</span> +<span class="sd">FIFOCache 2.62e+07 2.62e+07 2.62e+07 2.61e+07 2.61e+07 2.59e+07 2.61e+07 2.59e+07 2.57e+07 2.59e+07</span> +<span class="sd">LRUCache 1.66e+07 1.66e+07 1.65e+07 1.66e+07 1.65e+07 1.65e+07 1.64e+07 1.65e+07 1.64e+07 1.65e+07</span> +<span class="sd">TTLCache 1.42e+07 1.44e+07 1.42e+07 1.44e+07 1.43e+07 1.43e+07 1.42e+07 1.44e+07 1.42e+07 1.44e+07</span> +<span class="sd">Best cache type FIFOCache with maxsize 1</span> + +<span class="sd">Cache speed test of function spacing_functions.const_linear</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 1.22e+06</span> +<span class="sd">NullCache 1.05e+06 1.05e+06 1.06e+06 1.05e+06 1.05e+06 1.06e+06 1.05e+06 1.05e+06 1.05e+06 1.05e+06</span> +<span class="sd">FIFOCache 2.85e+07 2.85e+07 2.86e+07 2.85e+07 2.84e+07 2.85e+07 2.84e+07 2.84e+07 2.85e+07 2.81e+07</span> +<span class="sd">LRUCache 1.77e+07 1.79e+07 1.73e+07 1.73e+07 1.76e+07 1.79e+07 1.76e+07 1.74e+07 1.74e+07 1.72e+07</span> +<span class="sd">TTLCache 1.46e+07 1.49e+07 1.50e+07 1.53e+07 1.51e+07 1.53e+07 1.52e+07 1.51e+07 1.47e+07 1.50e+07</span> +<span class="sd">Best cache type FIFOCache with maxsize 2</span> + +<span class="sd">Cache speed test of function spacing_functions.const_int</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 4.23e+07</span> +<span class="sd">NullCache 1.65e+07 1.66e+07 1.65e+07 1.64e+07 1.66e+07 1.65e+07 1.59e+07 1.59e+07 1.65e+07 1.64e+07</span> +<span class="sd">FIFOCache 2.86e+07 2.86e+07 2.87e+07 2.86e+07 2.84e+07 2.86e+07 2.81e+07 2.79e+07 2.78e+07 2.85e+07</span> +<span class="sd">LRUCache 1.78e+07 1.78e+07 1.77e+07 1.75e+07 1.77e+07 1.78e+07 1.78e+07 1.78e+07 1.74e+07 1.75e+07</span> +<span class="sd">TTLCache 1.55e+07 1.54e+07 1.55e+07 1.54e+07 1.55e+07 1.49e+07 1.52e+07 1.51e+07 1.52e+07 1.54e+07</span> +<span class="sd">Best cache type NoCache with maxsize 0</span> + +<span class="sd">Cache speed test of function spacing_functions.const_ranges</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 2.54e+05</span> +<span class="sd">NullCache 2.25e+05 2.25e+05 2.24e+05 2.25e+05 2.25e+05 2.25e+05 2.25e+05 2.26e+05 2.25e+05 2.26e+05</span> +<span class="sd">FIFOCache 2.58e+07 2.55e+07 2.53e+07 2.54e+07 2.56e+07 2.57e+07 2.56e+07 2.57e+07 2.58e+07 2.58e+07</span> +<span class="sd">LRUCache 1.62e+07 1.63e+07 1.62e+07 1.62e+07 1.61e+07 1.62e+07 1.62e+07 1.62e+07 1.61e+07 1.63e+07</span> +<span class="sd">TTLCache 1.41e+07 1.43e+07 1.42e+07 1.42e+07 1.40e+07 1.42e+07 1.42e+07 1.43e+07 1.40e+07 1.43e+07</span> +<span class="sd">Best cache type FIFOCache with maxsize 128</span> + +<span class="sd">Cache speed test of function spacing_functions.gaussian_zoom</span> +<span class="sd"> 0 1 2 4 8 16 32 64 128 256</span> +<span class="sd">NoCache 24703</span> +<span class="sd">NullCache 24872 24935 24927 24896 24968 24964 24882 24840 24873 24913</span> +<span class="sd">FIFOCache 2.54e+07 2.54e+07 2.54e+07 2.54e+07 2.53e+07 2.52e+07 2.53e+07 2.51e+07 2.52e+07 2.52e+07</span> +<span class="sd">LRUCache 1.63e+07 1.63e+07 1.63e+07 1.64e+07 1.63e+07 1.64e+07 1.63e+07 1.63e+07 1.63e+07 1.63e+07</span> +<span class="sd">TTLCache 1.43e+07 1.43e+07 1.42e+07 1.42e+07 1.43e+07 1.42e+07 1.43e+07 1.43e+07 1.43e+07 1.43e+07</span> +<span class="sd">Best cache type FIFOCache with maxsize 0</span> +<span class="sd"> """</span></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/condor.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/condor.html new file mode 100644 index 0000000000000000000000000000000000000000..87561c0e72fc803413f598616687f0a37828916d --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/condor.html @@ -0,0 +1,662 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.condor — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.condor</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.condor</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">The class extension for the population object that contains the Condor functionality</span> + +<span class="sd">TODO: there are many uses of $<variable name> in this file but this is not perl and we should replace them by actual format placeholders</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">import</span> <span class="nn">re</span> +<span class="kn">import</span> <span class="nn">sys</span> +<span class="kn">import</span> <span class="nn">stat</span> +<span class="kn">import</span> <span class="nn">time</span> +<span class="kn">import</span> <span class="nn">subprocess</span> + +<span class="kn">import</span> <span class="nn">pathlib</span> + +<span class="kn">import</span> <span class="nn">datasize</span> +<span class="kn">import</span> <span class="nn">lib_programname</span> + +<div class="viewcode-block" id="condor"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor">[docs]</a><span class="k">class</span> <span class="nc">condor</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension for the Population class containing the code for Condor grid runs</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the condor class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="condor.condorID"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condorID">[docs]</a> <span class="k">def</span> <span class="nf">condorID</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ClusterID</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return a Condor job ID. The ClusterID and Process passed in are used if given, otherwise we default to the condor_ClusterID and condor_Process in grid_options.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">ClusterID</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">ClusterID</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">Process</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">Process</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_Process"</span><span class="p">]</span> + <span class="k">return</span> <span class="s2">"</span><span class="si">{ClusterID}</span><span class="s2">.</span><span class="si">{Process}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ClusterID</span><span class="o">=</span><span class="n">ClusterID</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="n">Process</span><span class="p">)</span></div> + +<div class="viewcode-block" id="condor.condorpath"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condorpath">[docs]</a> <span class="k">def</span> <span class="nf">condorpath</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the full condor directory path.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">condor_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">condor_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">condor_dir</span><span class="p">,</span> <span class="n">path</span><span class="p">))</span></div> + +<div class="viewcode-block" id="condor.condor_status_file"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_status_file">[docs]</a> <span class="k">def</span> <span class="nf">condor_status_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ClusterID</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return the condor status file corresponding to the ClusterID and Process, which default to grid_options condor_ClusterID and condor_Process, respectively.</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="n">condor_dir</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">condorID</span><span class="p">(</span><span class="n">ClusterID</span><span class="p">,</span> <span class="n">Process</span><span class="p">)</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="condor.condor_check_requirements"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_check_requirements">[docs]</a> <span class="k">def</span> <span class="nf">condor_check_requirements</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to check whether the condor parameters in grid_options have been set appropriately.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> <span class="p">(</span> + <span class="kc">False</span><span class="p">,</span> + <span class="s2">"You have set condor=</span><span class="si">{condor}</span><span class="s2"> but not set condor_dir (which is </span><span class="si">{condor_dir}</span><span class="s2">). Please set it and try again."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">condor</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">],</span> + <span class="n">condor_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> + <span class="p">),</span> + <span class="p">)</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span></div> + +<div class="viewcode-block" id="condor.condor_dirs"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_dirs">[docs]</a> <span class="k">def</span> <span class="nf">condor_dirs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Directories associated specifically with this condor job.</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span></div> + +<div class="viewcode-block" id="condor.set_condor_status"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.set_condor_status">[docs]</a> <span class="k">def</span> <span class="nf">set_condor_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Set the condor status corresponing to the self object, which should have condor_ClusterID and condor_Process set.</span> + +<span class="sd"> Args:</span> +<span class="sd"> string : the status string to be set</span> +<span class="sd"> dir : the directory in which the status directory is held. If not set, this defaults to the HPC directory (e.g. slurm_dir or condor_dir).</span> +<span class="sd"> """</span> + <span class="c1"># save condor ClusterID to file</span> + + <span class="k">if</span> <span class="n">condor_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">condor_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + + <span class="n">idfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">condor_dir</span><span class="p">,</span> <span class="s2">"ClusterID"</span><span class="p">)</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">idfile</span><span class="p">):</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">idfile</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">fClusterID</span><span class="p">:</span> + <span class="n">fClusterID</span><span class="o">.</span><span class="n">write</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{ClusterID}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">ClusterID</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">fClusterID</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">idfile</span><span class="p">)</span> + + <span class="c1"># save condor status</span> + <span class="n">file</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condor_status_file</span><span class="p">(</span><span class="n">condor_dir</span><span class="o">=</span><span class="n">condor_dir</span><span class="p">)</span> + <span class="k">if</span> <span class="n">file</span><span class="p">:</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">file</span><span class="p">)</span></div> + +<div class="viewcode-block" id="condor.get_condor_status"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.get_condor_status">[docs]</a> <span class="k">def</span> <span class="nf">get_condor_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ClusterID</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Get and return the condor status corresponing to the self object, or ClusterID.Process if they are passed in. If no status is found, returns an empty string..</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">ClusterID</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">ClusterID</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">Process</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">Process</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_Process"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">ClusterID</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">Process</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> <span class="kc">None</span> + <span class="c1"># print("get_condor_status {}.{}".format(ClusterID,Process))</span> + + <span class="k">try</span><span class="p">:</span> + <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">condor_status_file</span><span class="p">(</span><span class="n">condor_dir</span><span class="o">=</span><span class="n">condor_dir</span><span class="p">,</span> <span class="n">ClusterID</span><span class="o">=</span><span class="n">ClusterID</span><span class="p">,</span> <span class="n">Process</span><span class="o">=</span><span class="n">Process</span><span class="p">)</span> + <span class="p">)</span> + <span class="c1"># print("path={}".format(path))</span> + <span class="c1"># print("size={}".format(path.stat().st_size))</span> + <span class="k">if</span> <span class="n">path</span><span class="p">:</span> + <span class="n">s</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">read_text</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="c1"># print("contains {}".format(s))</span> + <span class="k">return</span> <span class="n">s</span> + <span class="c1"># print("path empty")</span> + <span class="k">return</span> <span class="s2">""</span> + + <span class="c1"># NOTE: What is the actual exception that can occur here?</span> + <span class="c1"># TODO: We should specify that exception</span> + <span class="k">except</span><span class="p">:</span> + <span class="c1"># print("read failed")</span> + <span class="k">return</span> <span class="s2">""</span></div> + +<div class="viewcode-block" id="condor.condor_outfile"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_outfile">[docs]</a> <span class="k">def</span> <span class="nf">condor_outfile</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> return a standard filename for the condor chunk files</span> +<span class="sd"> """</span> + <span class="n">file</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{id}</span><span class="s2">.gz"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">condorID</span><span class="p">())</span> + <span class="k">if</span> <span class="n">condor_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">condor_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">condor_dir</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span></div> + +<div class="viewcode-block" id="condor.make_condor_dirs"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.make_condor_dirs">[docs]</a> <span class="k">def</span> <span class="nf">make_condor_dirs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to make the condor directories</span> +<span class="sd"> """</span> + + <span class="c1"># make the condor directories</span> + <span class="k">if</span> <span class="n">condor_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">condor_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">condor_dir</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"You must set self.grid_options['condor_dir'] (or pass condor_dir=whatever to make_condor_dirs()) to a directory which we can use to set up binary_c-python's Condor files. This should be unique to your set of grids."</span> + <span class="p">)</span> + <span class="n">os</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span> + + <span class="c1"># make a list of directories, these contain the various condor</span> + <span class="c1"># output, status files, etc.</span> + <span class="n">dirs</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"stdout"</span><span class="p">,</span> <span class="s2">"stderr"</span><span class="p">,</span> <span class="s2">"log"</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">,</span> <span class="s2">"status"</span><span class="p">,</span> <span class="s2">"snapshots"</span><span class="p">]:</span> + <span class="n">dirs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="n">condor_dir</span><span class="p">))</span> + + <span class="c1"># make the directories: we do not allow these to already exist</span> + <span class="c1"># as the condor directory should be a fresh location for each set of jobs</span> + <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">dirs</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="n">condor_dir</span><span class="p">))</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span> + <span class="n">exist_ok</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">parents</span><span class="o">=</span><span class="kc">True</span> + <span class="p">)</span> + <span class="c1"># TODO: specify the actual exception</span> + <span class="c1"># TODO: is this try-except necessary? Especially having the code fail here, instead of earlier, if the directories exist already. Otherwise we can also just do exist_ok=True?</span> + <span class="k">except</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Tried to make the directory </span><span class="si">{d}</span><span class="s2"> but it already exists. When you launch a set of binary_c jobs on Condor, you need to set your condor_dir to be a fresh directory with no contents."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">d</span><span class="o">=</span><span class="n">d</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># check that they have been made and exist: we need this</span> + <span class="c1"># because on network mounts (NFS) there's often a delay between the mkdir</span> + <span class="c1"># above and the actual directory being made. This shouldn't be too long...</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">True</span> + <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">count_warn</span> <span class="o">=</span> <span class="mi">10</span> + <span class="k">while</span> <span class="n">fail</span> <span class="ow">is</span> <span class="kc">True</span><span class="p">:</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">False</span> + <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="k">if</span> <span class="n">count</span> <span class="o">></span> <span class="n">count_warn</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Warning: Have been waiting about </span><span class="si">{}</span><span class="s2"> seconds for Condor directories to be made, there seems to be significant delay..."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">count</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">dirs</span><span class="p">:</span> + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">True</span> + <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + <span class="k">break</span></div> + +<div class="viewcode-block" id="condor.condor_grid"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_grid">[docs]</a> <span class="k">def</span> <span class="nf">condor_grid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> function to be called when running grids when grid_options['condor']>=1</span> + +<span class="sd"> if grid_options['condor']==1, we set up the condor script and launch the jobs, then return True to exit.</span> +<span class="sd"> if grid_options['condor']==2, we run the stars, which means we return False to continue.</span> +<span class="sd"> if grid_options['condor']==3, we are being called from the jobs to run the grids, return False to continue.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> + <span class="c1"># joining : set the evolution type to "join"</span> + <span class="c1">#</span> + <span class="c1"># return False to continue</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"join"</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> + <span class="c1"># run a grid of stars only, leaving the results</span> + <span class="c1"># in the appropriate outfile</span> + <span class="c1">#</span> + <span class="c1"># return False to actually run the stars</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"grid"</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="c1"># if condor=1, we should have no evolution type, we</span> + <span class="c1"># set up the Condor scripts and get them evolving</span> + <span class="c1"># in a Condor queue</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># make dirs</span> + <span class="bp">self</span><span class="o">.</span><span class="n">make_condor_dirs</span><span class="p">()</span> + + <span class="c1"># check we're not using too much RAM</span> + <span class="k">if</span> <span class="n">datasize</span><span class="o">.</span><span class="n">DataSize</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_memory"</span><span class="p">]</span> + <span class="p">)</span> <span class="o">></span> <span class="n">datasize</span><span class="o">.</span><span class="n">DataSize</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_warn_max_memory"</span><span class="p">]):</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"WARNING: you want to use </span><span class="si">{}</span><span class="s2"> MB of RAM : this is unlikely to be correct. If you believe it is, set condor_warn_max_memory to something very large (it is currently </span><span class="si">{}</span><span class="s2"> MB)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_memory"</span><span class="p">],</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_warn_max_memory"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># get job id (might be passed in)</span> + <span class="n">ClusterID</span> <span class="o">=</span> <span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> <span class="o">!=</span> <span class="s2">""</span> + <span class="k">else</span> <span class="s2">"$ClusterID"</span> + <span class="p">)</span> + + <span class="c1"># get job array index</span> + <span class="n">Process</span> <span class="o">=</span> <span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_Process"</span><span class="p">]</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_Process"</span><span class="p">]</span> <span class="o">!=</span> <span class="s2">""</span> + <span class="k">else</span> <span class="s2">"$Process"</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_njobs"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"binary_c-python Condor : You must set grid_option condor_njobs to be non-zero"</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># find the path to the Python script that we are running</span> + <span class="n">pyscriptpath</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">lib_programname</span><span class="o">.</span><span class="n">get_path_executed_script</span><span class="p">())</span> + + <span class="c1"># set the condor initial dir to be our current working directory</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_initial_dir"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_initial_dir"</span><span class="p">]</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">()</span> + + <span class="c1"># build the grid command</span> + <span class="n">grid_command</span> <span class="o">=</span> <span class="p">(</span> + <span class="p">[</span> + <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_env"</span><span class="p">]),</span> + <span class="n">sys</span><span class="o">.</span><span class="n">executable</span><span class="p">,</span> + <span class="n">pyscriptpath</span><span class="p">,</span> + <span class="p">]</span> + <span class="o">+</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> + <span class="o">+</span> <span class="p">[</span> + <span class="s2">"start_at=$Process"</span><span class="p">,</span> <span class="c1"># Process is 0,1,2... which is what we want</span> + <span class="s2">"modulo="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_njobs"</span><span class="p">]),</span> + <span class="s2">"condor_njobs="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_njobs"</span><span class="p">]),</span> + <span class="s2">"condor_dir="</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> + <span class="s2">"verbosity="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">]),</span> + <span class="s2">"num_cores="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"num_processes"</span><span class="p">]),</span> + <span class="p">]</span> + <span class="p">)</span> + + <span class="n">grid_command</span> <span class="o">=</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">grid_command</span><span class="p">)</span> + + <span class="c1"># make condor script paths</span> + <span class="n">submit_script_path</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="s2">"condor_submit_script"</span><span class="p">)</span> + <span class="n">job_script_path</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">condorpath</span><span class="p">(</span><span class="s2">"condor_job_script"</span><span class="p">)</span> + + <span class="c1"># open the files</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">submit_script</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">submit_script_path</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Could not open Condor script at </span><span class="si">{path}</span><span class="s2"> for writing: please check you have set </span><span class="si">{condor_dir}</span><span class="s2"> correctly (it is currently </span><span class="si">{condor_dir}</span><span class="s2"> and can write to this directory."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">submit_script_path</span><span class="p">,</span> + <span class="n">condor_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">job_script</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">job_script_path</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Could not open Condor script at </span><span class="si">{path}</span><span class="s2"> for writing: please check you have set </span><span class="si">{condor_dir}</span><span class="s2"> correctly (it is currently </span><span class="si">{condor_dir}</span><span class="s2"> and can write to this directory."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">job_script_path</span><span class="p">,</span> <span class="n">condor_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1">############################################################</span> + <span class="c1"># The condor job script calls your binary_c-pthyon script</span> + <span class="c1">############################################################</span> + <span class="n">condor_job_script</span> <span class="o">=</span> <span class="s2">"""#!</span><span class="si">{bash}</span><span class="s2"></span> +<span class="s2">echo "Condor Job Args: $@"</span> + +<span class="s2"># first two arguments are ClusterID and Process</span> +<span class="s2">export ClusterID=$1</span> +<span class="s2">export Process=$2</span> +<span class="s2">shift 2</span> + +<span class="s2">echo "Job ClusterID $ClusterID Process $Process"</span> + +<span class="s2"># Set binary_c startup conditions</span> +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_CMD_LINE=</span><span class="si">{cmdline}</span><span class="s2"></span> +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_WD=`</span><span class="si">{pwd}</span><span class="s2">`</span> +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_SUBMISSION_TIME=`</span><span class="si">{date}</span><span class="s2">`</span> + +<span class="s2"># set status to </span><span class="se">\"</span><span class="s2">running</span><span class="se">\"</span><span class="s2"></span> +<span class="s2">echo </span><span class="se">\"</span><span class="s2">running</span><span class="se">\"</span><span class="s2"> > </span><span class="si">{condor_dir}</span><span class="s2">/status/$ClusterID.$ProcessID</span> + +<span class="s2"># make list of files which is checked for joining</span> +<span class="s2"># echo </span><span class="si">{condor_dir}</span><span class="s2">/results/$ClusterID.$Process.gz >> </span><span class="si">{condor_dir}</span><span class="s2">/results/$ClusterID.all</span> + +<span class="s2"># run grid of stars and, if this returns 0, set status to finished</span> +<span class="si">{grid_command}</span><span class="s2"> condor=2 evolution_type=grid condor_ClusterID=$ClusterID condor_Process=$Process save_population_object=</span><span class="si">{condor_dir}</span><span class="s2">/results/$ClusterID.$Process.gz && echo -n </span><span class="se">\"</span><span class="s2">finished</span><span class="se">\"</span><span class="s2"> > </span><span class="si">{condor_dir}</span><span class="s2">/status/$ClusterID.$ProcessID && echo """</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">bash</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_bash"</span><span class="p">],</span> + <span class="n">date</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_date"</span><span class="p">],</span> + <span class="n">pwd</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_pwd"</span><span class="p">],</span> + <span class="n">cmdline</span><span class="o">=</span><span class="nb">repr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"command_line"</span><span class="p">]),</span> + <span class="n">grid_command</span><span class="o">=</span><span class="n">grid_command</span><span class="p">,</span> + <span class="n">condor_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_postpone_join"</span><span class="p">]:</span> + <span class="n">joinfile</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{condor_dir}</span><span class="s2">/results/</span><span class="si">{ClusterID}</span><span class="s2">.all"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">condor_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> <span class="n">ClusterID</span><span class="o">=</span><span class="n">ClusterID</span> + <span class="p">)</span> + <span class="n">condor_job_script</span> <span class="o">+=</span> <span class="s2">"""&& echo </span><span class="se">\"</span><span class="s2">Checking if we can join...</span><span class="se">\"</span><span class="s2"> && echo && </span><span class="si">{grid_command}</span><span class="s2"> condor=3 evolution_type=join joinlist=</span><span class="si">{joinfile}</span><span class="s2"> condor_ClusterID=$ClusterID condor_Process=$Process</span> +<span class="s2"> """</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">bash</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_bash"</span><span class="p">],</span> + <span class="n">grid_command</span><span class="o">=</span><span class="n">grid_command</span><span class="p">,</span> + <span class="n">joinfile</span><span class="o">=</span><span class="n">joinfile</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1">############################################################</span> + <span class="c1"># The Condor submit script is sent to condor_submit</span> + <span class="c1"># In here we know $(Cluster) and $(Process) which identify</span> + <span class="c1"># each job</span> + <span class="c1">############################################################</span> + <span class="n">extra_settings</span> <span class="o">=</span> <span class="s2">""</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_extra_settings"</span><span class="p">]:</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_extra_settings"</span><span class="p">]:</span> + <span class="n">extra_settings</span> <span class="o">+=</span> <span class="s2">"</span><span class="si">{key}</span><span class="s2"> = </span><span class="si">{value}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">,</span> + <span class="n">value</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_extra_settings"</span><span class="p">][</span><span class="n">key</span><span class="p">],</span> + <span class="p">)</span> + + <span class="n">jobid</span> <span class="o">=</span> <span class="s2">"$(Cluster).$(Process)"</span> + <span class="n">condor_submit_script</span> <span class="o">=</span> <span class="s2">"""</span> +<span class="s2">executable = </span><span class="si">{usr_bin_env}</span><span class="s2"></span> +<span class="s2">arguments = </span><span class="si">{bash}</span><span class="s2"> </span><span class="si">{job_script_path}</span><span class="s2"> $(Cluster) $(Process)</span> +<span class="s2">universe = </span><span class="si">{universe}</span><span class="s2"></span> +<span class="s2">getenv = </span><span class="si">{getenv}</span><span class="s2"></span> +<span class="s2">initial_dir = </span><span class="si">{initial_dir}</span><span class="s2"></span> +<span class="s2">output = </span><span class="si">{outfile}</span><span class="s2"></span> +<span class="s2">error = </span><span class="si">{errfile}</span><span class="s2"></span> +<span class="s2">log = </span><span class="si">{logfile}</span><span class="s2"></span> +<span class="s2">stream_output = </span><span class="si">{stream_output}</span><span class="s2"></span> +<span class="s2">stream_error = </span><span class="si">{stream_error}</span><span class="s2"></span> +<span class="s2">request_memory = </span><span class="si">{request_memory}</span><span class="s2"></span> +<span class="s2">request_cpus = </span><span class="si">{request_cpus}</span><span class="s2"></span> +<span class="s2">should_transfer_files = </span><span class="si">{should_transfer_files}</span><span class="s2"></span> +<span class="s2">when_to_transfer_output = </span><span class="si">{when_to_transfer_output}</span><span class="s2"></span> +<span class="s2">requirements = </span><span class="si">{requirements}</span><span class="s2"></span> +<span class="s2">JobBatchName = </span><span class="si">{batchname}</span><span class="s2"></span> +<span class="s2">kill_sig = </span><span class="si">{kill_sig}</span><span class="s2"></span> +<span class="si">{extra_settings}</span><span class="s2"></span> +<span class="s2">queue </span><span class="si">{njobs}</span><span class="s2"></span> +<span class="s2"> """</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">usr_bin_env</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_env"</span><span class="p">],</span> + <span class="n">bash</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_bash"</span><span class="p">],</span> + <span class="n">job_script_path</span><span class="o">=</span><span class="n">job_script_path</span><span class="p">,</span> + <span class="n">universe</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_universe"</span><span class="p">],</span> + <span class="n">getenv</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_getenv"</span><span class="p">],</span> + <span class="n">initial_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_initial_dir"</span><span class="p">],</span> + <span class="n">outfile</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> <span class="s2">"stdout"</span><span class="p">,</span> <span class="n">jobid</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">errfile</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> <span class="s2">"stderr"</span><span class="p">,</span> <span class="n">jobid</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">logfile</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_dir"</span><span class="p">],</span> <span class="s2">"log"</span><span class="p">,</span> <span class="n">jobid</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">stream_output</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_stream_output"</span><span class="p">],</span> + <span class="n">stream_error</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_stream_error"</span><span class="p">],</span> + <span class="n">request_memory</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_memory"</span><span class="p">],</span> + <span class="n">request_cpus</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"num_processes"</span><span class="p">],</span> + <span class="n">should_transfer_files</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"condor_should_transfer_files"</span> + <span class="p">],</span> + <span class="n">when_to_transfer_output</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"condor_when_to_transfer_output"</span> + <span class="p">],</span> + <span class="n">requirements</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_requirements"</span><span class="p">],</span> + <span class="n">batchname</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_batchname"</span><span class="p">],</span> + <span class="n">kill_sig</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_kill_sig"</span><span class="p">],</span> + <span class="n">extra_settings</span><span class="o">=</span><span class="n">extra_settings</span><span class="p">,</span> + <span class="n">njobs</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_njobs"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="c1"># write the scripts, close them and make them executable by</span> + <span class="c1"># all (so the condor user can pick it up)</span> + <span class="k">for</span> <span class="n">file</span><span class="p">,</span> <span class="n">contents</span> <span class="ow">in</span> <span class="p">[</span> + <span class="p">(</span><span class="n">submit_script</span><span class="p">,</span> <span class="n">condor_submit_script</span><span class="p">),</span> + <span class="p">(</span><span class="n">job_script</span><span class="p">,</span> <span class="n">condor_job_script</span><span class="p">),</span> + <span class="p">]:</span> + <span class="n">path</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">name</span> + <span class="n">file</span><span class="o">.</span><span class="n">writelines</span><span class="p">(</span><span class="n">contents</span><span class="p">)</span> + <span class="n">file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="n">os</span><span class="o">.</span><span class="n">chmod</span><span class="p">(</span> + <span class="n">path</span><span class="p">,</span> + <span class="n">stat</span><span class="o">.</span><span class="n">S_IREAD</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IWRITE</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IEXEC</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IRGRP</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IXGRP</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IROTH</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IXOTH</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_postpone_submit"</span><span class="p">]:</span> + <span class="c1"># call sbatch to launch the condor jobs</span> + <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_submit"</span><span class="p">],</span> <span class="n">submit_script_path</span><span class="p">]</span> + <span class="k">with</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span> + <span class="n">cmd</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span> + <span class="p">)</span> <span class="k">as</span> <span class="n">pipes</span><span class="p">:</span> + <span class="n">std_out</span><span class="p">,</span> <span class="n">std_err</span> <span class="o">=</span> <span class="n">pipes</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span> + + <span class="k">if</span> <span class="n">pipes</span><span class="o">.</span><span class="n">returncode</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="c1"># an error happened!</span> + <span class="n">err_msg</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{red}{err}</span><span class="se">\n</span><span class="s2">Return Code: </span><span class="si">{code}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">err</span><span class="o">=</span><span class="n">std_err</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span> + <span class="n">code</span><span class="o">=</span><span class="n">pipes</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> + <span class="n">red</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"red"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="n">err_msg</span><span class="p">)</span> + + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">std_err</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{red}{err}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">red</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"red"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="n">err</span><span class="o">=</span><span class="n">std_err</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">),</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{yellow}{out}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">yellow</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"yellow"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="n">out</span><span class="o">=</span><span class="n">std_out</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">),</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># just say we would have (use this for testing)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Condor script is at </span><span class="si">{path}</span><span class="s2"> but has not been launched"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">submit_script_path</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1"># some messages to the user, then return</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_postpone_submit"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Condor script written, to </span><span class="si">{path}</span><span class="s2">, but launching the jobs with sbatch was postponed."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">submit_script_path</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Condor jobs launched."</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"All done in condor_grid()."</span><span class="p">)</span> + + <span class="c1"># return True so we exit immediately</span> + <span class="k">return</span> <span class="kc">True</span></div> + +<div class="viewcode-block" id="condor.condor_queue_stats"><a class="viewcode-back" href="../../../../population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_queue_stats">[docs]</a> <span class="k">def</span> <span class="nf">condor_queue_stats</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return condor queue statistics for this job</span> +<span class="sd"> """</span> + + <span class="n">_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"condor_ClusterID"</span><span class="p">]</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">_id</span><span class="p">:</span> + <span class="k">return</span> <span class="kc">None</span> + + <span class="n">cmd</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2"> </span><span class="si">{}</span><span class="s2"> 2>&1"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"/usr/bin/condor_q"</span><span class="p">,</span> <span class="n">_id</span> <span class="c1"># self.grid_options["condor_q"],</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Q cmd"</span><span class="p">,</span> <span class="n">cmd</span><span class="p">)</span> + + <span class="k">with</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">shell</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">)</span> <span class="k">as</span> <span class="n">subp</span><span class="p">:</span> + <span class="n">result</span> <span class="o">=</span> <span class="n">subp</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Q result "</span><span class="p">,</span> <span class="n">result</span><span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">result</span><span class="p">:</span> + <span class="k">return</span> <span class="kc">None</span> + + <span class="n">d</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="p">[</span> + <span class="s2">"jobs"</span><span class="p">,</span> + <span class="s2">"completed"</span><span class="p">,</span> + <span class="s2">"removed"</span><span class="p">,</span> + <span class="s2">"idle"</span><span class="p">,</span> + <span class="s2">"running"</span><span class="p">,</span> + <span class="s2">"held"</span><span class="p">,</span> + <span class="s2">"suspended"</span><span class="p">,</span> + <span class="p">]:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Q x "</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span> + <span class="n">m</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s2">"(\d+)\s+</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">result</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Q m "</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span> + <span class="k">if</span> <span class="n">m</span><span class="p">:</span> + <span class="n">d</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span><span class="s2">"Q d "</span><span class="p">,</span> <span class="n">d</span><span class="p">)</span> + <span class="k">return</span> <span class="n">d</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/dataIO.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/dataIO.html new file mode 100644 index 0000000000000000000000000000000000000000..2f907f7d5d4e745f8f11d40a1d7c5b1626b4cc68 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/dataIO.html @@ -0,0 +1,902 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.dataIO — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.dataIO</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.dataIO</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">File containing the class extension for the population object that contains data input-output (IO) functions</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">import</span> <span class="nn">bz2</span> +<span class="kn">import</span> <span class="nn">gzip</span> +<span class="kn">import</span> <span class="nn">copy</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">import</span> <span class="nn">time</span> +<span class="kn">import</span> <span class="nn">datetime</span> +<span class="kn">import</span> <span class="nn">subprocess</span> +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span> + +<span class="kn">import</span> <span class="nn">msgpack</span> +<span class="kn">import</span> <span class="nn">flufl.lock</span> +<span class="kn">import</span> <span class="nn">compress_pickle</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.ensemble</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">ensemble_file_type</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.dicts</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">merge_dicts</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">verbose_print</span><span class="p">,</span> + <span class="n">now</span><span class="p">,</span> +<span class="p">)</span> + + +<div class="viewcode-block" id="dataIO"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO">[docs]</a><span class="k">class</span> <span class="nc">dataIO</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Class extension for the population object that contains data input-output (IO) functions</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the spacing_functions class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="dataIO.dir_ok"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.dir_ok">[docs]</a> <span class="k">def</span> <span class="nf">dir_ok</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directory</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to test if we can read and write to a directory that must exist. Return True if all is ok, False otherwise.</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">directory</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">F_OK</span><span class="p">)</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">directory</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">R_OK</span> <span class="o">|</span> <span class="n">os</span><span class="o">.</span><span class="n">W_OK</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.save_population_object"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.save_population_object">[docs]</a> <span class="k">def</span> <span class="nf">save_population_object</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">population_object</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">confirmation</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s2">"gzip"</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Save pickled Population object to file at filename or, if filename is None, whatever is set at self.grid_options['save_population_object']</span> + +<span class="sd"> Args:</span> +<span class="sd"> population_object : the object to be saved to the file. If population_object is None, use self.</span> +<span class="sd"> filename : the name of the file to be saved. If not set, use self.grid_options['save_population_object']</span> +<span class="sd"> confirmation : if True, a file "filename.saved" is touched just after the dump, so we know it is finished. TODO: fix this</span> +<span class="sd"> compression (optional, default = "gzip"): TODO: fix this</span> + +<span class="sd"> Compression is performed according to the filename, as stated in the</span> +<span class="sd"> compress_pickle documentation at</span> +<span class="sd"> https://lucianopaz.github.io/compress_pickle/html/</span> + +<span class="sd"> Shared memory, stored in the population_object.shared_memory dict, is not saved.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">population_object</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="c1"># default to using self</span> + <span class="n">population_object</span> <span class="o">=</span> <span class="bp">self</span> + + <span class="k">if</span> <span class="n">filename</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="c1"># get filename from self</span> + <span class="n">filename</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"save_population_object"</span><span class="p">]</span> + + <span class="k">if</span> <span class="n">filename</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Save population </span><span class="si">{id}</span><span class="s2">, probtot </span><span class="si">{probtot}</span><span class="s2"> to pickle in </span><span class="si">{filename}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_population_id"</span><span class="p">],</span> + <span class="n">probtot</span><span class="o">=</span><span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_probtot"</span><span class="p">],</span> + <span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1"># Some parts of the population_object cannot be pickled:</span> + <span class="c1"># remove them, and restore them after pickling</span> + + <span class="c1"># remove shared memory</span> + <span class="n">shared_memory</span> <span class="o">=</span> <span class="n">population_object</span><span class="o">.</span><span class="n">shared_memory</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">shared_memory</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># delete system generator</span> + <span class="n">system_generator</span> <span class="o">=</span> <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># delete _store_memaddr</span> + <span class="n">_store_memaddr</span> <span class="o">=</span> <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_store_memaddr"</span><span class="p">]</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_store_memaddr"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># delete persistent_data_memory_dict</span> + <span class="n">persistent_data_memory_dict</span> <span class="o">=</span> <span class="n">population_object</span><span class="o">.</span><span class="n">persistent_data_memory_dict</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">persistent_data_memory_dict</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># add metadata if it doesn't exist</span> + <span class="k">if</span> <span class="ow">not</span> <span class="s2">"metadata"</span> <span class="ow">in</span> <span class="n">population_object</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">:</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># add datestamp</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"save_population_time"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">now</span><span class="p">()</span> + + <span class="c1"># add extra metadata</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">add_system_metadata</span><span class="p">()</span> + + <span class="c1"># add max memory use</span> + <span class="k">try</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"max_memory_use"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="nb">sum</span><span class="p">(</span><span class="n">shared_memory</span><span class="p">[</span><span class="s2">"max_memory_use_per_thread"</span><span class="p">]))</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"save_population_object : Error: "</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span> + + <span class="c1"># dump pickle file</span> + <span class="n">compress_pickle</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">population_object</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">pickler_method</span><span class="o">=</span><span class="s2">"dill"</span><span class="p">)</span> + + <span class="c1"># restore data</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">shared_memory</span> <span class="o">=</span> <span class="n">shared_memory</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]</span> <span class="o">=</span> <span class="n">system_generator</span> + <span class="k">del</span> <span class="n">population_object</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"save_population_time"</span><span class="p">]</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"store_memaddr"</span><span class="p">]</span> <span class="o">=</span> <span class="n">_store_memaddr</span> + <span class="n">population_object</span><span class="o">.</span><span class="n">persistent_data_memory_dict</span> <span class="o">=</span> <span class="n">persistent_data_memory_dict</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + + <span class="c1"># touch 'saved' file</span> + <span class="n">saved</span> <span class="o">=</span> <span class="n">filename</span> <span class="o">+</span> <span class="s2">".saved"</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_touch</span><span class="p">(</span><span class="n">saved</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.load_population_object"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.load_population_object">[docs]</a> <span class="k">def</span> <span class="nf">load_population_object</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> returns the Population object loaded from filename</span> +<span class="sd"> """</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + <span class="k">if</span> <span class="n">filename</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">obj</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">obj</span> <span class="o">=</span> <span class="n">compress_pickle</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">pickler_method</span><span class="o">=</span><span class="s2">"dill"</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="n">obj</span> <span class="o">=</span> <span class="kc">None</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Loading of the compressed object went wrong: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">e</span><span class="p">))</span> + + <span class="k">return</span> <span class="n">obj</span></div> + +<div class="viewcode-block" id="dataIO.merge_populations"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations">[docs]</a> <span class="k">def</span> <span class="nf">merge_populations</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">refpop</span><span class="p">,</span> <span class="n">newpop</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> merge newpop's results data into refpop's results data</span> + +<span class="sd"> Args:</span> +<span class="sd"> refpop : the original "reference" Population object to be added to</span> +<span class="sd"> newpop : Population object containing the new data</span> + +<span class="sd"> Returns:</span> +<span class="sd"> nothing</span> + +<span class="sd"> Note:</span> +<span class="sd"> The file should be saved using save_population_object()</span> +<span class="sd"> """</span> + + <span class="c1"># combine data</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_results</span> <span class="o">=</span> <span class="n">merge_dicts</span><span class="p">(</span><span class="n">refpop</span><span class="o">.</span><span class="n">grid_results</span><span class="p">,</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_results</span><span class="p">)</span> + + <span class="c1"># special cases</span> + <span class="n">maxmem</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">if</span> <span class="s2">"max_memory_use"</span> <span class="ow">in</span> <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"metadata"</span><span class="p">,</span> <span class="p">{})</span> <span class="ow">and</span> <span class="s2">"max_memory_use"</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"metadata"</span><span class="p">,</span> <span class="p">{}):</span> + <span class="n">maxmem</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"max_memory_use"</span><span class="p">],</span> + <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"max_memory_use"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="k">try</span><span class="p">:</span> + <span class="c1"># special cases:</span> + <span class="c1"># copy the settings</span> + <span class="n">settings</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">if</span> <span class="s2">"settings"</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"metadata"</span><span class="p">,</span> <span class="p">{}):</span> + <span class="n">settings</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span> + <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">]</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">settings</span><span class="p">:</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">]</span> <span class="o">=</span> <span class="n">settings</span> + + <span class="c1"># Copy the Xinit</span> + <span class="n">Xinit</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">if</span> <span class="s2">"Xinit"</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ensemble"</span><span class="p">,</span> <span class="p">{}):</span> + <span class="n">Xinit</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">][</span><span class="s2">"Xinit"</span><span class="p">])</span> + <span class="k">if</span> <span class="n">Xinit</span><span class="p">:</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">][</span><span class="s2">"Xinit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Xinit</span> + + <span class="c1"># merge the ensemble dicts</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span> <span class="o">=</span> <span class="n">merge_dicts</span><span class="p">(</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">,</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span> + <span class="p">)</span> + + <span class="c1"># set special cases</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"max_memory_use"</span><span class="p">]</span> <span class="o">=</span> <span class="n">maxmem</span> + + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Error merging grid_ensemble_results:"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"_probtot"</span><span class="p">]:</span> + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">+=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + + <span class="n">refpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_killed"</span><span class="p">]</span> <span class="o">|=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_killed"</span><span class="p">]</span></div> + +<div class="viewcode-block" id="dataIO.merge_populations_from_file"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations_from_file">[docs]</a> <span class="k">def</span> <span class="nf">merge_populations_from_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">refpop</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Wrapper for merge_populations so it can be done directly</span> +<span class="sd"> from a file.</span> + +<span class="sd"> Args:</span> +<span class="sd"> refpop : the original "reference" Population object to be added to</span> +<span class="sd"> filename : file containing the Population object containing the new data</span> + +<span class="sd"> Note:</span> +<span class="sd"> The file should be saved using save_population_object()</span> +<span class="sd"> """</span> + + <span class="n">mtime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">getmtime</span><span class="p">(</span><span class="n">filename</span><span class="p">))</span> + <span class="n">modtime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"</span><span class="si">%a</span><span class="s2">, </span><span class="si">%d</span><span class="s2"> %b %Y %H:%M:%S"</span><span class="p">,</span> <span class="n">mtime</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Load data from </span><span class="si">{filename}</span><span class="s2"> : size </span><span class="si">{size}</span><span class="s2">, modtime </span><span class="si">{modtime}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span> + <span class="n">size</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">getsize</span><span class="p">(</span><span class="n">filename</span><span class="p">),</span> + <span class="n">modtime</span><span class="o">=</span><span class="n">modtime</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="n">newpop</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">load_population_object</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + + <span class="k">if</span> <span class="s1">'total_count'</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"total_count"</span><span class="p">]</span> + <span class="k">elif</span> <span class="s2">"_count"</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_count"</span><span class="p">]</span> + <span class="k">elif</span> <span class="s1">'metadata'</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span> <span class="ow">and</span> <span class="s2">"_count"</span> <span class="ow">in</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">]:</span> + <span class="n">n</span> <span class="o">=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"_count"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Loaded data from </span><span class="si">{n}</span><span class="s2"> stars"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="n">n</span><span class="p">))</span> + + <span class="c1"># merge with refpop</span> + <span class="bp">self</span><span class="o">.</span><span class="n">merge_populations</span><span class="p">(</span><span class="n">refpop</span><span class="p">,</span> <span class="n">newpop</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.snapshot_filename"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.snapshot_filename">[docs]</a> <span class="k">def</span> <span class="nf">snapshot_filename</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Automatically choose the snapshot filename.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">():</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_snapshot_filename</span><span class="p">()</span> + + <span class="n">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"tmp_dir"</span><span class="p">],</span> <span class="s2">"snapshot.gz"</span><span class="p">)</span> + <span class="k">return</span> <span class="n">file</span></div> + +<div class="viewcode-block" id="dataIO.load_snapshot"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.load_snapshot">[docs]</a> <span class="k">def</span> <span class="nf">load_snapshot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">file</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Load a snapshot from file and set it in the preloaded_population placeholder.</span> +<span class="sd"> """</span> + <span class="n">newpop</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">load_population_object</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + + <span class="c1"># unset the _killed flag, in case it was set</span> + <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_killed"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="c1"># set in preloaded_population for later merge</span> + <span class="bp">self</span><span class="o">.</span><span class="n">preloaded_population</span> <span class="o">=</span> <span class="n">newpop</span> + + <span class="c1"># set the start position for new stars</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"start_at"</span><span class="p">]</span> <span class="o">=</span> <span class="n">newpop</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"start_at"</span><span class="p">]</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Loaded from snapshot at </span><span class="si">{file}</span><span class="s2"> : </span><span class="si">{nstars}</span><span class="s2"> stars, start at star </span><span class="si">{nstart}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="o">=</span><span class="n">file</span><span class="p">,</span> + <span class="n">nstars</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="c1"># self.grid_options[''],</span> + <span class="n">nstart</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"start_at"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span></div> + +<div class="viewcode-block" id="dataIO.save_snapshot"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.save_snapshot">[docs]</a> <span class="k">def</span> <span class="nf">save_snapshot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Save the population object to a snapshot file, automatically choosing the filename if none is given.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">file</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">file</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">snapshot_filename</span><span class="p">()</span> + + <span class="k">if</span> <span class="s2">"_count"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_count"</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">n</span> <span class="o">=</span> <span class="s2">"?"</span> + + <span class="nb">print</span><span class="p">(</span><span class="s2">"Saving snapshot containing </span><span class="si">{}</span><span class="s2"> stars to </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span> + <span class="bp">self</span><span class="o">.</span><span class="n">save_population_object</span><span class="p">(</span><span class="nb">object</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="n">file</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.write_ensemble"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.write_ensemble">[docs]</a> <span class="k">def</span> <span class="nf">write_ensemble</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">output_file</span><span class="p">,</span> + <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">sort_keys</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">,</span> + <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> write_ensemble : Write ensemble results to a file.</span> + +<span class="sd"> Args:</span> +<span class="sd"> output_file : the output filename.</span> + +<span class="sd"> If the filename has an extension that we recognise,</span> +<span class="sd"> e.g. .gz or .bz2, we compress the output appropriately.</span> + +<span class="sd"> The filename should contain .json or .msgpack, the two</span> +<span class="sd"> currently-supported formats.</span> + +<span class="sd"> Usually you'll want to output to JSON, but we can</span> +<span class="sd"> also output to msgpack.</span> + +<span class="sd"> data : the data dictionary to be converted and written to the file.</span> +<span class="sd"> If not set, this defaults to self.grid_ensemble_results.</span> + +<span class="sd"> sort_keys : if True, and output is to JSON, the keys will be sorted.</span> +<span class="sd"> (default: True, passed to json.dumps)</span> + +<span class="sd"> indent : number of space characters used in the JSON indent. (Default: 4,</span> +<span class="sd"> passed to json.dumps)</span> + +<span class="sd"> encoding : file encoding method, usually defaults to 'utf-8'</span> + +<span class="sd"> ensure_ascii : the ensure_ascii flag passed to json.dump and/or json.dumps</span> +<span class="sd"> (Default: False)</span> +<span class="sd"> """</span> + + <span class="c1"># get the file type</span> + <span class="n">file_type</span> <span class="o">=</span> <span class="n">ensemble_file_type</span><span class="p">(</span><span class="n">output_file</span><span class="p">)</span> + + <span class="c1"># default to using grid_ensemble_results if no data is given</span> + <span class="k">if</span> <span class="n">data</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">file_type</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Unable to determine file type from ensemble filename </span><span class="si">{}</span><span class="s2"> : it should be .json or .msgpack."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">output_file</span><span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">output_file</span><span class="p">,</span> <span class="s2">"wt"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">)</span> + <span class="k">if</span> <span class="n">file_type</span> <span class="o">==</span> <span class="s2">"JSON"</span><span class="p">:</span> + <span class="c1"># JSON output</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span> + <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span> + <span class="n">data</span><span class="p">,</span> + <span class="n">sort_keys</span><span class="o">=</span><span class="n">sort_keys</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="n">indent</span><span class="p">,</span> + <span class="n">ensure_ascii</span><span class="o">=</span><span class="n">ensure_ascii</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">file_type</span> <span class="o">==</span> <span class="s2">"msgpack"</span><span class="p">:</span> + <span class="c1"># msgpack output</span> + <span class="n">msgpack</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">f</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Thread </span><span class="si">{thread}</span><span class="s2">: Wrote ensemble results to file: </span><span class="si">{colour}{file}{reset}</span><span class="s2"> (file type </span><span class="si">{file_type}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">thread</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">process_ID</span><span class="p">,</span> + <span class="n">file</span><span class="o">=</span><span class="n">output_file</span><span class="p">,</span> + <span class="n">colour</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"green"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="n">file_type</span><span class="o">=</span><span class="n">file_type</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.write_binary_c_calls_to_file"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.write_binary_c_calls_to_file">[docs]</a> <span class="k">def</span> <span class="nf">write_binary_c_calls_to_file</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">output_dir</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">output_filename</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">include_defaults</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that loops over the grid code and writes the generated parameters to a file.</span> +<span class="sd"> In the form of a command line call</span> + +<span class="sd"> Only useful when you have a variable grid as system_generator. MC wouldn't be that useful</span> + +<span class="sd"> Also, make sure that in this export there are the basic parameters</span> +<span class="sd"> like m1,m2,sep, orb-per, ecc, probability etc.</span> + +<span class="sd"> On default this will write to the datadir, if it exists</span> + +<span class="sd"> Args:</span> +<span class="sd"> output_dir: (optional, default = None) directory where to write the file to. If custom_options['data_dir'] is present, then that one will be used first, and then the output_dir</span> +<span class="sd"> output_filename: (optional, default = None) filename of the output. If not set it will be called "binary_c_calls.txt"</span> +<span class="sd"> include_defaults: (optional, default = None) whether to include the defaults of binary_c in the lines that are written. Beware that this will result in very long lines, and it might be better to just export the binary_c defaults and keep them in a separate file.</span> + +<span class="sd"> Returns:</span> +<span class="sd"> filename: filename that was used to write the calls to</span> +<span class="sd"> """</span> + + <span class="c1"># Check if there is no compiled grid yet. If not, lets try to build it first.</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]:</span> + + <span class="c1">## check the settings:</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ensemble"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ensemble_defer"</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Error, if you want to run an ensemble in a population, the output needs to be deferred"</span><span class="p">,</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span> + + <span class="c1"># Put in check</span> + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">])</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Error: you haven't defined any grid variables! Aborting"</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span> + + <span class="c1">#</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_generate_grid_code</span><span class="p">(</span><span class="n">dry_run</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + + <span class="c1">#</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_load_grid_function</span><span class="p">()</span> + + <span class="c1"># then if the _system_generator is present, we go through it</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]:</span> + <span class="c1"># Check if there is an output dir configured</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">custom_options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"data_dir"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">binary_c_calls_output_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">custom_options</span><span class="p">[</span><span class="s2">"data_dir"</span><span class="p">]</span> + <span class="c1"># otherwise check if there's one passed to the function</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">output_dir</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Error. No data_dir configured and you gave no output_dir. Aborting"</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span> + <span class="n">binary_c_calls_output_dir</span> <span class="o">=</span> <span class="n">output_dir</span> + + <span class="c1"># check if there's a filename passed to the function</span> + <span class="k">if</span> <span class="n">output_filename</span><span class="p">:</span> + <span class="n">binary_c_calls_filename</span> <span class="o">=</span> <span class="n">output_filename</span> + <span class="c1"># otherwise use default value</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">binary_c_calls_filename</span> <span class="o">=</span> <span class="s2">"binary_c_calls.txt"</span> + + <span class="n">binary_c_calls_full_filename</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="n">binary_c_calls_output_dir</span><span class="p">,</span> <span class="n">binary_c_calls_filename</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Writing binary_c calls to </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">binary_c_calls_full_filename</span><span class="p">))</span> + + <span class="c1"># Write to file</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span> + <span class="n">binary_c_calls_full_filename</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span> + <span class="p">)</span> <span class="k">as</span> <span class="n">file</span><span class="p">:</span> + <span class="c1"># Get defaults and clean them, then overwrite them with the set values.</span> + <span class="k">if</span> <span class="n">include_defaults</span><span class="p">:</span> + <span class="c1"># TODO: make sure that the defaults here are cleaned up properly</span> + <span class="n">cleaned_up_defaults</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cleaned_up_defaults</span> + <span class="n">full_system_dict</span> <span class="o">=</span> <span class="n">cleaned_up_defaults</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + <span class="n">full_system_dict</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">full_system_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + + <span class="k">for</span> <span class="n">system</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">](</span><span class="bp">self</span><span class="p">):</span> + <span class="c1"># update values with current system values</span> + <span class="n">full_system_dict</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">system</span><span class="p">)</span> + + <span class="n">binary_cmdline_string</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_return_argline</span><span class="p">(</span><span class="n">full_system_dict</span><span class="p">)</span> + <span class="n">file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">binary_cmdline_string</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Error. No grid function found!"</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span> + + <span class="k">return</span> <span class="n">binary_c_calls_full_filename</span></div> + +<div class="viewcode-block" id="dataIO.set_status"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.set_status">[docs]</a> <span class="k">def</span> <span class="nf">set_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">,</span> <span class="n">format_statment</span><span class="o">=</span><span class="s2">"process_</span><span class="si">{}</span><span class="s2">.txt"</span><span class="p">,</span> <span class="n">ID</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to set the status string in its appropriate file</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">ID</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">ID</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">process_ID</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"status_dir"</span><span class="p">]:</span> + <span class="n">path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"status_dir"</span><span class="p">],</span> + <span class="n">format_statment</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ID</span><span class="p">),</span> + <span class="p">)</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> + + <span class="c1"># custom logging functions for HPC jobs</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">():</span> + <span class="bp">self</span><span class="o">.</span><span class="n">HPC_set_status</span><span class="p">(</span><span class="n">string</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.locked_close"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.locked_close">[docs]</a> <span class="k">def</span> <span class="nf">locked_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">file</span><span class="p">,</span> <span class="n">lock</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Partner function to locked_open_for_write()</span> + +<span class="sd"> Closes and unlocks the file</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">file</span><span class="p">:</span> + <span class="n">file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="k">if</span> <span class="n">lock</span><span class="p">:</span> + <span class="n">lock</span><span class="o">.</span><span class="n">unlock</span><span class="p">()</span> + <span class="k">if</span> <span class="n">file</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">file</span><span class="o">.</span><span class="n">name</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.wait_for_unlock"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.wait_for_unlock">[docs]</a> <span class="k">def</span> <span class="nf">wait_for_unlock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">lock_suffix</span><span class="o">=</span><span class="s2">".lock"</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Companion to locked_open_for_write that waits for a filename</span> +<span class="sd"> to a) exist and b) be unlocked.</span> + +<span class="sd"> This should work because the lock file is created before the file</span> +<span class="sd"> is created.</span> +<span class="sd"> """</span> + <span class="k">while</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span> + <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.25</span><span class="p">)</span> + <span class="k">while</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">filename</span> <span class="o">+</span> <span class="n">lock_suffix</span><span class="p">):</span> + <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.25</span><span class="p">)</span></div> + +<div class="viewcode-block" id="dataIO.locked_open_for_write"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.locked_open_for_write">[docs]</a> <span class="k">def</span> <span class="nf">locked_open_for_write</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">filename</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">,</span> + <span class="n">lock_suffix</span><span class="o">=</span><span class="s2">".lock"</span><span class="p">,</span> + <span class="n">lock_timeout</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> + <span class="n">lock_lifetime</span><span class="o">=</span><span class="mi">60</span><span class="p">,</span> + <span class="n">exists_ok</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">fatal_open_errors</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">vb</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="o">**</span><span class="n">kwargs</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Wrapper for Python's open(filename) which opens a file at</span> +<span class="sd"> filename for writing (mode "w") and locks it.</span> + +<span class="sd"> We check whether the file's lockfile already exists, in which</span> +<span class="sd"> case just return (None,None), and if we cannot obtain a</span> +<span class="sd"> lock on the file we also return (None,None).</span> + +<span class="sd"> If the file does not exist, we keep trying to lock until it does.</span> + +<span class="sd"> To do the locking, we use flufl.lock which is NFS safe.</span> + +<span class="sd"> Args:</span> +<span class="sd"> lock_lifetime: (passed to flufl.lock.Lock()) default 60 seconds.</span> +<span class="sd"> It should take less than this time to write the file.</span> +<span class="sd"> lock_timeout: (passed to flufl.lock.Lock()) default 5 seconds.</span> +<span class="sd"> This should be non-zero.</span> +<span class="sd"> fatal_open_errors: if open() fails and fatal_open_errors is True, exit.</span> +<span class="sd"> exists_ok: if False and the file at filename exists, return (None,None) (default False)</span> +<span class="sd"> vb: verbose logging if True, defaults to False</span> + +<span class="sd"> Returns:</span> +<span class="sd"> (file_object, lock_object) tuple.</span> +<span class="sd"> If the file was not opened, returns (None,None).</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">exists_ok</span> <span class="ow">is</span> <span class="kc">False</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"File at </span><span class="si">{}</span><span class="s2"> already exists: cannot write to it"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">filename</span><span class="p">))</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + + <span class="c1"># set the lockfile path: this should be the same</span> + <span class="c1"># for all processes, so it's just the original file</span> + <span class="c1"># plus the lock_suffix</span> + <span class="n">lockfilename</span> <span class="o">=</span> <span class="n">filename</span> <span class="o">+</span> <span class="n">lock_suffix</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"lockfile=</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lockfilename</span><span class="p">))</span> + + <span class="k">while</span> <span class="kc">True</span><span class="p">:</span> + <span class="c1"># if the file exists, just return</span> + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">lockfilename</span><span class="p">):</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"lockfile at </span><span class="si">{}</span><span class="s2"> already exists (corresponding to file at </span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">lockfilename</span><span class="p">,</span> <span class="n">filename</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + + <span class="c1"># make the lock object by opening the lockfile</span> + <span class="n">lock</span> <span class="o">=</span> <span class="n">flufl</span><span class="o">.</span><span class="n">lock</span><span class="o">.</span><span class="n">Lock</span><span class="p">(</span><span class="n">lockfilename</span><span class="p">,</span> <span class="n">default_timeout</span><span class="o">=</span><span class="n">lock_timeout</span><span class="p">)</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"post-lock: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + + <span class="k">if</span> <span class="n">lock</span><span class="p">:</span> + <span class="c1"># we have the lockfile, so set the lifetime and try to lock it</span> + <span class="n">lock</span><span class="o">.</span><span class="n">lifetime</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">timedelta</span><span class="p">(</span><span class="n">seconds</span><span class="o">=</span><span class="n">lock_lifetime</span><span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"try to lock </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + <span class="n">lock</span><span class="o">.</span><span class="n">lock</span><span class="p">()</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="k">if</span> <span class="n">lock</span><span class="o">.</span><span class="n">is_locked</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"locked </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"failed to lock </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + <span class="k">except</span><span class="p">:</span> + <span class="k">pass</span> + + <span class="c1"># if we acquired the lock, try to open the file</span> + <span class="k">if</span> <span class="n">lock</span><span class="o">.</span><span class="n">is_locked</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{}</span><span class="s2"> is locked by </span><span class="si">{}</span><span class="s2"> to </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">filename</span><span class="p">,</span> <span class="n">lock</span><span class="p">,</span> <span class="n">lockfilename</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">exists_ok</span> <span class="ow">is</span> <span class="kc">False</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"File at </span><span class="si">{}</span><span class="s2"> already exists (2): cannot write to it, unlocking and returning (None,None)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">filename</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">lock</span><span class="o">.</span><span class="n">unlock</span><span class="p">()</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + + <span class="c1"># All is apparently ok: file is locked</span> + <span class="k">try</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Try to open file at </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">filename</span><span class="p">))</span> + <span class="n">f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Return locked file </span><span class="si">{}</span><span class="s2">, </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">lock</span><span class="p">))</span> + <span class="k">return</span> <span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">lock</span><span class="p">)</span> + + <span class="c1"># error on open should be fatal</span> + <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Error in locked_open_for_write() : </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">e</span><span class="p">))</span> + <span class="k">if</span> <span class="n">fatal_open_errors</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"fatal exit on open"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"unlock </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + <span class="n">lock</span><span class="o">.</span><span class="n">unlock</span><span class="p">()</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"unlocked </span><span class="si">{}</span><span class="s2"> return None,None"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lock</span><span class="p">))</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + + <span class="c1"># failed to lock this time, keep trying</span> + <span class="c1"># (we shouldn't lock up the CPU because the timeout is non-zero)</span> + <span class="k">continue</span></div> + +<div class="viewcode-block" id="dataIO.NFS_flush_hack"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.NFS_flush_hack">[docs]</a> <span class="k">def</span> <span class="nf">NFS_flush_hack</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Use opendir()/closedir() to flush NFS access to a file.</span> +<span class="sd"> NOTE: this may or may not work!</span> + +<span class="sd"> TODO: This function leads to a complaint about unclosed scandir operators. Check if that can be resolved.</span> +<span class="sd"> """</span> + <span class="n">os</span><span class="o">.</span><span class="n">sync</span><span class="p">()</span> + <span class="n">dirname</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> + <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="p">(</span><span class="n">dirname</span><span class="p">)</span> + <span class="n">os</span><span class="o">.</span><span class="n">scandir</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div> + +<div class="viewcode-block" id="dataIO.compression_type"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.compression_type">[docs]</a> <span class="k">def</span> <span class="nf">compression_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return the compression type of the ensemble file, based on its filename extension.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">filename</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">".bz2"</span><span class="p">):</span> + <span class="k">return</span> <span class="s2">"bzip2"</span> + <span class="k">if</span> <span class="n">filename</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">".gz"</span><span class="p">):</span> + <span class="k">return</span> <span class="s2">"gzip"</span> + + <span class="k">return</span> <span class="kc">None</span></div> + +<div class="viewcode-block" id="dataIO.open"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.open">[docs]</a> <span class="k">def</span> <span class="nf">open</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">file</span><span class="p">,</span> + <span class="n">mode</span><span class="o">=</span><span class="s2">"r"</span><span class="p">,</span> + <span class="n">buffering</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">errors</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">newline</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">closefd</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">opener</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">compression</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">compresslevel</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">vb</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Wrapper for open() with automatic compression based on the file extension.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">compression</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">compression</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">compression_type</span><span class="p">(</span><span class="n">file</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s1">'open() file at "</span><span class="si">{file}</span><span class="s1">" with mode = </span><span class="si">{mode}</span><span class="s1">, compression </span><span class="si">{compression}</span><span class="s1">, compresslevel </span><span class="si">{compresslevel}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="o">=</span><span class="n">file</span><span class="p">,</span> + <span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> + <span class="n">compresslevel</span><span class="o">=</span><span class="n">compresslevel</span><span class="p">,</span> + <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">compression</span><span class="p">:</span> + <span class="k">if</span> <span class="n">compresslevel</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">compresslevel</span> <span class="o">=</span> <span class="mi">9</span> + <span class="k">if</span> <span class="s2">"b"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">mode</span><span class="p">:</span> + <span class="c1"># if we don't specify binary-mode, the gzip module</span> + <span class="c1"># defaults to binary, which isn't compatible with JSON,</span> + <span class="c1"># so default to text if not specified otherwise</span> + <span class="n">mode</span> <span class="o">+=</span> <span class="s2">"t"</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"open() adding text mode"</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">encoding</span> <span class="o">=</span> <span class="kc">None</span> + <span class="n">errors</span> <span class="o">=</span> <span class="kc">None</span> + <span class="n">newline</span> <span class="o">=</span> <span class="kc">None</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"open() setting encoding=errors=newline=None"</span><span class="p">)</span> + <span class="k">if</span> <span class="n">compression</span> <span class="o">==</span> <span class="s2">"bzip2"</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="n">bz2</span><span class="o">.</span><span class="n">open</span><span class="p">(</span> + <span class="n">file</span><span class="p">,</span> + <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span> + <span class="n">compresslevel</span><span class="o">=</span><span class="n">compresslevel</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">,</span> + <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">,</span> + <span class="n">newline</span><span class="o">=</span><span class="n">newline</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">compression</span> <span class="o">==</span> <span class="s2">"gzip"</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="n">gzip</span><span class="o">.</span><span class="n">open</span><span class="p">(</span> + <span class="n">file</span><span class="p">,</span> + <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span> + <span class="n">compresslevel</span><span class="o">=</span><span class="n">compresslevel</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">,</span> + <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">,</span> + <span class="n">newline</span><span class="o">=</span><span class="n">newline</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">file_object</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span> + <span class="n">file</span><span class="p">,</span> + <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span> + <span class="n">buffering</span><span class="o">=</span><span class="n">buffering</span><span class="p">,</span> + <span class="n">encoding</span><span class="o">=</span><span class="n">encoding</span><span class="p">,</span> + <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">,</span> + <span class="n">newline</span><span class="o">=</span><span class="n">newline</span><span class="p">,</span> + <span class="n">closefd</span><span class="o">=</span><span class="n">closefd</span><span class="p">,</span> + <span class="n">opener</span><span class="o">=</span><span class="n">opener</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"open() return file_object ="</span><span class="p">,</span> <span class="n">file_object</span><span class="p">)</span> + <span class="k">return</span> <span class="n">file_object</span></div> + +<div class="viewcode-block" id="dataIO.NFSpath"><a class="viewcode-back" href="../../../../population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.NFSpath">[docs]</a> <span class="k">def</span> <span class="nf">NFSpath</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Test path to see if it's on an NFS mount.</span> + +<span class="sd"> Args:</span> +<span class="sd"> path : the path to be tested</span> + +<span class="sd"> Returns:</span> +<span class="sd"> True : if on an NFS mount point.</span> +<span class="sd"> False : if not.</span> +<span class="sd"> None : if the path does not exist.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">):</span> + <span class="n">cmd</span> <span class="o">=</span> <span class="s1">'stat -f -L -c %T "'</span> <span class="o">+</span> <span class="n">path</span> <span class="o">+</span> <span class="s1">'"'</span> + <span class="k">return</span> <span class="p">(</span> + <span class="s2">"nfs"</span> + <span class="ow">in</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">shell</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">)</span> + <span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> + <span class="o">.</span><span class="n">decode</span><span class="p">()</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="kc">None</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/distribution_functions.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/distribution_functions.html new file mode 100644 index 0000000000000000000000000000000000000000..c0cadac6fde05492550453f9eed3af987017bd79 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/distribution_functions.html @@ -0,0 +1,2419 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.distribution_functions — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.distribution_functions</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.distribution_functions</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the predefined distribution functions</span> + +<span class="sd">The user can use any of these distribution functions to</span> +<span class="sd">generate probability distributions for sampling populations</span> + +<span class="sd">To add custom functions you can take any function and add it to the class instance before running the code.</span> +<span class="sd">See https://stackoverflow.com/a/28060251 for some tips on how to do that</span> + +<span class="sd">There are distributions for the following parameters:</span> +<span class="sd"> - mass</span> +<span class="sd"> - period</span> +<span class="sd"> - mass ratio</span> +<span class="sd"> - binary fraction</span> + +<span class="sd">Tasks:</span> +<span class="sd"> - TODO: make some things globally present? rob does this in his module..i guess it saves</span> +<span class="sd"> calculations but not sure if I'm gonna do that now</span> +<span class="sd"> - TODO: add eccentricity distribution: thermal, Mathieu eccentricity</span> +<span class="sd"> - TODO: Add SFH distributions depending on redshift</span> +<span class="sd"> - TODO: Add metallicity distributions depending on redshift</span> +<span class="sd"> - TODO: Add initial rotational velocity distributions</span> +<span class="sd"> - TODO: make an n-part power law that's general enough to fix the three part and the 4 part</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101, R0201</span> + +<span class="kn">import</span> <span class="nn">math</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span> + +<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> +<span class="kn">import</span> <span class="nn">cachetools</span> + +<span class="kn">import</span> <span class="nn">py_rinterpolate</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.useful_funcs</span> <span class="kn">import</span> <span class="n">calc_period_from_sep</span><span class="p">,</span> <span class="n">calc_sep_from_period</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="n">verbose_print</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.population_extensions.grid_options_defaults</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.dicts</span> <span class="kn">import</span> <span class="n">prepare_dict</span> + +<span class="c1"># Global dictinary to store values in</span> +<span class="n">Moecache</span> <span class="o">=</span> <span class="p">{}</span> + +<span class="c1">###</span> +<span class="c1"># File containing probability distributions</span> +<span class="c1"># Mostly copied from the Perl modules</span> +<span class="n">LOG_LN_CONVERTER</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mf">10.0</span><span class="p">)</span> +<span class="n">distribution_constants</span> <span class="o">=</span> <span class="p">{}</span> <span class="c1"># To store the constants in</span> + + +<div class="viewcode-block" id="distribution_functions"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions">[docs]</a><span class="k">class</span> <span class="nc">distribution_functions</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension for the Population grid object that contains the distribution functions</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the distribution_functions class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="distribution_functions.flat"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flat">[docs]</a> <span class="k">def</span> <span class="nf">flat</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Dummy distribution function that returns 1</span> + +<span class="sd"> Returns:</span> +<span class="sd"> a flat uniform distribution: 1</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="mf">1.0</span></div> + +<div class="viewcode-block" id="distribution_functions.number"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.number">[docs]</a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Dummy distribution function that returns the input</span> + +<span class="sd"> Args:</span> +<span class="sd"> value: the value that will be returned by this function.</span> + +<span class="sd"> Returns:</span> +<span class="sd"> the value that was provided</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="n">value</span></div> + +<div class="viewcode-block" id="distribution_functions.const_distribution"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.const_distribution">[docs]</a> <span class="k">def</span> <span class="nf">const_distribution</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">min_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">max_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">val</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> a constant distribution function between min=min_bound and max=max_bound.</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_bound: lower bound of the range</span> +<span class="sd"> max_bound: upper bound of the range</span> + +<span class="sd"> Returns:</span> +<span class="sd"> returns the value of 1/(max_bound-min_bound). If val is provided, it will check whether min_bound < val <= max_bound. if not: returns 0</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">val</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">min_bound</span> <span class="o"><</span> <span class="n">val</span> <span class="o"><=</span> <span class="n">max_bound</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="mf">0.0</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="n">max_bound</span> <span class="o">-</span> <span class="n">min_bound</span><span class="p">)</span> + <span class="k">return</span> <span class="n">prob</span></div> + +<div class="viewcode-block" id="distribution_functions.powerlaw_constant_nocache"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant_nocache">[docs]</a> <span class="k">def</span> <span class="nf">powerlaw_constant_nocache</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">min_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">max_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">k</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the constant to normalise a power law</span> + +<span class="sd"> TODO: what if k is -1?</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_val: lower bound of the range</span> +<span class="sd"> max_val: upper bound of the range</span> +<span class="sd"> k: power law slope</span> + +<span class="sd"> Returns:</span> +<span class="sd"> constant to normalise the given power law between the min_val and max_val range</span> +<span class="sd"> """</span> + + <span class="n">k1</span> <span class="o">=</span> <span class="n">k</span> <span class="o">+</span> <span class="mf">1.0</span> + <span class="c1"># print(</span> + <span class="c1"># "Powerlaw consts from {} to {}, k={} where k1={}".format(</span> + <span class="c1"># min_val, max_val, k, k1</span> + <span class="c1"># )</span> + <span class="c1"># )</span> + + <span class="n">powerlaw_const</span> <span class="o">=</span> <span class="n">k1</span> <span class="o">/</span> <span class="p">(</span><span class="n">max_val</span> <span class="o">**</span> <span class="n">k1</span> <span class="o">-</span> <span class="n">min_val</span> <span class="o">**</span> <span class="n">k1</span><span class="p">)</span> + <span class="k">return</span> <span class="n">powerlaw_const</span></div> + +<div class="viewcode-block" id="distribution_functions.powerlaw_constant"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span> + <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"population_extensions._distribution_functions.powerlaw_constant"</span><span class="p">]</span> + <span class="p">)</span> + <span class="k">def</span> <span class="nf">powerlaw_constant</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">min_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">max_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">k</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the constant to normalise a power law</span> + +<span class="sd"> TODO: what if k is -1?</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_val: lower bound of the range</span> +<span class="sd"> max_val: upper bound of the range</span> +<span class="sd"> k: power law slope</span> + +<span class="sd"> Returns:</span> +<span class="sd"> constant to normalise the given power law between the min_val and max_val range</span> +<span class="sd"> """</span> + + <span class="n">k1</span> <span class="o">=</span> <span class="n">k</span> <span class="o">+</span> <span class="mf">1.0</span> + <span class="c1"># print(</span> + <span class="c1"># "Powerlaw consts from {} to {}, k={} where k1={}".format(</span> + <span class="c1"># min_val, max_val, k, k1</span> + <span class="c1"># )</span> + <span class="c1"># )</span> + + <span class="n">powerlaw_const</span> <span class="o">=</span> <span class="n">k1</span> <span class="o">/</span> <span class="p">(</span><span class="n">max_val</span> <span class="o">**</span> <span class="n">k1</span> <span class="o">-</span> <span class="n">min_val</span> <span class="o">**</span> <span class="n">k1</span><span class="p">)</span> + <span class="k">return</span> <span class="n">powerlaw_const</span></div> + +<div class="viewcode-block" id="distribution_functions.powerlaw"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw">[docs]</a> <span class="k">def</span> <span class="nf">powerlaw</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">min_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">max_val</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">k</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">x</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Single power law with index k at x from min to max</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_val: lower bound of the power law</span> +<span class="sd"> max_val: upper bound of the power law</span> +<span class="sd"> k: slope of the power law</span> +<span class="sd"> x: position at which we want to evaluate</span> + +<span class="sd"> Returns:</span> +<span class="sd"> `probability` at the given position(x)</span> +<span class="sd"> """</span> + + <span class="c1"># Handle faulty value</span> + <span class="k">if</span> <span class="n">k</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"wrong value for k"</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o"><</span> <span class="n">min_val</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="n">max_val</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"input value is out of bounds!"</span><span class="p">)</span> + <span class="k">return</span> <span class="mi">0</span> + + <span class="n">powerlaw_const</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">powerlaw_constant</span><span class="p">(</span><span class="n">min_val</span><span class="p">,</span> <span class="n">max_val</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span> + + <span class="c1"># power law</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">powerlaw_const</span> <span class="o">*</span> <span class="p">(</span><span class="n">x</span> <span class="o">**</span> <span class="n">k</span><span class="p">)</span> + <span class="k">return</span> <span class="n">prob</span></div> + +<div class="viewcode-block" id="distribution_functions.calculate_constants_three_part_powerlaw"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calculate_constants_three_part_powerlaw">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span> + <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span> + <span class="s2">"distribution_functions.calculate_constants_three_part_powerlaw"</span> + <span class="p">]</span> + <span class="p">)</span> + <span class="k">def</span> <span class="nf">calculate_constants_three_part_powerlaw</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">m0</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m2</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m_max</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p2</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p3</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to calculate the constants for a three-part power law</span> + +<span class="sd"> TODO: use the power law_constant function to calculate all these values</span> + +<span class="sd"> Args:</span> +<span class="sd"> m0: lower bound mass</span> +<span class="sd"> m1: second boundary, between the first slope and the second slope</span> +<span class="sd"> m2: third boundary, between the second slope and the third slope</span> +<span class="sd"> m_max: upper bound mass</span> +<span class="sd"> p1: first slope</span> +<span class="sd"> p2: second slope</span> +<span class="sd"> p3: third slope</span> + +<span class="sd"> Returns:</span> +<span class="sd"> array of normalisation constants</span> +<span class="sd"> """</span> + + <span class="n">array_constants_three_part_powerlaw</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> + + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="p">((</span><span class="n">m1</span> <span class="o">**</span> <span class="n">p2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">m1</span> <span class="o">**</span> <span class="p">(</span><span class="o">-</span><span class="n">p1</span><span class="p">)))</span> + <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p1</span><span class="p">))</span> + <span class="o">*</span> <span class="p">(</span><span class="n">m1</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p1</span><span class="p">)</span> <span class="o">-</span> <span class="n">m0</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p1</span><span class="p">))</span> + <span class="p">)</span> + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="p">(</span> + <span class="p">(</span><span class="n">m2</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p2</span><span class="p">)</span> <span class="o">-</span> <span class="n">m1</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p2</span><span class="p">))</span> + <span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p2</span><span class="p">))</span> + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="p">(</span> + <span class="p">((</span><span class="n">m2</span> <span class="o">**</span> <span class="n">p2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">m2</span> <span class="o">**</span> <span class="p">(</span><span class="o">-</span><span class="n">p3</span><span class="p">)))</span> + <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p3</span><span class="p">))</span> + <span class="o">*</span> <span class="p">(</span><span class="n">m_max</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p3</span><span class="p">)</span> <span class="o">-</span> <span class="n">m2</span> <span class="o">**</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">p3</span><span class="p">))</span> + <span class="p">)</span> + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span> + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mf">1e-50</span> + <span class="p">)</span> + + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span> + <span class="mi">1</span> + <span class="p">]</span> <span class="o">*</span> <span class="p">((</span><span class="n">m1</span> <span class="o">**</span> <span class="n">p2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">m1</span> <span class="o">**</span> <span class="p">(</span><span class="o">-</span><span class="n">p1</span><span class="p">)))</span> + <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">array_constants_three_part_powerlaw</span><span class="p">[</span> + <span class="mi">1</span> + <span class="p">]</span> <span class="o">*</span> <span class="p">((</span><span class="n">m2</span> <span class="o">**</span> <span class="n">p2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">m2</span> <span class="o">**</span> <span class="p">(</span><span class="o">-</span><span class="n">p3</span><span class="p">)))</span> + + <span class="k">return</span> <span class="n">array_constants_three_part_powerlaw</span></div> + +<div class="viewcode-block" id="distribution_functions.three_part_powerlaw"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.three_part_powerlaw">[docs]</a> <span class="k">def</span> <span class="nf">three_part_powerlaw</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m0</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m2</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">m_max</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p2</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p3</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Generalised three-part power law, usually used for mass distributions</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass at which we want to evaluate the distribution.</span> +<span class="sd"> m0: lower bound mass</span> +<span class="sd"> m1: second boundary, between the first slope and the second slope</span> +<span class="sd"> m2: third boundary, between the second slope and the third slope</span> +<span class="sd"> m_max: upper bound mass</span> +<span class="sd"> p1: first slope</span> +<span class="sd"> p2: second slope</span> +<span class="sd"> p3: third slope</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' at given mass m</span> +<span class="sd"> """</span> + + <span class="n">three_part_powerlaw_constants</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">calculate_constants_three_part_powerlaw</span><span class="p">(</span> + <span class="n">m0</span><span class="p">,</span> <span class="n">m1</span><span class="p">,</span> <span class="n">m2</span><span class="p">,</span> <span class="n">m_max</span><span class="p">,</span> <span class="n">p1</span><span class="p">,</span> <span class="n">p2</span><span class="p">,</span> <span class="n">p3</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">m</span> <span class="o"><</span> <span class="n">m0</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="mf">0.0</span> <span class="c1"># Below lower bound</span> + <span class="k">elif</span> <span class="n">m</span> <span class="o"><=</span> <span class="n">m1</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">three_part_powerlaw_constants</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="n">p1</span><span class="p">)</span> <span class="c1"># Between m0 and m1</span> + <span class="k">elif</span> <span class="n">m</span> <span class="o"><=</span> <span class="n">m2</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">three_part_powerlaw_constants</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="n">p2</span><span class="p">)</span> <span class="c1"># Between m1 and m2</span> + <span class="k">elif</span> <span class="n">m</span> <span class="o"><=</span> <span class="n">m_max</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">three_part_powerlaw_constants</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="n">p3</span><span class="p">)</span> <span class="c1"># Between m2 and m_max</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1"># Above m_max</span> + + <span class="k">return</span> <span class="n">prob</span></div> + +<div class="viewcode-block" id="distribution_functions.gaussian_normalizing_const"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_normalizing_const">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span> + <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"distribution_functions.gaussian_normalizing_const"</span><span class="p">]</span> + <span class="p">)</span> + <span class="k">def</span> <span class="nf">gaussian_normalizing_const</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">mean</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">sigma</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">gmin</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">gmax</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to calculate the normalisation constant for the Gaussian</span> + +<span class="sd"> Args:</span> +<span class="sd"> mean: mean of the Gaussian</span> +<span class="sd"> sigma: standard deviation of the Gaussian</span> +<span class="sd"> gmin: lower bound of the range to calculate the probabilities in</span> +<span class="sd"> gmax: upper bound of the range to calculate the probabilities in</span> + +<span class="sd"> Returns:</span> +<span class="sd"> normalisation constant for the Gaussian distribution(mean, sigma) between gmin and gmax</span> +<span class="sd"> """</span> + + <span class="c1"># First time; calculate multiplier for given mean and sigma</span> + <span class="n">ptot</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">resolution</span> <span class="o">=</span> <span class="mi">1000</span> + <span class="n">d</span> <span class="o">=</span> <span class="p">(</span><span class="n">gmax</span> <span class="o">-</span> <span class="n">gmin</span><span class="p">)</span> <span class="o">/</span> <span class="n">resolution</span> + + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">resolution</span><span class="p">):</span> + <span class="n">y</span> <span class="o">=</span> <span class="n">gmin</span> <span class="o">+</span> <span class="n">i</span> <span class="o">*</span> <span class="n">d</span> + <span class="n">ptot</span> <span class="o">+=</span> <span class="n">d</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">gaussian_func</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">mean</span><span class="p">,</span> <span class="n">sigma</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">ptot</span></div> + +<div class="viewcode-block" id="distribution_functions.gaussian_func"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_func">[docs]</a> <span class="k">def</span> <span class="nf">gaussian_func</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">mean</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">sigma</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to evaluate a Gaussian at a given point, but this time without any boundaries.</span> + +<span class="sd"> Args:</span> +<span class="sd"> x: location at which to evaluate the distribution</span> +<span class="sd"> mean: mean of the Gaussian</span> +<span class="sd"> sigma: standard deviation of the Gaussian</span> + +<span class="sd"> Returns:</span> +<span class="sd"> value of the Gaussian at x</span> +<span class="sd"> """</span> + <span class="n">gaussian_prefactor</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="mf">2.0</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span> + + <span class="n">r</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="n">sigma</span><span class="p">)</span> + <span class="n">y</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">mean</span><span class="p">)</span> <span class="o">*</span> <span class="n">r</span> + <span class="k">return</span> <span class="n">gaussian_prefactor</span> <span class="o">*</span> <span class="n">r</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="mf">0.5</span> <span class="o">*</span> <span class="n">y</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.gaussian"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian">[docs]</a> <span class="k">def</span> <span class="nf">gaussian</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">x</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">mean</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">sigma</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">gmin</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">gmax</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Gaussian distribution function. used for e.g. Duquennoy + Mayor 1991</span> + +<span class="sd"> Args:</span> +<span class="sd"> x: location at which to evaluate the distribution</span> +<span class="sd"> mean: mean of the Gaussian</span> +<span class="sd"> sigma: standard deviation of the Gaussian</span> +<span class="sd"> gmin: lower bound of the range to calculate the probabilities in</span> +<span class="sd"> gmax: upper bound of the range to calculate the probabilities in</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of the Gaussian distribution between the boundaries, evaluated at x</span> +<span class="sd"> """</span> + + <span class="c1"># # location (X value), mean and sigma, min and max range</span> + <span class="c1"># my ($x,$mean,$sigma,$gmin,$gmax) = @_;</span> + + <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o"><</span> <span class="n">gmin</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="n">gmax</span><span class="p">):</span> + <span class="n">prob</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># normalise over given range</span> + <span class="n">normalisation</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">gaussian_normalizing_const</span><span class="p">(</span><span class="n">mean</span><span class="p">,</span> <span class="n">sigma</span><span class="p">,</span> <span class="n">gmin</span><span class="p">,</span> <span class="n">gmax</span><span class="p">)</span> + <span class="n">prob</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">gaussian_func</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">mean</span><span class="p">,</span> <span class="n">sigma</span><span class="p">)</span> <span class="o">/</span> <span class="n">normalisation</span> + + <span class="k">return</span> <span class="n">prob</span></div> + + <span class="c1">#####</span> + <span class="c1"># Mass distributions</span> + <span class="c1">#####</span> + +<div class="viewcode-block" id="distribution_functions.Kroupa2001"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Kroupa2001">[docs]</a> <span class="k">def</span> <span class="nf">Kroupa2001</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">newopts</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Probability distribution function for Kroupa 2001 IMF,</span> +<span class="sd"> where the default values to the three_part_powerlaw are:</span> +<span class="sd"> default = {</span> +<span class="sd"> "m0": 0.1,</span> +<span class="sd"> "m1": 0.5,</span> +<span class="sd"> "m2": 1,</span> +<span class="sd"> "mmax": 100,</span> +<span class="sd"> "p1": -1.3,</span> +<span class="sd"> "p2": -2.3,</span> +<span class="sd"> "p3": -2.3</span> +<span class="sd"> }</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> +<span class="sd"> newopts: optional dict to override the default values.</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + + <span class="c1"># Default parameters and override them</span> + <span class="n">default</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"m0"</span><span class="p">:</span> <span class="mf">0.1</span><span class="p">,</span> + <span class="s2">"m1"</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">,</span> + <span class="s2">"m2"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> + <span class="s2">"mmax"</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> + <span class="s2">"p1"</span><span class="p">:</span> <span class="o">-</span><span class="mf">1.3</span><span class="p">,</span> + <span class="s2">"p2"</span><span class="p">:</span> <span class="o">-</span><span class="mf">2.3</span><span class="p">,</span> + <span class="s2">"p3"</span><span class="p">:</span> <span class="o">-</span><span class="mf">2.3</span><span class="p">,</span> + <span class="p">}</span> + + <span class="n">value_dict</span> <span class="o">=</span> <span class="n">default</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + + <span class="k">if</span> <span class="n">newopts</span><span class="p">:</span> + <span class="n">value_dict</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">newopts</span><span class="p">)</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">three_part_powerlaw</span><span class="p">(</span> + <span class="n">m</span><span class="p">,</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m0"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m1"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m2"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"mmax"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p1"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p2"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p3"</span><span class="p">],</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.ktg93"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.ktg93">[docs]</a> <span class="k">def</span> <span class="nf">ktg93</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">newopts</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Probability distribution function for KTG93 IMF, where the default values to the three_part_powerlaw are: default = {"m0": 0.1, "m1": 0.5, "m2": 1, "mmax": 80, "p1": -1.3, "p2": -2.2,"p3": -2.7}</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> +<span class="sd"> newopts: optional dict to override the default values.</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + + <span class="n">defaults</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"m0"</span><span class="p">:</span> <span class="mf">0.1</span><span class="p">,</span> + <span class="s2">"m1"</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">,</span> + <span class="s2">"m2"</span><span class="p">:</span> <span class="mf">1.0</span><span class="p">,</span> + <span class="s2">"mmax"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span> + <span class="s2">"p1"</span><span class="p">:</span> <span class="o">-</span><span class="mf">1.3</span><span class="p">,</span> + <span class="s2">"p2"</span><span class="p">:</span> <span class="o">-</span><span class="mf">2.2</span><span class="p">,</span> + <span class="s2">"p3"</span><span class="p">:</span> <span class="o">-</span><span class="mf">2.7</span><span class="p">,</span> + <span class="p">}</span> + <span class="n">value_dict</span> <span class="o">=</span> <span class="n">defaults</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + + <span class="k">if</span> <span class="n">newopts</span><span class="p">:</span> + <span class="n">value_dict</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">newopts</span><span class="p">)</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">three_part_powerlaw</span><span class="p">(</span> + <span class="n">m</span><span class="p">,</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m0"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m1"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"m2"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"mmax"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p1"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p2"</span><span class="p">],</span> + <span class="n">value_dict</span><span class="p">[</span><span class="s2">"p3"</span><span class="p">],</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.imf_tinsley1980"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_tinsley1980">[docs]</a> <span class="k">def</span> <span class="nf">imf_tinsley1980</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Probability distribution function for Tinsley 1980 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 2.0, 10.0, 80.0, -2.0, -2.3, -3.3)</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">three_part_powerlaw</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">,</span> <span class="mf">10.0</span><span class="p">,</span> <span class="mf">80.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.3</span><span class="p">,</span> <span class="o">-</span><span class="mf">3.3</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.imf_scalo1986"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1986">[docs]</a> <span class="k">def</span> <span class="nf">imf_scalo1986</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Probability distribution function for Scalo 1986 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 1.0, 2.0, 80.0, -2.35, -2.35, -2.70)</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">three_part_powerlaw</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">,</span> <span class="mf">80.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.35</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.35</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.70</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.imf_scalo1998"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1998">[docs]</a> <span class="k">def</span> <span class="nf">imf_scalo1998</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> From Scalo 1998</span> + +<span class="sd"> Probability distribution function for Scalo 1998 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 1.0, 10.0, 80.0, -1.2, -2.7, -2.3)</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">three_part_powerlaw</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">10.0</span><span class="p">,</span> <span class="mf">80.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.2</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.7</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.3</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.imf_chabrier2003"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_chabrier2003">[docs]</a> <span class="k">def</span> <span class="nf">imf_chabrier2003</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Probability distribution function for IMF of Chabrier 2003 PASP 115:763-795</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of distribution function evaluated at m</span> +<span class="sd"> """</span> + + <span class="n">chabrier_logmc</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="mf">0.079</span><span class="p">)</span> + <span class="n">chabrier_sigma2</span> <span class="o">=</span> <span class="mf">0.69</span> <span class="o">*</span> <span class="mf">0.69</span> + <span class="n">chabrier_a1</span> <span class="o">=</span> <span class="mf">0.158</span> + <span class="n">chabrier_a2</span> <span class="o">=</span> <span class="mf">4.43e-2</span> + <span class="n">chabrier_x</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.3</span> + + <span class="k">if</span> <span class="n">m</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"below bounds"</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="k">if</span> <span class="mi">0</span> <span class="o"><</span> <span class="n">m</span> <span class="o"><</span> <span class="mf">1.0</span><span class="p">:</span> + <span class="n">dm</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">m</span><span class="p">)</span> <span class="o">-</span> <span class="n">chabrier_logmc</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">chabrier_a1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="p">(</span><span class="n">dm</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mf">2.0</span> <span class="o">*</span> <span class="n">chabrier_sigma2</span><span class="p">))</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">prob</span> <span class="o">=</span> <span class="n">chabrier_a2</span> <span class="o">*</span> <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="n">chabrier_x</span><span class="p">)</span> + + <span class="n">prob</span> <span class="o">=</span> <span class="n">prob</span> <span class="o">/</span> <span class="p">(</span><span class="mf">0.1202462</span> <span class="o">*</span> <span class="n">m</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span> + <span class="k">return</span> <span class="n">prob</span></div> + + <span class="c1">########################################################################</span> + <span class="c1"># Binary fractions</span> + <span class="c1">########################################################################</span> + +<div class="viewcode-block" id="distribution_functions.Arenou2010_binary_fraction"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Arenou2010_binary_fraction">[docs]</a> <span class="k">def</span> <span class="nf">Arenou2010_binary_fraction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Arenou 2010 function for the binary fraction as f(M1)</span> + +<span class="sd"> GAIA-C2-SP-OPM-FA-054</span> +<span class="sd"> www.rssd.esa.int/doc_fetch.php?id=2969346</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> binary fraction at m</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="mf">0.8388</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">tanh</span><span class="p">(</span><span class="mf">0.688</span> <span class="o">*</span> <span class="n">m</span> <span class="o">+</span> <span class="mf">0.079</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.raghavan2010_binary_fraction"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.raghavan2010_binary_fraction">[docs]</a> <span class="k">def</span> <span class="nf">raghavan2010_binary_fraction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Fit to the Raghavan 2010 binary fraction as a function of</span> +<span class="sd"> spectral type (Fig 12). Valid for local stars (Z=Zsolar).</span> + +<span class="sd"> The spectral type is converted mass by use of the ZAMS</span> +<span class="sd"> effective temperatures from binary_c/BSE (at Z=0.02)</span> +<span class="sd"> and the new "long_spectral_type" function of binary_c</span> +<span class="sd"> (based on Jaschek+Jaschek's Teff-spectral type table).</span> + +<span class="sd"> Rob then fitted the result</span> + +<span class="sd"> Args:</span> +<span class="sd"> m: mass to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> binary fraction at m</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="nb">min</span><span class="p">(</span> + <span class="mf">1.0</span><span class="p">,</span> + <span class="nb">max</span><span class="p">(</span> + <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="mf">0.1</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mf">5.12310e-01</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="mf">1.02070e-01</span><span class="p">),</span> + <span class="p">(</span><span class="mf">1.10450e00</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">m</span> <span class="o">**</span> <span class="p">(</span><span class="mf">4.93670e-01</span><span class="p">))</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="mf">6.95630e-01</span><span class="p">),</span> + <span class="p">),</span> + <span class="p">)</span></div> + + <span class="c1">########################################################################</span> + <span class="c1"># Period distributions</span> + <span class="c1">########################################################################</span> + +<div class="viewcode-block" id="distribution_functions.duquennoy1991"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.duquennoy1991">[docs]</a> <span class="k">def</span> <span class="nf">duquennoy1991</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">logper</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">])</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Period distribution from Duquennoy + Mayor 1991. Evaluated the function self.gaussian(logper, 4.8, 2.3, -2, 12)</span> + +<span class="sd"> Args:</span> +<span class="sd"> logper: logarithm of period to evaluate the distribution at</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' at self.gaussian(logper, 4.8, 2.3, -2, 12)</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">gaussian</span><span class="p">(</span><span class="n">logper</span><span class="p">,</span> <span class="mf">4.8</span><span class="p">,</span> <span class="mf">2.3</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.sana12"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.sana12">[docs]</a> <span class="k">def</span> <span class="nf">sana12</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">M1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">M2</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">a</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">P</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">amin</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">amax</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">x0</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">x1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">p</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> distribution of initial orbital periods as found by Sana et al. (2012)</span> +<span class="sd"> which is a flat distribution in ln(a) and ln(P) respectively for stars</span> +<span class="sd"> * less massive than 15Msun (no O-stars)</span> +<span class="sd"> * mass ratio q=M2/M1<0.1</span> +<span class="sd"> * log(P)<0.15=x0 and log(P)>3.5=x1</span> +<span class="sd"> and is be given by dp/dlogP ~ (logP)^p for all other binary configurations (default p=-0.55)</span> + +<span class="sd"> arguments are M1, M2, a, Period P, amin, amax, x0=log P0, x1=log P1, p</span> + +<span class="sd"> example args: 10, 5, sep(M1, M2, P), sep, ?, -2, 12, -0.55</span> + +<span class="sd"> # TODO: Fix this function! Half of the input here can be taken out and calculated within the function itself.</span> + +<span class="sd"> Args:</span> +<span class="sd"> M1: Mass of primary</span> +<span class="sd"> M2: Mass of secondary</span> +<span class="sd"> a: separation of binary</span> +<span class="sd"> P: period of binary</span> +<span class="sd"> amin: minimum separation of the distribution (lower bound of the range)</span> +<span class="sd"> amax: maximum separation of the distribution (upper bound of the range)</span> +<span class="sd"> x0: log of minimum period of the distribution (lower bound of the range)</span> +<span class="sd"> x1: log of maximum period of the distribution (upper bound of the range)</span> +<span class="sd"> p: slope of the distribution</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of orbital period P given the other parameters</span> +<span class="sd"> """</span> + + <span class="n">res</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">if</span> <span class="p">(</span><span class="n">M1</span> <span class="o"><</span> <span class="mf">15.0</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">M2</span> <span class="o">/</span> <span class="n">M1</span> <span class="o"><</span> <span class="mf">0.1</span><span class="p">):</span> + <span class="n">res</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">amax</span><span class="p">)</span> <span class="o">-</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">amin</span><span class="p">))</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">p1</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">+</span> <span class="n">p</span> + + <span class="c1"># For more details see the LyX document of binary_c for this distribution</span> + <span class="c1"># where the variables and normalisations are given</span> + <span class="c1"># we use the notation x=log(P), xmin=log(Pmin), x0=log(P0), ... to determine the</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">LOG_LN_CONVERTER</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">P</span><span class="p">)</span> + <span class="n">xmin</span> <span class="o">=</span> <span class="n">LOG_LN_CONVERTER</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">calc_period_from_sep</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="n">M2</span><span class="p">,</span> <span class="n">amin</span><span class="p">))</span> + <span class="n">xmax</span> <span class="o">=</span> <span class="n">LOG_LN_CONVERTER</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">calc_period_from_sep</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="n">M2</span><span class="p">,</span> <span class="n">amax</span><span class="p">))</span> + + <span class="n">A1</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="p">(</span> + <span class="n">x0</span> <span class="o">**</span> <span class="n">p</span> <span class="o">*</span> <span class="p">(</span><span class="n">x0</span> <span class="o">-</span> <span class="n">xmin</span><span class="p">)</span> + <span class="o">+</span> <span class="p">(</span><span class="n">x1</span> <span class="o">**</span> <span class="n">p1</span> <span class="o">-</span> <span class="n">x0</span> <span class="o">**</span> <span class="n">p1</span><span class="p">)</span> <span class="o">/</span> <span class="n">p1</span> + <span class="o">+</span> <span class="n">x1</span> <span class="o">**</span> <span class="n">p</span> <span class="o">*</span> <span class="p">(</span><span class="n">xmax</span> <span class="o">-</span> <span class="n">x1</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">A0</span> <span class="o">=</span> <span class="n">A1</span> <span class="o">*</span> <span class="n">x0</span> <span class="o">**</span> <span class="n">p</span> + <span class="n">A2</span> <span class="o">=</span> <span class="n">A1</span> <span class="o">*</span> <span class="n">x1</span> <span class="o">**</span> <span class="n">p</span> + + <span class="k">if</span> <span class="n">x</span> <span class="o"><</span> <span class="n">x0</span><span class="p">:</span> + <span class="n">res</span> <span class="o">=</span> <span class="n">A0</span> + <span class="k">elif</span> <span class="n">x</span> <span class="o">></span> <span class="n">x1</span><span class="p">:</span> + <span class="n">res</span> <span class="o">=</span> <span class="n">A2</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">res</span> <span class="o">=</span> <span class="n">A1</span> <span class="o">*</span> <span class="n">x</span> <span class="o">**</span> <span class="n">p</span> + <span class="n">res</span> <span class="o">*=</span> <span class="mf">3.0</span> <span class="o">/</span> <span class="mf">2.0</span> <span class="o">*</span> <span class="n">LOG_LN_CONVERTER</span> + <span class="k">return</span> <span class="n">res</span></div> + +<div class="viewcode-block" id="distribution_functions.interpolate_in_mass_izzard2012"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.interpolate_in_mass_izzard2012">[docs]</a> <span class="k">def</span> <span class="nf">interpolate_in_mass_izzard2012</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">M</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">high</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">low</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to interpolate in mass</span> + +<span class="sd"> TODO: fix this function.</span> +<span class="sd"> TODO: describe the args</span> +<span class="sd"> high: at M=16.3</span> +<span class="sd"> low: at 1.15</span> + +<span class="sd"> Args:</span> +<span class="sd"> M: mass</span> +<span class="sd"> high:</span> +<span class="sd"> low:</span> + +<span class="sd"> Returns:</span> + +<span class="sd"> """</span> + + <span class="n">log_interpolation</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="k">if</span> <span class="n">log_interpolation</span><span class="p">:</span> + <span class="k">return</span> <span class="p">(</span><span class="n">high</span> <span class="o">-</span> <span class="n">low</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="mf">16.3</span><span class="p">)</span> <span class="o">-</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="mf">1.15</span><span class="p">))</span> <span class="o">*</span> <span class="p">(</span> + <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">M</span><span class="p">)</span> <span class="o">-</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="mf">1.15</span><span class="p">)</span> + <span class="p">)</span> <span class="o">+</span> <span class="n">low</span> + <span class="k">return</span> <span class="p">(</span><span class="n">high</span> <span class="o">-</span> <span class="n">low</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mf">16.3</span> <span class="o">-</span> <span class="mf">1.15</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">M</span> <span class="o">-</span> <span class="mf">1.15</span><span class="p">)</span> <span class="o">+</span> <span class="n">low</span></div> + +<div class="viewcode-block" id="distribution_functions.Izzard2012_period_distribution"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Izzard2012_period_distribution">[docs]</a> <span class="k">def</span> <span class="nf">Izzard2012_period_distribution</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">P</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">M1</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">log10Pmin</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> period distribution which interpolates between</span> +<span class="sd"> Duquennoy and Mayor 1991 at low mass (G/K spectral type <~1.15Msun)</span> +<span class="sd"> and Sana et al 2012 at high mass (O spectral type >~16.3Msun)</span> + +<span class="sd"> This gives dN/dlogP, i.e. DM/Raghavan's Gaussian in log10P at low mass</span> +<span class="sd"> and Sana's power law (as a function of logP) at high mass</span> + +<span class="sd"> TODO: fix this function</span> + +<span class="sd"> Args:</span> +<span class="sd"> P: period</span> +<span class="sd"> M1: Primary star mass</span> +<span class="sd"> log10Pmin: minimum period in base log10 (optional)</span> + +<span class="sd"> Returns:</span> +<span class="sd"> 'probability' of interpolated distribution function at P and M1</span> + +<span class="sd"> """</span> + + <span class="c1"># Check if there is input and force it to be at least 1</span> + <span class="n">log10Pmin</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">log10Pmin</span><span class="p">)</span> + + <span class="c1"># save mass input and limit mass used (M1 from now on) to fitted range</span> + <span class="n">Mwas</span> <span class="o">=</span> <span class="n">M1</span> + <span class="n">M1</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mf">1.15</span><span class="p">,</span> <span class="nb">min</span><span class="p">(</span><span class="mf">16.3</span><span class="p">,</span> <span class="n">M1</span><span class="p">))</span> + + <span class="c1"># Calculate the normalisations</span> + <span class="c1"># need to normalise the distribution for this mass</span> + <span class="c1"># (and perhaps secondary mass)</span> + <span class="n">prepare_dict</span><span class="p">(</span><span class="n">distribution_constants</span><span class="p">,</span> <span class="p">[</span><span class="s2">"Izzard2012"</span><span class="p">,</span> <span class="n">M1</span><span class="p">])</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"Izzard2012"</span><span class="p">][</span><span class="n">M1</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">log10Pmin</span><span class="p">):</span> + <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"Izzard2012"</span><span class="p">][</span><span class="n">M1</span><span class="p">][</span> + <span class="n">log10Pmin</span> + <span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># To prevent this loop from going recursive</span> + <span class="n">N</span> <span class="o">=</span> <span class="mf">200.0</span> <span class="c1"># Resolution for normalisation. I hope 1000 is enough</span> + <span class="n">dlP</span> <span class="o">=</span> <span class="p">(</span><span class="mf">10.0</span> <span class="o">-</span> <span class="n">log10Pmin</span><span class="p">)</span> <span class="o">/</span> <span class="n">N</span> + <span class="n">C</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1"># normalisation constant.</span> + <span class="k">for</span> <span class="n">lP</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">log10Pmin</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="n">dlP</span><span class="p">):</span> + <span class="n">C</span> <span class="o">+=</span> <span class="n">dlP</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">Izzard2012_period_distribution</span><span class="p">(</span><span class="mi">10</span> <span class="o">**</span> <span class="n">lP</span><span class="p">,</span> <span class="n">M1</span><span class="p">,</span> <span class="n">log10Pmin</span><span class="p">)</span> + + <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"Izzard2012"</span><span class="p">][</span><span class="n">M1</span><span class="p">][</span><span class="n">log10Pmin</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">C</span> + + <span class="n">lP</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">P</span><span class="p">)</span> + <span class="c1"># log period</span> + + <span class="c1"># # fits</span> + <span class="n">mu</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">interpolate_in_mass_izzard2012</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="o">-</span><span class="mf">17.8</span><span class="p">,</span> <span class="mf">5.03</span><span class="p">)</span> + <span class="n">sigma</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">interpolate_in_mass_izzard2012</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mf">9.18</span><span class="p">,</span> <span class="mf">2.28</span><span class="p">)</span> + <span class="n">K</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">interpolate_in_mass_izzard2012</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mf">6.93e-2</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">)</span> + <span class="n">nu</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">interpolate_in_mass_izzard2012</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> + <span class="n">g</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">+</span> <span class="mf">1e-30</span> <span class="o">**</span> <span class="p">(</span><span class="n">lP</span> <span class="o">-</span> <span class="n">nu</span><span class="p">)</span> + <span class="n">lPmu</span> <span class="o">=</span> <span class="n">lP</span> <span class="o">-</span> <span class="n">mu</span> + + <span class="k">if</span> <span class="p">(</span><span class="n">lP</span> <span class="o"><</span> <span class="n">log10Pmin</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">lP</span> <span class="o">></span> <span class="mf">10.0</span><span class="p">):</span> + <span class="k">return</span> <span class="mi">0</span> + + <span class="k">return</span> <span class="p">(</span> + <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"Izzard2012"</span><span class="p">][</span><span class="n">M1</span><span class="p">][</span><span class="n">log10Pmin</span><span class="p">]</span> + <span class="o">*</span> <span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">lPmu</span> <span class="o">*</span> <span class="n">lPmu</span> <span class="o">/</span> <span class="p">(</span><span class="mf">2.0</span> <span class="o">*</span> <span class="n">sigma</span> <span class="o">*</span> <span class="n">sigma</span><span class="p">))</span> <span class="o">+</span> <span class="n">K</span> <span class="o">/</span> <span class="nb">max</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">lP</span><span class="p">))</span> + <span class="o">/</span> <span class="n">g</span> + <span class="p">)</span></div> + + <span class="c1">########################################################################</span> + <span class="c1"># Mass ratio distributions</span> + <span class="c1">########################################################################</span> +<div class="viewcode-block" id="distribution_functions.flatsections"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flatsections">[docs]</a> <span class="k">def</span> <span class="nf">flatsections</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">opts</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to generate flat distributions, possibly in multiple sections</span> + +<span class="sd"> Args:</span> +<span class="sd"> x: mass ratio value</span> +<span class="sd"> opts: list containing the flat sections. Which are themselves dictionaries, with keys "max": upper bound, "min": lower bound and "height": value</span> + +<span class="sd"> Returns:</span> +<span class="sd"> probability of that mass ratio.</span> +<span class="sd"> """</span> + + <span class="n">c</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">y</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">for</span> <span class="n">opt</span> <span class="ow">in</span> <span class="n">opts</span><span class="p">:</span> + <span class="n">dc</span> <span class="o">=</span> <span class="p">(</span><span class="n">opt</span><span class="p">[</span><span class="s2">"max"</span><span class="p">]</span> <span class="o">-</span> <span class="n">opt</span><span class="p">[</span><span class="s2">"min"</span><span class="p">])</span> <span class="o">*</span> <span class="n">opt</span><span class="p">[</span><span class="s2">"height"</span><span class="p">]</span> + <span class="n">c</span> <span class="o">+=</span> <span class="n">dc</span> + <span class="k">if</span> <span class="n">opt</span><span class="p">[</span><span class="s2">"min"</span><span class="p">]</span> <span class="o"><=</span> <span class="n">x</span> <span class="o"><=</span> <span class="n">opt</span><span class="p">[</span><span class="s2">"max"</span><span class="p">]:</span> + <span class="n">y</span> <span class="o">=</span> <span class="n">opt</span><span class="p">[</span><span class="s2">"height"</span><span class="p">]</span> + <span class="n">y</span> <span class="o">/=</span> <span class="n">c</span> + <span class="k">return</span> <span class="n">y</span></div> + + <span class="c1">########################################################################</span> + <span class="c1"># Eccentricity distributions</span> + <span class="c1">########################################################################</span> + + <span class="c1">########################################################################</span> + <span class="c1"># Star formation histories</span> + <span class="c1">########################################################################</span> + +<div class="viewcode-block" id="distribution_functions.cosmic_SFH_madau_dickinson2014"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.cosmic_SFH_madau_dickinson2014">[docs]</a> <span class="k">def</span> <span class="nf">cosmic_SFH_madau_dickinson2014</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">z</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Cosmic star formation history distribution from Madau & Dickonson 2014 (https://arxiv.org/pdf/1403.0007.pdf)</span> + +<span class="sd"> Args:</span> +<span class="sd"> z: redshift</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Cosmic star formation rate in Solar mass year^-1 mega parsec^-3</span> +<span class="sd"> """</span> + + <span class="n">CSFH</span> <span class="o">=</span> <span class="mf">0.015</span> <span class="o">*</span> <span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">z</span><span class="p">)</span> <span class="o">**</span> <span class="mf">2.7</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="p">(((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">z</span><span class="p">)</span> <span class="o">/</span> <span class="mf">2.9</span><span class="p">)</span> <span class="o">**</span> <span class="mf">5.6</span><span class="p">))</span> + <span class="k">return</span> <span class="n">CSFH</span></div> + + <span class="c1">########################################################################</span> + <span class="c1"># Metallicity distributions</span> + <span class="c1">########################################################################</span> + + <span class="c1">########################################################################</span> + <span class="c1"># Moe & DiStefano 2017 functions</span> + <span class="c1">#</span> + <span class="c1"># The code below are functions that are used to set up and interpolate</span> + <span class="c1"># on the Moe & DiStefano 2017 data. The interpolators take the last</span> + <span class="c1"># known value if we try to interpolate outside of the tables.</span> + <span class="c1"># There are still some open tasks and improvements that can be made:</span> + <span class="c1">#</span> + <span class="c1"># TODO: Parallelize the setting up of the interpolators</span> + <span class="c1"># TODO: Generalise the code such that we can input other/newer tables.</span> + <span class="c1">########################################################################</span> + +<div class="viewcode-block" id="distribution_functions.poisson"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.poisson">[docs]</a> <span class="k">def</span> <span class="nf">poisson</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">lambda_val</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">nmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that calculates the Poisson value and normalises</span> +<span class="sd"> TODO: improve the description</span> +<span class="sd"> """</span> + + <span class="n">cachekey</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2"> </span><span class="si">{}</span><span class="s2"> </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">lambda_val</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">nmax</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">distribution_constants</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"poisson_cache"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="k">if</span> <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"poisson_cache"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">cachekey</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"poisson_cache"</span><span class="p">][</span><span class="n">cachekey</span><span class="p">]</span> + <span class="k">return</span> <span class="n">p_val</span> + + <span class="c1"># Poisson distribution : note, n can be zero</span> + <span class="c1">#</span> + <span class="c1"># nmax is the truncation : if set, we normalise</span> + <span class="c1"># correctly.</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_poisson</span><span class="p">(</span><span class="n">lambda_val</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">nmax</span><span class="p">:</span> + <span class="n">I_poisson</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nmax</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span> + <span class="n">I_poisson</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_poisson</span><span class="p">(</span><span class="n">lambda_val</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> + <span class="n">p_val</span> <span class="o">/=</span> <span class="n">I_poisson</span> + + <span class="c1"># Add to cache</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">distribution_constants</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"poisson_cache"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"poisson_cache"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">distribution_constants</span><span class="p">[</span><span class="s2">"poisson_cache"</span><span class="p">][</span><span class="n">cachekey</span><span class="p">]</span> <span class="o">=</span> <span class="n">p_val</span> + + <span class="k">return</span> <span class="n">p_val</span></div> + + <span class="k">def</span> <span class="nf">_poisson</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">lambda_val</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the Poisson value</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="p">(</span><span class="n">lambda_val</span> <span class="o">**</span> <span class="n">n</span><span class="p">)</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">lambda_val</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">factorial</span><span class="p">(</span><span class="n">n</span><span class="p">))</span> + +<div class="viewcode-block" id="distribution_functions.get_max_multiplicity"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_max_multiplicity">[docs]</a> <span class="k">def</span> <span class="nf">get_max_multiplicity</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">multiplicity_array</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to get the maximum multiplicity</span> +<span class="sd"> """</span> + <span class="n">max_multiplicity</span> <span class="o">=</span> <span class="mi">0</span> + <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">):</span> + <span class="k">if</span> <span class="n">multiplicity_array</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">max_multiplicity</span> <span class="o">=</span> <span class="n">n</span> <span class="o">+</span> <span class="mi">1</span> + <span class="k">return</span> <span class="n">max_multiplicity</span></div> + +<div class="viewcode-block" id="distribution_functions.merge_multiplicities"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.merge_multiplicities">[docs]</a> <span class="k">def</span> <span class="nf">merge_multiplicities</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">result_array</span><span class="p">,</span> <span class="n">max_multiplicity</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to fold the multiplicities higher than the max_multiplicity onto the max_multiplicity</span> + +<span class="sd"> if max_multiplicity == 1:</span> +<span class="sd"> All the multiplicities are folded onto multiplicity == 1. This will always total to 1</span> +<span class="sd"> if max_multiplicity == 2:</span> +<span class="sd"> The multiplicity fractions of the triple and quadruples are folded onto that of the binary multiplicity fraction</span> +<span class="sd"> if max_multiplicity == 3:</span> +<span class="sd"> The multiplicity fractions of the quadruples are folded onto that of the triples</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">max_multiplicity</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">):</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: merge_multiplicities: max_multiplicity has to be between 1 and 4. It is </span><span class="si">{}</span><span class="s2"> now"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">max_multiplicity</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Fold multiplicities:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: merge_multiplicities: Merging multiplicities with initial array </span><span class="si">{}</span><span class="s2"> and max multiplicity </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">result_array</span><span class="p">,</span> <span class="n">max_multiplicity</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">max_multiplicity</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">result_array</span><span class="p">))[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]:</span> + <span class="n">result_array</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="n">result_array</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> + <span class="n">result_array</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: merge_multiplicities: Merging multiplicities to new array </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">result_array</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="n">result_array</span></div> + +<div class="viewcode-block" id="distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions">[docs]</a> <span class="k">def</span> <span class="nf">Moe_di_Stefano_2017_multiplicity_fractions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that creates a list of probability fractions and</span> +<span class="sd"> normalises and merges them according to the users choice.</span> + +<span class="sd"> TODO: make an extrapolation functionality in this. log10(1.6e1)</span> +<span class="sd"> is quite low.</span> + +<span class="sd"> The default result that is returned when sampling the mass outside</span> +<span class="sd"> of the mass range is now the last known value</span> + +<span class="sd"> Returns a list of multiplicity fractions for a given input of mass</span> +<span class="sd"> """</span> + + <span class="c1"># Use the global Moecache</span> + <span class="k">global</span> <span class="n">Moecache</span> + + <span class="n">multiplicity_modulator_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"multiplicity_modulator"</span><span class="p">]</span> + <span class="p">)</span> <span class="c1"># Modulator array</span> + + <span class="c1"># Check for length</span> + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">multiplicity_modulator_array</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">4</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Multiplicity modulator has to have 4 elements. Now it is </span><span class="si">{}</span><span class="s2">, len: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">multiplicity_modulator_array</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">multiplicity_modulator_array</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Set up some arrays</span> + <span class="n">full_fractions_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="c1"># Meant to contain the real fractions</span> + <span class="n">weighted_fractions_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span> + <span class="mi">4</span> + <span class="p">)</span> <span class="c1"># Meant to contain the fractions multiplied by the multiplicity modulator</span> + + <span class="c1"># Get max multiplicity</span> + <span class="n">max_multiplicity</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_max_multiplicity</span><span class="p">(</span><span class="n">multiplicity_modulator_array</span><span class="p">)</span> + + <span class="c1"># ... it's better to interpolate the multiplicity and then</span> + <span class="c1"># use a Poisson distribution to calculate the fractions</span> + <span class="c1"># (this is more accurate)</span> + + <span class="c1"># Set up the multiplicity interpolator</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_multiplicity"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_multiplicity"</span><span class="p">]</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"multiplicity_table"</span><span class="p">],</span> <span class="c1"># Contains the table of data</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># logM1</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="c1"># The number of datapoints (the parameters that we want to interpolate)</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> <span class="o">-</span> <span class="p">(</span><span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">options</span><span class="p">[</span><span class="s2">"multiplicity_model"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"Poisson"</span><span class="p">:</span> + <span class="n">multiplicity</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_multiplicity"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">])]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + + <span class="c1"># Fill the multiplicity array</span> + <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">):</span> + <span class="n">full_fractions_array</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">poisson</span><span class="p">(</span><span class="n">multiplicity</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> + + <span class="c1"># Normalize it so it fills to one when taking all the multiplicities:</span> + <span class="n">full_fractions_array</span> <span class="o">=</span> <span class="n">full_fractions_array</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">full_fractions_array</span><span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: using model </span><span class="si">{}</span><span class="s2">: full_fractions_array: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"Poisson"</span><span class="p">,</span> <span class="n">full_fractions_array</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">elif</span> <span class="n">options</span><span class="p">[</span><span class="s2">"multiplicity_model"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"data"</span><span class="p">:</span> + <span class="c1"># use the fractions calculated from Moe's data directly</span> + <span class="c1">#</span> + <span class="c1"># note that in this case, there are no quadruples: these</span> + <span class="c1"># are combined with triples</span> + + <span class="c1"># Fill with the raw values</span> + <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">):</span> + <span class="n">full_fractions_array</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"rinterpolator_multiplicity"</span> + <span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">])])[</span><span class="n">n</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span> + + <span class="c1"># Set last value</span> + <span class="n">full_fractions_array</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.0</span> <span class="c1"># no quadruples</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: using model </span><span class="si">{}</span><span class="s2">: full_fractions_array: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"data"</span><span class="p">,</span> <span class="n">full_fractions_array</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Normalisation:</span> + <span class="k">if</span> <span class="n">options</span><span class="p">[</span><span class="s2">"normalize_multiplicities"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"raw"</span><span class="p">:</span> + <span class="c1"># Don't multiply by the multiplicity_array, but do give a fractions array</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: Not normalising (using raw results): results: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">full_fractions_array</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="n">result</span> <span class="o">=</span> <span class="n">full_fractions_array</span> + + <span class="k">elif</span> <span class="n">options</span><span class="p">[</span><span class="s2">"normalize_multiplicities"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"norm"</span><span class="p">:</span> + <span class="c1"># Multiply the full_multiplicity_fraction array by the multiplicity_multiplier_array, creating a weighted fractions array</span> + <span class="n">weighted_fractions_array</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">full_fractions_array</span> <span class="o">*</span> <span class="n">multiplicity_modulator_array</span> + <span class="p">)</span> + + <span class="c1"># Normalise this so it is in total 1:</span> + <span class="n">result</span> <span class="o">=</span> <span class="n">weighted_fractions_array</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">weighted_fractions_array</span><span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: Normalising with </span><span class="si">{}</span><span class="s2">. result: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"norm"</span><span class="p">,</span> <span class="n">result</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">elif</span> <span class="n">options</span><span class="p">[</span><span class="s2">"normalize_multiplicities"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"merge"</span><span class="p">:</span> + <span class="c1"># We first take the full multiplicity array</span> + <span class="c1"># (i.e. not multiplied by multiplier) and do the merging</span> + <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">merge_multiplicities</span><span class="p">(</span> + <span class="n">full_fractions_array</span><span class="p">,</span> <span class="n">max_multiplicity</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="p">)</span> + + <span class="c1"># Then normalise to be sure</span> + <span class="n">result</span> <span class="o">=</span> <span class="n">result</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">result</span><span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: Normalising with </span><span class="si">{}</span><span class="s2">, max_multiplicity=</span><span class="si">{}</span><span class="s2"> result=</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"merge"</span><span class="p">,</span> <span class="n">max_multiplicity</span><span class="p">,</span> <span class="n">result</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: Moe_di_Stefano_2017_multiplicity_fractions: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">str</span><span class="p">(</span><span class="n">result</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># return array reference</span> + <span class="k">return</span> <span class="n">result</span></div> + +<div class="viewcode-block" id="distribution_functions.build_q_table"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.build_q_table">[docs]</a> <span class="k">def</span> <span class="nf">build_q_table</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Build an interpolation table for q, given a mass and</span> +<span class="sd"> orbital period.</span> + +<span class="sd"> m and p are labels which determine which system(s)</span> +<span class="sd"> to look up from Moe's data:</span> + +<span class="sd"> m can be M1, M2, M3, M4, or if set M1+M2 etc.</span> +<span class="sd"> p can be P, P2, P3</span> + +<span class="sd"> The actual values are in $opts:</span> + +<span class="sd"> mass is in $opts->{m}</span> +<span class="sd"> period is $opts->{p}</span> + +<span class="sd"> Since the information from the table for Moe and di Stefano 2017 is independent of any choice we make,</span> +<span class="sd"> we need to take into account that for example our choice of minimum mass leads to</span> +<span class="sd"> a minimum q_min that is not the same as in the table</span> +<span class="sd"> We should ignore those parts of the table and renormalise.</span> +<span class="sd"> If we are below the lowest value of qmin in the table we need to extrapolate the data</span> + +<span class="sd"> Anyway, the goal of this function is to provide some extrapolated values for q when we should sample outside of the boundaries</span> +<span class="sd"> TODO: fix description to be correct for python</span> +<span class="sd"> """</span> + + <span class="c1"># We can check if we have a cached value for this already:</span> + <span class="c1"># TODO: fix this cache check.</span> + <span class="n">incache</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">if</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="k">if</span> <span class="p">(</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span> <span class="ow">and</span> <span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="p">):</span> + <span class="k">if</span> <span class="p">(</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">][</span><span class="n">m</span><span class="p">]</span> <span class="o">==</span> <span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">])</span> <span class="ow">and</span> <span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">][</span><span class="n">p</span><span class="p">]</span> <span class="o">==</span> <span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]</span> + <span class="p">):</span> + <span class="n">incache</span> <span class="o">=</span> <span class="kc">True</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Found cached values for m=</span><span class="si">{}</span><span class="s2"> p=</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Cached values for different m=</span><span class="si">{}</span><span class="s2"> p=</span><span class="si">{}</span><span class="s2">. Freeing current table and making new table"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1">#</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">incache</span><span class="p">:</span> + <span class="c1"># trim and/or expand the table to the range qmin to qmax.</span> + + <span class="c1"># qmin is set by the minimum stellar mass</span> + <span class="n">qmin</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"Mmin"</span><span class="p">]</span> <span class="o">/</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table qmin: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">qmin</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># qmax = maximum_mass_ratio_for_RLOF(options[m], options[p])</span> + <span class="c1"># TODO: change this to the above</span> + <span class="n">qmax</span> <span class="o">=</span> <span class="mi">1</span> + + <span class="c1"># qdata contains the table that we modify: we get</span> + <span class="c1"># the original data by interpolating Moe's table</span> + <span class="n">qdata</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">can_renormalize</span> <span class="o">=</span> <span class="mi">1</span> + + <span class="n">qeps</span> <span class="o">=</span> <span class="mf">1e-8</span> <span class="c1"># small number but such that qeps+1 != 1</span> + <span class="k">if</span> <span class="n">qeps</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">==</span> <span class="mf">1.0</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: qeps (= </span><span class="si">{}</span><span class="s2">) +1 == 1. Make qeps larger"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">qeps</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">qmin</span> <span class="o">>=</span> <span class="n">qmax</span><span class="p">:</span> + <span class="c1"># there may be NO binaries in this part of the parameter space:</span> + <span class="c1"># in which case, set up a table with lots of zero in it</span> + + <span class="n">qdata</span> <span class="o">=</span> <span class="p">{</span><span class="mi">0</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span> + <span class="n">can_renormalize</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="k">else</span><span class="p">:</span> + <span class="c1"># qmin and qmax mean we'll get something non-zero</span> + <span class="n">can_renormalize</span> <span class="o">=</span> <span class="mi">1</span> + + <span class="c1"># require extrapolation sets whether we need to extrapolate</span> + <span class="c1"># at the low and high ends</span> + <span class="n">require_extrapolation</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="k">if</span> <span class="n">qmin</span> <span class="o">>=</span> <span class="mf">0.15</span><span class="p">:</span> + <span class="c1"># qmin is inside Moe's table : this is easy,</span> + <span class="c1"># we just keep points from qmin at the low</span> + <span class="c1"># end to qmax at the high end.</span> + <span class="n">require_extrapolation</span><span class="p">[</span><span class="s2">"low"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">require_extrapolation</span><span class="p">[</span> + <span class="s2">"high"</span> + <span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># TODO: shouldn't the extrapolation need to happen if qmax > 0.95</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qmin</span><span class="p">]</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]),</span> <span class="n">qmin</span><span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + + <span class="k">for</span> <span class="n">q</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mf">0.15</span><span class="p">,</span> <span class="mf">0.950001</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">):</span> + <span class="k">if</span> <span class="n">qmin</span><span class="o"><=</span> <span class="n">q</span> <span class="o"><=</span> <span class="n">qmax</span><span class="p">:</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]),</span> <span class="n">q</span><span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">require_extrapolation</span><span class="p">[</span><span class="s2">"low"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> + <span class="n">require_extrapolation</span><span class="p">[</span><span class="s2">"high"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> + <span class="k">if</span> <span class="n">qmax</span> <span class="o"><</span> <span class="mf">0.15</span><span class="p">:</span> + <span class="c1"># qmax < 0.15 which is off the edge</span> + <span class="c1"># of the table. In this case, choose</span> + <span class="c1"># two points at q=0.15 and 0.16 and interpolate</span> + <span class="c1"># at these in case we want to extrapolate.</span> + <span class="k">for</span> <span class="n">q</span> <span class="ow">in</span> <span class="p">[</span><span class="mf">0.15</span><span class="p">,</span> <span class="mf">0.16</span><span class="p">]:</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]),</span> <span class="n">q</span><span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># qmin < 0.15 and qmax > 0.15, so we</span> + <span class="c1"># have to generate Moe's table for</span> + <span class="c1"># q = 0.15 (i.e. 0.1 to 0.2) to 0.95 (0.9 to 1)</span> + <span class="c1"># as a function of M1 and orbital period,</span> + <span class="c1"># to obtain the q distribution data.</span> + + <span class="k">for</span> <span class="n">q</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span> + <span class="mf">0.15</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">([</span><span class="mf">0.950001</span><span class="p">,</span> <span class="n">qmax</span> <span class="o">+</span> <span class="mf">0.0001</span><span class="p">]),</span> <span class="mf">0.1</span> + <span class="p">):</span> + <span class="n">val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]),</span> <span class="n">q</span><span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]</span> <span class="o">=</span> <span class="n">val</span> + + <span class="c1"># just below qmin, if qmin>qeps, we want nothing</span> + <span class="k">if</span> <span class="n">qmin</span> <span class="o">-</span> <span class="mf">0.15</span> <span class="o">></span> <span class="n">qeps</span><span class="p">:</span> + <span class="n">q</span> <span class="o">=</span> <span class="n">qmin</span> <span class="o">-</span> <span class="n">qeps</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">require_extrapolation</span><span class="p">[</span><span class="s2">"low"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="c1"># just above qmax, if qmax<1, we want nothing</span> + <span class="k">if</span> <span class="n">qmax</span> <span class="o"><</span> <span class="mf">0.95</span><span class="p">:</span> + <span class="n">q</span> <span class="o">=</span> <span class="n">qmax</span> <span class="o">+</span> <span class="n">qeps</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">require_extrapolation</span><span class="p">[</span><span class="s2">"high"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="c1"># sorted list of qs</span> + <span class="n">qs</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">qdata</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">qs</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"No qs found error"</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">qs</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="c1"># only one q value : pretend there are two</span> + <span class="c1"># with a flat distribution up to 1.0.</span> + <span class="k">if</span> <span class="n">qs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="mf">1.0</span><span class="p">:</span> + <span class="n">qs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">-</span> <span class="mf">1e-6</span> + <span class="n">qs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="mi">1</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="mi">1</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">qs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">qs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + + <span class="c1"># We actually should do the extrapolation now.</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># Loop over both the lower end and the upper end</span> + <span class="k">for</span> <span class="n">pre</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"low"</span><span class="p">,</span> <span class="s2">"high"</span><span class="p">]:</span> + <span class="k">if</span> <span class="n">require_extrapolation</span><span class="p">[</span><span class="n">pre</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="k">continue</span> + + <span class="n">sign</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="k">if</span> <span class="n">pre</span> <span class="o">==</span> <span class="s2">"low"</span> <span class="k">else</span> <span class="mi">1</span> + <span class="n">end_index</span> <span class="o">=</span> <span class="mi">0</span> <span class="k">if</span> <span class="n">pre</span> <span class="o">==</span> <span class="s2">"low"</span> <span class="k">else</span> <span class="nb">len</span><span class="p">(</span><span class="n">qs</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span> + <span class="n">indices</span> <span class="o">=</span> <span class="p">(</span> + <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="n">pre</span> <span class="o">==</span> <span class="s2">"low"</span> <span class="k">else</span> <span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">qs</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">qs</span><span class="p">)</span> <span class="o">-</span> <span class="mi">2</span><span class="p">]</span> + <span class="p">)</span> <span class="c1"># Based on whether we do the high or low end we need to use two different indices</span> + <span class="n">method</span> <span class="o">=</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span> + <span class="s2">"q_</span><span class="si">{}</span><span class="s2">_extrapolation_method"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">pre</span><span class="p">),</span> <span class="kc">None</span> + <span class="p">)</span> + <span class="n">qlimit</span> <span class="o">=</span> <span class="n">qmin</span> <span class="k">if</span> <span class="n">pre</span> <span class="o">==</span> <span class="s2">"low"</span> <span class="k">else</span> <span class="n">qmax</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Extrapolating: Q: </span><span class="si">{}</span><span class="s2"> method: </span><span class="si">{}</span><span class="s2">, indices: </span><span class="si">{}</span><span class="s2"> End index: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">pre</span><span class="p">,</span> <span class="n">method</span><span class="p">,</span> <span class="n">indices</span><span class="p">,</span> <span class="n">end_index</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># truncate the distribution</span> + <span class="n">qdata</span><span class="p">[</span><span class="nb">max</span><span class="p">(</span><span class="mf">0.0</span><span class="p">,</span> <span class="nb">min</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">qlimit</span> <span class="o">+</span> <span class="n">sign</span> <span class="o">*</span> <span class="n">qeps</span><span class="p">))]</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="k">if</span> <span class="n">method</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="c1"># no extrapolation : just interpolate between 0.10 and 0.95</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: using no extrapolations"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">continue</span> + <span class="k">if</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">"flat"</span><span class="p">:</span> + <span class="c1"># use the end value and extrapolate it</span> + <span class="c1"># with zero slope</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qlimit</span><span class="p">]</span> <span class="o">=</span> <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">end_index</span><span class="p">]]</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: using constant extrapolation"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">"linear"</span><span class="p">:</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qlimit</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">linear_extrapolation_q</span><span class="p">(</span> + <span class="n">qs</span><span class="o">=</span><span class="n">qs</span><span class="p">,</span> + <span class="n">indices</span><span class="o">=</span><span class="n">indices</span><span class="p">,</span> + <span class="n">qlimit</span><span class="o">=</span><span class="n">qlimit</span><span class="p">,</span> + <span class="n">qdata</span><span class="o">=</span><span class="n">qdata</span><span class="p">,</span> + <span class="n">end_index</span><span class="o">=</span><span class="n">end_index</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: using linear extrapolation"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">pre</span> <span class="o">==</span> <span class="s2">"low"</span><span class="p">:</span> + <span class="n">below_qlimit</span> <span class="o">=</span> <span class="n">qlimit</span> <span class="o">-</span> <span class="n">qeps</span> + <span class="k">if</span> <span class="n">below_qlimit</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">below_qlimit</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">qdata</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: using linear extrapolation and setting the points below the lower q bound (</span><span class="si">{}</span><span class="s2">) to 0 "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">qlimit</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">elif</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">"plaw2"</span><span class="p">:</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qlimit</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">powerlaw_extrapolation_q</span><span class="p">(</span> + <span class="n">qs</span><span class="o">=</span><span class="n">qs</span><span class="p">,</span> + <span class="n">indices</span><span class="o">=</span><span class="n">indices</span><span class="p">,</span> + <span class="n">qdata</span><span class="o">=</span><span class="n">qdata</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: using powerlaw extrapolation"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">"nolowq"</span><span class="p">:</span> + <span class="n">newq</span> <span class="o">=</span> <span class="mf">0.05</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">newq</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: setting lowq to 0"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">"poly"</span><span class="p">:</span> + <span class="c1"># TODO: consider implementing the poly method (see Perl version)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span> + <span class="s2">"Moe and di Stefano 2017: build_q_table: Method 'poly' not implemented"</span> + <span class="p">)</span> + + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Error no other methods available. The chosen method (</span><span class="si">{}</span><span class="s2">) does not exist!"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">method</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># regenerate qs in new table. This is now the updated list of qs where we have some extrapolated numbers</span> + <span class="n">tmp_table</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">for</span> <span class="n">q</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">qdata</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span> + <span class="n">tmp_table</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">q</span><span class="p">,</span> <span class="n">qdata</span><span class="p">[</span><span class="n">q</span><span class="p">]])</span> + + <span class="c1"># Make an interpolation table to contain our modified data</span> + <span class="n">q_interpolator</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">tmp_table</span><span class="p">,</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># Contains the table of data # q #</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> <span class="o">-</span> <span class="p">(</span><span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Created a new Q table"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">can_renormalize</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Renormalising table"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># now we integrate and renormalise (if the table is not all zero)</span> + <span class="n">I</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_integration_constant_q</span><span class="p">(</span> + <span class="n">q_interpolator</span><span class="p">,</span> <span class="n">tmp_table</span><span class="p">,</span> <span class="n">qdata</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">I</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="c1"># normalise to 1.0 by dividing the data by 1.0/$I</span> + <span class="n">q_interpolator</span><span class="o">.</span><span class="n">multiply_table_column</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">I</span><span class="p">)</span> + + <span class="c1"># test this</span> + <span class="n">new_I</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_integration_constant_q</span><span class="p">(</span> + <span class="n">q_interpolator</span><span class="p">,</span> <span class="n">tmp_table</span><span class="p">,</span> <span class="n">qdata</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="p">)</span> + + <span class="c1"># fail if error in integral > 1e-6 (should be ~ machine precision)</span> + <span class="k">if</span> <span class="nb">abs</span><span class="p">(</span><span class="mf">1.0</span> <span class="o">-</span> <span class="n">new_I</span><span class="p">)</span> <span class="o">></span> <span class="mf">1e-6</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: Error: > 1e-6 in q probability integral: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">I</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># set this new table in the cache</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">p</span><span class="p">)]</span> <span class="o">=</span> <span class="n">q_interpolator</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: stored q_interpolater as </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Store the values for which this table was set up in the dict</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">][</span><span class="n">m</span><span class="p">]</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="n">m</span><span class="p">]</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q_metadata"</span><span class="p">][</span><span class="n">p</span><span class="p">]</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="n">p</span><span class="p">]</span></div> + +<div class="viewcode-block" id="distribution_functions.powerlaw_extrapolation_q"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_extrapolation_q">[docs]</a> <span class="k">def</span> <span class="nf">powerlaw_extrapolation_q</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">qdata</span><span class="p">,</span> <span class="n">qs</span><span class="p">,</span> <span class="n">indices</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to do the power-law extrapolation at the lower end of the q range</span> +<span class="sd"> """</span> + <span class="n">newq</span> <span class="o">=</span> <span class="mf">0.05</span> + + <span class="c1"># use a power-law extrapolation down to q=0.05, if possible</span> + <span class="k">if</span> <span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]]</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">1</span><span class="p">]]]</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">):</span> + <span class="c1"># not possible</span> + <span class="k">return</span> <span class="mi">0</span> + + <span class="k">else</span><span class="p">:</span> + <span class="n">slope</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">1</span><span class="p">]]])</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]])</span> + <span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]))</span> + <span class="n">intercept</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]])</span> <span class="o">-</span> <span class="n">slope</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span> + <span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="n">slope</span> <span class="o">*</span> <span class="n">newq</span> <span class="o">+</span> <span class="n">intercept</span></div> + +<div class="viewcode-block" id="distribution_functions.linear_extrapolation_q"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.linear_extrapolation_q">[docs]</a> <span class="k">def</span> <span class="nf">linear_extrapolation_q</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">qs</span><span class="p">,</span> <span class="n">indices</span><span class="p">,</span> <span class="n">qlimit</span><span class="p">,</span> <span class="n">qdata</span><span class="p">,</span> <span class="n">end_index</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to do the linear extrapolation for q.</span> +<span class="sd"> """</span> + + <span class="c1"># linear extrapolation</span> + <span class="n">dq</span> <span class="o">=</span> <span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">1</span><span class="p">]]</span> <span class="o">-</span> <span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> + + <span class="k">if</span> <span class="n">dq</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: linear dq=0"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># No change</span> + <span class="k">return</span> <span class="n">qs</span><span class="p">[</span><span class="n">end_index</span><span class="p">]</span> + + <span class="n">slope</span> <span class="o">=</span> <span class="p">(</span><span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">1</span><span class="p">]]]</span> <span class="o">-</span> <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]])</span> <span class="o">/</span> <span class="n">dq</span> + + <span class="n">intercept</span> <span class="o">=</span> <span class="n">qdata</span><span class="p">[</span><span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]]</span> <span class="o">-</span> <span class="n">slope</span> <span class="o">*</span> <span class="n">qs</span><span class="p">[</span><span class="n">indices</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> + <span class="n">qdata</span><span class="p">[</span><span class="n">qlimit</span><span class="p">]</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">slope</span> <span class="o">*</span> <span class="n">qlimit</span> <span class="o">+</span> <span class="n">intercept</span><span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: build_q_table: linear Slope: </span><span class="si">{}</span><span class="s2"> intercept: </span><span class="si">{}</span><span class="s2"> dn/dq(</span><span class="si">{}</span><span class="s2">) = </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">slope</span><span class="p">,</span> <span class="n">intercept</span><span class="p">,</span> <span class="n">qlimit</span><span class="p">,</span> <span class="n">qdata</span><span class="p">[</span><span class="n">qlimit</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">return</span> <span class="nb">max</span><span class="p">(</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">slope</span> <span class="o">*</span> <span class="n">qlimit</span> <span class="o">+</span> <span class="n">intercept</span><span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.get_integration_constant_q"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_integration_constant_q">[docs]</a> <span class="k">def</span> <span class="nf">get_integration_constant_q</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">q_interpolator</span><span class="p">,</span> <span class="n">tmp_table</span><span class="p">,</span> <span class="n">qdata</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to integrate the q interpolator and return the integration constant</span> +<span class="sd"> """</span> + + <span class="n">dq</span> <span class="o">=</span> <span class="mf">1e-3</span> <span class="c1"># resolution of the integration/renormalisation</span> + <span class="n">I</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="c1"># integrate: note that the value of the integral is</span> + <span class="c1"># meaningless to within a factor (which depends on $dq)</span> + <span class="k">for</span> <span class="n">q</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span> <span class="o">+</span> <span class="mf">2e-6</span><span class="p">,</span> <span class="n">dq</span><span class="p">):</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">q_interpolator</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">q</span><span class="p">])</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: get_integration_constant_q: Q interpolator table interpolation failed.</span><span class="se">\n\t\t</span><span class="s2">tmp_table = </span><span class="si">{}</span><span class="se">\n\t\t</span><span class="s2">q_data = </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">str</span><span class="p">(</span><span class="n">tmp_table</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">qdata</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="n">I</span> <span class="o">+=</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="n">dq</span> + <span class="k">return</span> <span class="n">I</span></div> + +<div class="viewcode-block" id="distribution_functions.fill_data"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.fill_data">[docs]</a> <span class="k">def</span> <span class="nf">fill_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sample_values</span><span class="p">,</span> <span class="n">data_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the normalised array of values for given logmass and logperiod</span> +<span class="sd"> used for the e and q values</span> + +<span class="sd"> TODO: make sure we do the correct thing with the dstep</span> +<span class="sd"> """</span> + + <span class="n">data</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">I</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="n">dstep</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">sample_values</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="o">-</span> <span class="nb">float</span><span class="p">(</span><span class="n">sample_values</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> + + <span class="c1"># Read out the data</span> + <span class="k">for</span> <span class="n">sample_value</span> <span class="ow">in</span> <span class="n">sample_values</span><span class="p">:</span> + <span class="n">val</span> <span class="o">=</span> <span class="n">data_dict</span><span class="p">[</span><span class="n">sample_value</span><span class="p">]</span> + <span class="n">data</span><span class="p">[</span><span class="n">sample_value</span><span class="p">]</span> <span class="o">=</span> <span class="n">val</span> + <span class="n">I</span> <span class="o">+=</span> <span class="n">val</span> + + <span class="c1"># Normalise the data</span> + <span class="k">for</span> <span class="n">sample_value</span> <span class="ow">in</span> <span class="n">sample_values</span><span class="p">:</span> + <span class="n">data</span><span class="p">[</span><span class="n">sample_value</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">sample_value</span><span class="p">]</span> <span class="o">/</span> <span class="n">I</span> + + <span class="k">return</span> <span class="n">data</span></div> + +<div class="viewcode-block" id="distribution_functions.calc_e_integral"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_e_integral">[docs]</a> <span class="k">def</span> <span class="nf">calc_e_integral</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">options</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">period_string</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to calculate the e integral</span> + +<span class="sd"> We need to renormalise this because min_per > 0, and not all periods should be included</span> +<span class="sd"> """</span> + + <span class="k">global</span> <span class="n">Moecache</span> + <span class="n">min_ecc</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">max_ecc</span> <span class="o">=</span> <span class="mf">0.9999</span> + + <span class="n">mass_period_string</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">_</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="n">period_string</span><span class="p">]</span> + <span class="p">)</span> + + <span class="c1"># Check if the dict exists</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">integrals_string</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># Check for cached value. If it doesn't exist: calculate</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">mass_period_string</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">I</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">decc</span> <span class="o">=</span> <span class="mf">1e-3</span> + + <span class="k">for</span> <span class="n">ecc</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">min_ecc</span><span class="p">,</span> <span class="n">max_ecc</span><span class="p">,</span> <span class="n">decc</span><span class="p">):</span> + <span class="c1"># Loop over all the values in the table, between the min and max P</span> + <span class="n">dp_decc</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="n">interpolator_name</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">]),</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">period_string</span><span class="p">]),</span> + <span class="n">ecc</span><span class="p">,</span> + <span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + + <span class="n">I</span> <span class="o">+=</span> <span class="n">dp_decc</span> <span class="o">*</span> <span class="n">decc</span> + + <span class="c1"># Set the integral value in the dict</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">][</span><span class="n">mass_period_string</span><span class="p">]</span> <span class="o">=</span> <span class="n">I</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: calc_ecc_integral: min_ecc: </span><span class="si">{}</span><span class="s2"> max ecc: </span><span class="si">{}</span><span class="s2"> integrals_string: </span><span class="si">{}</span><span class="s2"> interpolator_name: </span><span class="si">{}</span><span class="s2"> mass_string: </span><span class="si">{}</span><span class="s2"> period_string: </span><span class="si">{}</span><span class="s2"> mass: </span><span class="si">{}</span><span class="s2"> period: </span><span class="si">{}</span><span class="s2"> I: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">min_ecc</span><span class="p">,</span> + <span class="n">max_ecc</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">period_string</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="n">period_string</span><span class="p">],</span> + <span class="n">I</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: calc_ecc_integral: Found cached value for min_ecc: </span><span class="si">{}</span><span class="s2"> max ecc: </span><span class="si">{}</span><span class="s2"> integrals_string: </span><span class="si">{}</span><span class="s2"> interpolator_name: </span><span class="si">{}</span><span class="s2"> mass_string: </span><span class="si">{}</span><span class="s2"> period_string: </span><span class="si">{}</span><span class="s2"> mass: </span><span class="si">{}</span><span class="s2"> period: </span><span class="si">{}</span><span class="s2"> I: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">min_ecc</span><span class="p">,</span> + <span class="n">max_ecc</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">period_string</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="n">period_string</span><span class="p">],</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">][</span><span class="n">mass_period_string</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.calc_P_integral"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_P_integral">[docs]</a> <span class="k">def</span> <span class="nf">calc_P_integral</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">options</span><span class="p">,</span> + <span class="n">min_logP</span><span class="p">,</span> + <span class="n">max_logP</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to calculate the P integral</span> + +<span class="sd"> We need to renormalise this because min_per > 0, and not all periods should be included</span> +<span class="sd"> """</span> + + <span class="k">global</span> <span class="n">Moecache</span> + + <span class="c1"># Check if the dict exists</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">integrals_string</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># Check for cached value. If it doesn't exist: calculate</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">I</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">dlogP</span> <span class="o">=</span> <span class="mf">1e-3</span> + + <span class="k">for</span> <span class="n">logP</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">min_logP</span><span class="p">,</span> <span class="n">max_logP</span><span class="p">,</span> <span class="n">dlogP</span><span class="p">):</span> + <span class="c1"># Loop over all the values in the table, between the min and max P</span> + <span class="n">dp_dlogP</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="n">interpolator_name</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">]),</span> <span class="n">logP</span><span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + + <span class="n">I</span> <span class="o">+=</span> <span class="n">dp_dlogP</span> <span class="o">*</span> <span class="n">dlogP</span> + + <span class="c1"># Set the integral value in the dict</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">][</span><span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">]]</span> <span class="o">=</span> <span class="n">I</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: calc_P_integral: min_logP: </span><span class="si">{}</span><span class="s2"> integrals_string: </span><span class="si">{}</span><span class="s2"> interpolator_name: </span><span class="si">{}</span><span class="s2"> mass_string: </span><span class="si">{}</span><span class="s2"> mass: </span><span class="si">{}</span><span class="s2"> I: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">min_logP</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> + <span class="n">I</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe and di Stefano 2017: calc_P_integral: Found cached value for min_logP: </span><span class="si">{}</span><span class="s2"> integrals_string: </span><span class="si">{}</span><span class="s2"> interpolator_name: </span><span class="si">{}</span><span class="s2"> mass_string: </span><span class="si">{}</span><span class="s2"> mass: </span><span class="si">{}</span><span class="s2"> I: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">min_logP</span><span class="p">,</span> + <span class="n">integrals_string</span><span class="p">,</span> + <span class="n">interpolator_name</span><span class="p">,</span> + <span class="n">mass_string</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">],</span> + <span class="n">Moecache</span><span class="p">[</span><span class="n">integrals_string</span><span class="p">][</span><span class="n">options</span><span class="p">[</span><span class="n">mass_string</span><span class="p">]],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="distribution_functions.calc_total_probdens"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_total_probdens">[docs]</a> <span class="k">def</span> <span class="nf">calc_total_probdens</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prob_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to calculate the total probability density</span> +<span class="sd"> """</span> + + <span class="n">total_probdens</span> <span class="o">=</span> <span class="mi">1</span> + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">prob_dict</span><span class="p">:</span> + <span class="n">total_probdens</span> <span class="o">*=</span> <span class="n">prob_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"total_probdens"</span><span class="p">]</span> <span class="o">=</span> <span class="n">total_probdens</span> + + <span class="k">return</span> <span class="n">prob_dict</span></div> + +<div class="viewcode-block" id="distribution_functions.Moe_di_Stefano_2017_pdf"><a class="viewcode-back" href="../../../../population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_pdf">[docs]</a> <span class="k">def</span> <span class="nf">Moe_di_Stefano_2017_pdf</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Moe & diStefano function to calculate the probability density.</span> + +<span class="sd"> takes a dictionary as input (in options) with options:</span> + +<span class="sd"> M1, M2, M3, M4 => masses (Msun) [M1 required, rest optional]</span> +<span class="sd"> P, P2, P3 => periods (days) [number: none=binary, 2=triple, 3=quadruple]</span> +<span class="sd"> ecc, ecc2, ecc3 => eccentricities [numbering as for P above]</span> + +<span class="sd"> mmin => minimum allowed stellar mass (default 0.07)</span> +<span class="sd"> mmax => maximum allowed stellar mass (default 80.0)</span> +<span class="sd"> """</span> + + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf with options:</span><span class="se">\n\t\t</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="n">prob_dict</span> <span class="o">=</span> <span class="p">(</span> + <span class="p">{}</span> + <span class="p">)</span> <span class="c1"># Dictionary containing all the pdf values for the different parameters</span> + + <span class="c1"># Get the multiplicity from the options, and if its not there, calculate it based on the</span> + <span class="c1"># TODO: the function below makes no sense. We NEED to pass the multiplicity in the</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"multiplicity"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Did not find a multiplicity value in the options dictionary"</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="n">multiplicity</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"multiplicity"</span><span class="p">]</span> + + <span class="c1"># Immediately return 0 if the multiplicity modulator is 0</span> + <span class="k">if</span> <span class="n">options</span><span class="p">[</span><span class="s2">"multiplicity_modulator"</span><span class="p">][</span><span class="nb">int</span><span class="p">(</span><span class="n">multiplicity</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: returning 0 because of the multiplicity modulator being 0"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">return</span> <span class="mi">0</span> + + <span class="c1">############################################################</span> + <span class="c1"># multiplicity fraction</span> + <span class="c1"># Calculate the probability, or rather, fraction, of stars that belong to this mass</span> + + <span class="n">multiplicity_probability</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">Moe_di_Stefano_2017_multiplicity_fractions</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> <span class="n">verbosity</span> + <span class="p">)[</span><span class="nb">int</span><span class="p">(</span><span class="n">multiplicity</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"multiplicity"</span><span class="p">]</span> <span class="o">=</span> <span class="n">multiplicity_probability</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended multiplicity (mass1 = </span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob dict (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"multiplicity"</span><span class="p">],</span> <span class="n">prob_dict</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1">############################################################</span> + <span class="c1"># always require an IMF for the primary star</span> + <span class="c1">#</span> + <span class="c1"># NB multiply by M1 to convert dN/dM to dN/dlnM</span> + <span class="c1"># (dlnM = dM/M, so 1/dlnM = M/dM)</span> + + <span class="c1"># TODO: Create an n-part-powerlaw method that can have breakpoints and slopes. I'm using a three-part power law now.</span> + <span class="c1"># TODO: is this actually the correct way? putting the M1 in there? Do we sample in log space?</span> + <span class="n">M1_probability</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">Kroupa2001</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">])</span> <span class="o">*</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> <span class="o">=</span> <span class="n">M1_probability</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended Mass (m=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob dict (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">prob_dict</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if M1_probability == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="sd">"""</span> +<span class="sd"> From here we go through the multiplicities.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">multiplicity</span> <span class="o">>=</span> <span class="mi">2</span><span class="p">:</span> + <span class="c1"># If the multiplicity is higher than 1, we will need to construct the following tables:</span> + <span class="c1"># - period distribution table</span> + <span class="c1"># - q distribution table</span> + <span class="c1"># - eccentricity distribution table</span> + + <span class="c1"># Set up the interpolator for the periods</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_log10P"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_log10P"</span><span class="p">]</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"period_distributions"</span> + <span class="p">],</span> <span class="c1"># Contains the table of data</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="c1"># log10M, log10P</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="c1"># binary, triple</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> <span class="o">-</span> <span class="p">(</span><span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Created new period interpolator: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_log10P"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Make a table storing Moe's data for q distributions</span> + <span class="k">if</span> <span class="p">(</span> + <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="ow">or</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_3"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="ow">or</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_4"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="p">):</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_q"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"q_distributions"</span><span class="p">],</span> <span class="c1"># Contains the table of data</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="c1"># log10M, log10P, q</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="c1">#</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="o">-</span> <span class="p">(</span><span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Created new q interpolator: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_q"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Make a table storing Moe's data for q distributions, but only if the ecc is actually sampled</span> + <span class="k">if</span> <span class="s2">"ecc"</span> <span class="ow">in</span> <span class="n">options</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"rinterpolator_e"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_e"</span><span class="p">]</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"ecc_distributions"</span> + <span class="p">],</span> <span class="c1"># Contains the table of data</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="c1"># log10M, log10P, e</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="c1">#</span> + <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="o">-</span> <span class="p">(</span><span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Created new e interpolator: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_e"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1">###############</span> + <span class="c1"># Calculation for period of the binary</span> + + <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="c1"># Separation of the inner binary</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"sep"</span><span class="p">]</span> <span class="o">=</span> <span class="n">calc_sep_from_period</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]</span> + <span class="p">)</span> + <span class="c1"># TODO: add check for min_logP with instant RLOF?</span> + <span class="c1"># TODO: Actually use the value above.</span> + <span class="c1"># Total mass inner binary:</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> <span class="o">+</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> + + <span class="c1"># Calculate P integral or use cached value</span> + + <span class="c1"># get the periods from the Moecahe</span> + <span class="n">min_logP</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"logperiods"</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> + <span class="n">max_logP</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"logperiods"</span><span class="p">][</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">calc_P_integral</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> + <span class="n">min_logP</span><span class="p">,</span> + <span class="n">max_logP</span><span class="p">,</span> + <span class="s2">"P_integrals"</span><span class="p">,</span> + <span class="s2">"rinterpolator_log10P"</span><span class="p">,</span> + <span class="s2">"M_1"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Set probabilty for P1</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_log10P"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">])]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">p_val</span> <span class="o">/</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"P_integrals"</span><span class="p">][</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]</span> <span class="o">=</span> <span class="n">p_val</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended period (m=</span><span class="si">{}</span><span class="s2">, P=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> <span class="n">prob_dict</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['P'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1">############################################################</span> + <span class="c1"># mass ratio (0 < q = M2/M1 < qmax)</span> + <span class="c1">#</span> + <span class="c1"># we need to construct the q table for the given M1</span> + <span class="c1"># subject to qmin = Mmin/M1</span> + + <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> + <span class="c1"># Build the table for q</span> + <span class="n">primary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="n">secondary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> + <span class="n">m_label</span> <span class="o">=</span> <span class="s2">"M_1"</span> + <span class="n">p_label</span> <span class="o">=</span> <span class="s2">"P"</span> + + <span class="c1"># Construct the q table</span> + <span class="bp">self</span><span class="o">.</span><span class="n">build_q_table</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span><span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Created q_table (</span><span class="si">{}</span><span class="s2">) for m=</span><span class="si">{}</span><span class="s2"> p=</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">)</span> + <span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="n">m_label</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="n">p_label</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Add probability for the mass ratio</span> + <span class="n">q_prob</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">)</span> + <span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">secondary_mass</span> <span class="o">/</span> <span class="n">primary_mass</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q"</span><span class="p">]</span> <span class="o">=</span> <span class="n">q_prob</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: appended mass ratio (M=</span><span class="si">{}</span><span class="s2"> P=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">) "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> <span class="o">/</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['q'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1">############################################################</span> + <span class="c1"># Eccentricity</span> + <span class="c1"># TODO: ask rob if the eccentricity requires an extrapolation as well.</span> + + <span class="c1"># Only do this if the eccentricity is sampled</span> + <span class="k">if</span> <span class="s2">"ecc"</span> <span class="ow">in</span> <span class="n">options</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="c1"># Calculate ecc integral or use cached value</span> + <span class="bp">self</span><span class="o">.</span><span class="n">calc_e_integral</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> + <span class="s2">"ecc_integrals"</span><span class="p">,</span> + <span class="s2">"rinterpolator_e"</span><span class="p">,</span> + <span class="s2">"M_1"</span><span class="p">,</span> + <span class="s2">"P"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + <span class="n">mass_period_string</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{}</span><span class="s2">_</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">])</span> + + <span class="c1"># Set probability for ecc</span> + <span class="n">ecc_val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_e"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]),</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">],</span> + <span class="p">]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">ecc_val</span> <span class="o">=</span> <span class="n">ecc_val</span> <span class="o">/</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"ecc_integrals"</span><span class="p">][</span><span class="n">mass_period_string</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="o">=</span> <span class="n">ecc_val</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended eccentricity (m=</span><span class="si">{}</span><span class="s2">, P=</span><span class="si">{}</span><span class="s2">, ecc=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['ecc'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1"># Calculations for when multiplicity is bigger than 3</span> + <span class="c1"># BEWARE: binary_c does not evolve these systems actually and the code below should be revised for when binary_c actually evolves triples.</span> + <span class="c1"># For that reason, I would not advise to use things with multiplicity > 3</span> + <span class="k">if</span> <span class="n">multiplicity</span> <span class="o">>=</span> <span class="mi">3</span><span class="p">:</span> + + <span class="c1">############################################################</span> + <span class="c1"># orbital period 2 =</span> + <span class="c1"># orbital period of star 3 (multiplicity==3) or</span> + <span class="c1"># the star3+star4 binary (multiplicity==4)</span> + <span class="c1">#</span> + <span class="c1"># we assume the same period distribution for star 3</span> + <span class="c1"># (or stars 3 and 4) but with a separation that is >10*a*(1+e)</span> + <span class="c1"># where 10*a*(1+e) is the maximum apastron separation of</span> + <span class="c1"># stars 1 and 2</span> + + <span class="c1"># TODO: Is this a correct assumption?</span> + <span class="n">max_sep</span> <span class="o">=</span> <span class="mf">10.0</span> <span class="o">*</span> <span class="n">options</span><span class="p">[</span><span class="s2">"sep"</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">])</span> + <span class="n">min_P2</span> <span class="o">=</span> <span class="n">calc_period_from_sep</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"mmin"</span><span class="p">],</span> <span class="n">max_sep</span> + <span class="p">)</span> + <span class="n">min_logP2</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">min_P2</span><span class="p">)</span> + <span class="c1"># max_logP2 = 10.0</span> + <span class="c1"># min_logP = Moecache['logperiods'][0]</span> + <span class="n">max_logP2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">Moecache</span><span class="p">[</span><span class="s2">"logperiods"</span><span class="p">][</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> + + <span class="k">if</span> <span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]</span> <span class="o"><</span> <span class="n">min_P2</span><span class="p">:</span> + <span class="c1"># period is too short : system is not hierarchical</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: period2 is too short: </span><span class="si">{}</span><span class="s2"> < </span><span class="si">{}</span><span class="s2">, system is not hierarchical. Added 0 to probability list"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P1"</span><span class="p">],</span> <span class="n">min_P2</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['P2'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="k">else</span><span class="p">:</span> + <span class="c1"># period is long enough that the system is hierarchical</span> + <span class="c1"># hence the separation between the outer star</span> + <span class="c1"># and inner binary</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"sep2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">calc_sep_from_period</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]</span> + <span class="p">)</span> + + <span class="c1"># Check for cached value of P integral or calculate</span> + <span class="bp">self</span><span class="o">.</span><span class="n">calc_P_integral</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> + <span class="n">min_logP2</span><span class="p">,</span> + <span class="n">max_logP2</span><span class="p">,</span> + <span class="s2">"P2_integrals"</span><span class="p">,</span> + <span class="s2">"rinterpolator_log10P"</span><span class="p">,</span> + <span class="s2">"M_1+M_2"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Add the probability</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_log10P"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">])]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">p_val</span> <span class="o">/</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"P2_integrals"</span><span class="p">][</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">p_val</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended period2 (m1=</span><span class="si">{}</span><span class="s2"> m2=</span><span class="si">{}</span><span class="s2">, P2=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['P2'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1">############################################################</span> + <span class="c1"># mass ratio 2 = q2 = M3 / (M1+M2)</span> + <span class="c1">#</span> + <span class="c1"># we need to construct the q table for the given M1</span> + <span class="c1"># subject to qmin = Mmin/(M1+M2)</span> + + <span class="c1"># Set the variables for the masses and their names</span> + <span class="n">primary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]</span> + <span class="n">secondary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">]</span> + <span class="n">m_label</span> <span class="o">=</span> <span class="s2">"M_1+M_2"</span> + <span class="n">p_label</span> <span class="o">=</span> <span class="s2">"P2"</span> + + <span class="c1"># Build q table</span> + <span class="bp">self</span><span class="o">.</span><span class="n">build_q_table</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span><span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Called build_q_table"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Add the probability</span> + <span class="n">q2_val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">)</span> + <span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">secondary_mass</span> <span class="o">/</span> <span class="n">primary_mass</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">q2_val</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: appended mass ratio (M_1+M_2=</span><span class="si">{}</span><span class="s2"> M_3=</span><span class="si">{}</span><span class="s2"> P=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">) "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> + <span class="n">secondary_mass</span> <span class="o">/</span> <span class="n">primary_mass</span><span class="p">,</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q2"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['q2'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1"># TODO: Implement ecc2 calculation</span> + <span class="k">if</span> <span class="n">multiplicity</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span> + <span class="c1"># quadruple system.</span> + <span class="c1"># TODO: Ask Rob about the structure of the quadruple. Is this only double binary quadruples?</span> + + <span class="c1">############################################################</span> + <span class="c1"># orbital period 3</span> + <span class="c1">#</span> + <span class="c1"># we assume the same period distribution for star 4</span> + <span class="c1"># as for any other stars but Pmax must be such that</span> + <span class="c1"># sep3 < sep2 * 0.2</span> + + <span class="c1"># TODO: fix this here</span> + <span class="n">max_sep3</span> <span class="o">=</span> <span class="mf">0.2</span> <span class="o">*</span> <span class="n">options</span><span class="p">[</span><span class="s2">"sep2"</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">options</span><span class="p">[</span><span class="s2">"ecc2"</span><span class="p">])</span> + <span class="n">max_per3</span> <span class="o">=</span> <span class="n">calc_period_from_sep</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">],</span> <span class="n">options</span><span class="p">[</span><span class="s2">"mmin"</span><span class="p">],</span> <span class="n">max_sep3</span> + <span class="p">)</span> + + <span class="c1"># Calculate P integral or use the cached value</span> + <span class="c1"># TODO: Make sure we use the correct period idea here.</span> + <span class="bp">self</span><span class="o">.</span><span class="n">calc_P_integral</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> + <span class="n">min_logP2</span><span class="p">,</span> + <span class="n">max_logP2</span><span class="p">,</span> + <span class="s2">"P2_integrals"</span><span class="p">,</span> + <span class="s2">"rinterpolator_log10P"</span><span class="p">,</span> + <span class="s2">"M_1+M_2"</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Set probability</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"rinterpolator_log10P"</span><span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">(</span> + <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]),</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">])]</span> + <span class="p">)[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">p_val</span> <span class="o">=</span> <span class="n">p_val</span> <span class="o">/</span> <span class="n">Moecache</span><span class="p">[</span><span class="s2">"P2_integrals"</span><span class="p">][</span><span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P3"</span><span class="p">]</span> <span class="o">=</span> <span class="n">p_val</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Appended period2 (M=4) (M_1=</span><span class="si">{}</span><span class="s2"> M_2=</span><span class="si">{}</span><span class="s2">, P2=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"P3"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['P3'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1">############################################################</span> + <span class="c1"># mass ratio 2</span> + <span class="c1">#</span> + <span class="c1"># we need to construct the q table for the given M1</span> + <span class="c1"># subject to qmin = Mmin/(M1+M2)</span> + <span class="c1"># Make a table storing Moe's data for q distributions</span> + + <span class="c1"># Build the table for q2</span> + <span class="n">primary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">]</span> + <span class="n">secondary_mass</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">]</span> + <span class="n">m_label</span> <span class="o">=</span> <span class="s2">"M_1+M_2"</span> + <span class="n">p_label</span> <span class="o">=</span> <span class="s2">"P2"</span> + + <span class="c1"># Calculate new q table</span> + <span class="bp">self</span><span class="o">.</span><span class="n">build_q_table</span><span class="p">(</span> + <span class="n">options</span><span class="p">,</span> <span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">,</span> <span class="n">verbosity</span><span class="o">=</span><span class="n">verbosity</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Created q_table "</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Add the probability</span> + <span class="n">q3_prob</span> <span class="o">=</span> <span class="n">Moecache</span><span class="p">[</span> + <span class="s2">"rinterpolator_q_given_</span><span class="si">{}</span><span class="s2">_log10</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">m_label</span><span class="p">,</span> <span class="n">p_label</span><span class="p">)</span> + <span class="p">]</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">secondary_mass</span> <span class="o">/</span> <span class="n">primary_mass</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q3"</span><span class="p">]</span> <span class="o">=</span> <span class="n">q3_prob</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: appended mass ratio (M_1+M_2=</span><span class="si">{}</span><span class="s2"> M_3=</span><span class="si">{}</span><span class="s2"> P=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2">) probability (</span><span class="si">{}</span><span class="s2">) to the prob list (</span><span class="si">{}</span><span class="s2">) "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1+M_2"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">],</span> + <span class="n">secondary_mass</span> <span class="o">/</span> <span class="n">primary_mass</span><span class="p">,</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"q3"</span><span class="p">],</span> + <span class="n">prob_dict</span><span class="p">,</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># if prob_dict['q3'] == 0: # If the probability is 0 then we don't have to calculate more</span> + <span class="c1"># calc_total_probdens(prob_dict)</span> + <span class="c1"># return prob_dict</span> + + <span class="c1"># TODO: ecc 3</span> + + <span class="c1"># check for input of multiplicity</span> + <span class="k">elif</span> <span class="n">multiplicity</span> <span class="ow">not</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">):</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: Unknown multiplicity </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">multiplicity</span> + <span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="n">msg</span><span class="p">,</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Calculate total probdens:</span> + <span class="n">prob_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">calc_total_probdens</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">)</span> + + <span class="c1"># Some info</span> + <span class="k">if</span> <span class="n">multiplicity</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: M_1=</span><span class="si">{}</span><span class="s2"> q=N/A log10P=N/A (</span><span class="si">{}</span><span class="s2">): </span><span class="si">{}</span><span class="s2"> -> </span><span class="si">{}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="nb">len</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="nb">str</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"total_probdens"</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">multiplicity</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: M_1=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2"> log10P=</span><span class="si">{}</span><span class="s2"> ecc=</span><span class="si">{}</span><span class="s2"> (</span><span class="si">{}</span><span class="s2">): </span><span class="si">{}</span><span class="s2"> -> </span><span class="si">{}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> <span class="o">/</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="nb">len</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="nb">str</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"total_probdens"</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">multiplicity</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017_pdf: M_1=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2"> log10P=</span><span class="si">{}</span><span class="s2"> ecc=</span><span class="si">{}</span><span class="s2"> M_3=</span><span class="si">{}</span><span class="s2"> log10P2=</span><span class="si">{}</span><span class="s2"> ecc2=</span><span class="si">{}</span><span class="s2"> (</span><span class="si">{}</span><span class="s2">): </span><span class="si">{}</span><span class="s2"> -> </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> <span class="o">/</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">],</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc2"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="nb">len</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="nb">str</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"total_probdens"</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">multiplicity</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Moe_di_Stefano_2017_pdf: M_1=</span><span class="si">{}</span><span class="s2"> q=</span><span class="si">{}</span><span class="s2"> log10P=</span><span class="si">{}</span><span class="s2"> ecc=</span><span class="si">{}</span><span class="s2"> M_3=</span><span class="si">{}</span><span class="s2"> log10P2=</span><span class="si">{}</span><span class="s2"> ecc2=</span><span class="si">{}</span><span class="s2"> M_4=</span><span class="si">{}</span><span class="s2"> log10P3=</span><span class="si">{}</span><span class="s2"> ecc3=</span><span class="si">{}</span><span class="s2"> (</span><span class="si">{}</span><span class="s2">) : </span><span class="si">{}</span><span class="s2"> -> </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">],</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_2"</span><span class="p">]</span> <span class="o">/</span> <span class="n">options</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"M_2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> + <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_3"</span><span class="p">],</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P2"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc2"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc2"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"M_4"</span><span class="p">],</span> + <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"P3"</span><span class="p">]),</span> + <span class="n">options</span><span class="p">[</span><span class="s2">"ecc3"</span><span class="p">]</span> <span class="k">if</span> <span class="n">options</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"ecc3"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">else</span> <span class="s2">"N/A"</span><span class="p">,</span> + <span class="nb">len</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="nb">str</span><span class="p">(</span><span class="n">prob_dict</span><span class="p">),</span> + <span class="n">prob_dict</span><span class="p">[</span><span class="s2">"total_probdens"</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="p">,</span> + <span class="n">_MOE2017_VERBOSITY_LEVEL</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">return</span> <span class="n">prob_dict</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/grid_options_defaults.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/grid_options_defaults.html new file mode 100644 index 0000000000000000000000000000000000000000..8f41fafd623d5c119504eb346c4adc3f4a865441 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/grid_options_defaults.html @@ -0,0 +1,734 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.grid_options_defaults — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.grid_options_defaults</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.grid_options_defaults</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module that contains the default options for the population grid code along with the description for these options, in the form of dictionaries:</span> +<span class="sd"> - grid_options_defaults_dict: dictionary containing the default values for all the options</span> +<span class="sd"> - grid_options_descriptions: dictionary containing the description for these options.</span> + +<span class="sd">There are several other functions in this module, mostly to generate help texts or documents:</span> +<span class="sd"> - grid_options_help: interactive function for the user to get descriptions for options</span> +<span class="sd"> - grid_options_description_checker: function that checks that checks which options have a description.</span> +<span class="sd"> - write_grid_options_to_rst_file: function to generate the .rst document for the docs</span> + +<span class="sd">With this its also possible to automatically generate a document containing all the setting names + descriptions.</span> + +<span class="sd">All the options starting with _ should not be changed by the user except when you really know what you're doing (which is probably hacking the code :P)</span> + +<span class="sd">TODO: reconsider having this all as class methods. It seems unnecessary to have all these functions as class methods.</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">import</span> <span class="nn">shutil</span> +<span class="kn">import</span> <span class="nn">sys</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.custom_logging_functions</span> <span class="kn">import</span> <span class="n">temp_dir</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">now</span><span class="p">,</span> +<span class="p">)</span> + +<span class="n">_MOE2017_VERBOSITY_LEVEL</span> <span class="o">=</span> <span class="mi">5</span> +<span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_LEVEL</span> <span class="o">=</span> <span class="mi">6</span> +<span class="n">_MOE2017_VERBOSITY_INTERPOLATOR_EXTRA_LEVEL</span> <span class="o">=</span> <span class="mi">7</span> + +<span class="n">secs_per_day</span> <span class="o">=</span> <span class="mi">86400</span> <span class="c1"># probably needs to go somewhere more sensible</span> + + +<div class="viewcode-block" id="grid_options_defaults"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults">[docs]</a><span class="k">class</span> <span class="nc">grid_options_defaults</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Class extension to Population grid containing all the functionality for the options and defaults</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the grid_options_defaults class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="grid_options_defaults.get_grid_options_defaults_dict"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_defaults_dict">[docs]</a> <span class="k">def</span> <span class="nf">get_grid_options_defaults_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the default values for the grid options</span> +<span class="sd"> """</span> + + <span class="c1"># Options dict</span> + <span class="k">return</span> <span class="p">{</span> + <span class="c1">##########################</span> + <span class="c1"># general (or unordered..)</span> + <span class="c1">##########################</span> + <span class="s2">"num_cores"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># total number of cores used to evolve the population</span> + <span class="s2">"num_cores_available"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># set automatically, not by the user</span> + <span class="s2">"parse_function"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Function to parse the output with.</span> + <span class="s2">"multiplicity_fraction_function"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Which multiplicity fraction function to use. 0: None, 1: Arenou 2010, 2: Rhagavan 2010, 3: Moe and di Stefano 2017</span> + <span class="s2">"tmp_dir"</span><span class="p">:</span> <span class="n">temp_dir</span><span class="p">(),</span> <span class="c1"># Setting the temp dir of the program</span> + <span class="s2">"cache_dir"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">default_cache_dir</span><span class="p">(),</span> <span class="c1"># Cache location, usually $HOME/.cache</span> + <span class="s2">"status_dir"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1">#</span> + <span class="s2">"_main_pid"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># Placeholder for the main process id of the run.</span> + <span class="s2">"save_ensemble_chunks"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Force the ensemble chunk to be saved even if we are joining a thread (just in case the joining fails)</span> + <span class="s2">"combine_ensemble_with_thread_joining"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{population_id}_{thread_id}.json</span> + <span class="s2">"_commandline_input"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> + <span class="s2">"log_runtime_systems"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># whether to log the runtime of the systems (1 file per thread. stored in the tmp_dir)</span> + <span class="s2">"_actually_evolve_system"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Whether to actually evolve the systems of just act as if. for testing. used in _process_run_population_grid</span> + <span class="s2">"max_queue_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Maximum size of the system call queue. Set to 0 for this to be calculated automatically</span> + <span class="s2">"run_zero_probability_system"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Whether to run the zero probability systems</span> + <span class="s2">"_zero_prob_stars_skipped"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> + <span class="s2">"ensemble_factor_in_probability_weighted_mass"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Whether to multiply the ensemble results by 1/probability_weighted_mass</span> + <span class="s2">"do_dry_run"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># Whether to do a dry run to calculate the total probability for this run</span> + <span class="s2">"dry_run_num_cores"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># number of parallel processes for the dry run (outer loop)</span> + <span class="s2">"dry_run_hook"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Function hook for the dry run: this function is called, if not None, for every star in the dry run. Useful for checking initial distributions.</span> + <span class="s2">"custom_generator"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Place for the custom system generator</span> + <span class="s2">"return_after_dry_run"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Return immediately after a dry run?</span> + <span class="s2">"exit_after_dry_run"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Exit after dry run?</span> + <span class="s2">"print_stack_on_exit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># print the stack trace on exit calls?</span> + <span class="c1">#####################</span> + <span class="c1"># System information</span> + <span class="c1">#####################</span> + <span class="s2">"command_line"</span><span class="p">:</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">),</span> + <span class="s2">"original_command_line"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">"BINARY_C_PYTHON_ORIGINAL_CMD_LINE"</span><span class="p">),</span> + <span class="s2">"working_diretory"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">(),</span> + <span class="s2">"original_working_diretory"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">"BINARY_C_PYTHON_ORIGINAL_WD"</span><span class="p">),</span> + <span class="s2">"start_time"</span><span class="p">:</span> <span class="n">now</span><span class="p">(),</span> + <span class="s2">"original_submission_time"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span> + <span class="s2">"BINARY_C_PYTHON_ORIGINAL_SUBMISSION_TIME"</span> + <span class="p">),</span> + <span class="c1">##########################</span> + <span class="c1"># Execution log:</span> + <span class="c1">##########################</span> + <span class="s2">"verbosity"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Level of verbosity of the simulation</span> + <span class="s2">"log_file"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> <span class="c1"># not used (yet?)</span> + <span class="n">temp_dir</span><span class="p">(),</span> <span class="s2">"binary_c_python.log"</span> + <span class="p">),</span> <span class="c1"># Set to None to not log to file. The directory will be created</span> + <span class="s2">"log_dt"</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="c1"># time between vb=1 logging outputs</span> + <span class="s2">"n_logging_stats"</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span class="c1"># number of logging stats used to calculate time remaining (etc.) default = 50</span> + <span class="s2">"log_newline"</span><span class="p">:</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="c1"># newline character in logs ("\n" for newlines, "\x0d" for carriage return)</span> + <span class="c1">##########################</span> + <span class="c1"># binary_c files</span> + <span class="c1">##########################</span> + <span class="s2">"_binary_c_executable"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C"</span><span class="p">],</span> <span class="s2">"binary_c"</span> + <span class="p">),</span> + <span class="s2">"_binary_c_shared_library"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C"</span><span class="p">],</span> <span class="s2">"src"</span><span class="p">,</span> <span class="s2">"libbinary_c.so"</span> + <span class="p">),</span> + <span class="s2">"_binary_c_config_executable"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C"</span><span class="p">],</span> <span class="s2">"binary_c-config"</span> + <span class="p">),</span> + <span class="s2">"_binary_c_dir"</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C"</span><span class="p">],</span> + <span class="c1">##########################</span> + <span class="c1"># Moe and di Stefano (2017) internal settings</span> + <span class="c1">##########################</span> + <span class="s2">"_loaded_Moe2017_data"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Holds flag whether the Moe and di Stefano (2017) data is loaded into memory</span> + <span class="s2">"_set_Moe2017_grid"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Whether the Moe and di Stefano (2017) grid has been loaded</span> + <span class="s2">"Moe2017_options"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Holds the Moe and di Stefano (2017) options.</span> + <span class="s2">"_Moe2017_JSON_data"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Stores the data</span> + <span class="c1">##########################</span> + <span class="c1"># Custom logging</span> + <span class="c1">##########################</span> + <span class="s2">"C_auto_logging"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Should contain a dictionary where the keys are they headers</span> + <span class="c1"># and the values are lists of parameters that should be logged.</span> + <span class="c1"># This will get parsed by autogen_C_logging_code in custom_logging_functions.py</span> + <span class="s2">"C_logging_code"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># Should contain a string which holds the logging code.</span> + <span class="s2">"custom_logging_func_memaddr"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># Contains the custom_logging functions memory address</span> + <span class="s2">"_custom_logging_shared_library_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># file containing the .so file</span> + <span class="c1">##########################</span> + <span class="c1"># Store pre-loading:</span> + <span class="c1">##########################</span> + <span class="s2">"_store_memaddr"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># Contains the store object memory address, useful for pre loading.</span> + <span class="c1"># defaults to -1 and isn't used if that's the default then.</span> + <span class="c1">##########################</span> + <span class="c1"># Log args: logging of arguments</span> + <span class="c1">##########################</span> + <span class="s2">"log_args"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># unused</span> + <span class="s2">"log_args_dir"</span><span class="p">:</span> <span class="s2">"/tmp/"</span><span class="p">,</span> <span class="c1"># unused</span> + <span class="c1">##########################</span> + <span class="c1"># Population evolution</span> + <span class="c1">##########################</span> + <span class="c1">## General</span> + <span class="s2">"evolution_type"</span><span class="p">:</span> <span class="s2">"grid"</span><span class="p">,</span> <span class="c1"># Flag for type of population evolution</span> + <span class="s2">"_evolution_type_options"</span><span class="p">:</span> <span class="p">[</span> + <span class="s2">"grid"</span><span class="p">,</span> + <span class="s2">"custom_generator"</span><span class="p">,</span> + <span class="p">],</span> <span class="c1"># available choices for type of population evolution. # TODO: fill later with Monte Carlo, source file</span> + <span class="s2">"_system_generator"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># value that holds the function that generates the system</span> + <span class="c1"># (result of building the grid script)</span> + <span class="s2">"source_file_filename"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># filename for the source</span> + <span class="s2">"_count"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># count of systems</span> + <span class="s2">"_total_starcount"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Total count of systems in this generator</span> + <span class="s2">"_probtot"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># total probability</span> + <span class="s2">"weight"</span><span class="p">:</span> <span class="mf">1.0</span><span class="p">,</span> <span class="c1"># weighting for the probability</span> + <span class="s2">"repeat"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># number of times to repeat each system (probability is adjusted to be 1/repeat)</span> + <span class="s2">"_start_time_evolution"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Start time of the grid</span> + <span class="s2">"_end_time_evolution"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># end time of the grid</span> + <span class="s2">"_errors_found"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Flag whether there are any errors from binary_c</span> + <span class="s2">"_errors_exceeded"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Flag whether the number of errors have exceeded the limit</span> + <span class="s2">"_failed_count"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># number of failed systems</span> + <span class="s2">"_failed_prob"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Summed probability of failed systems</span> + <span class="s2">"failed_systems_threshold"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="c1"># Maximum failed systems per process allowed to fail before the process stops logging the failing systems.</span> + <span class="s2">"_failed_systems_error_codes"</span><span class="p">:</span> <span class="p">[],</span> <span class="c1"># List to store the unique error codes</span> + <span class="s2">"_population_id"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># Random id of this grid/population run, Unique code for the population. Should be set only once by the controller process.</span> + <span class="s2">"_total_mass_run"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># To count the total mass that thread/process has ran</span> + <span class="s2">"_total_probability_weighted_mass_run"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># To count the total mass * probability for each system that thread/process has ran</span> + <span class="s2">"modulo"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># run modulo n of the grid.</span> + <span class="s2">"start_at"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># start at the first model</span> + <span class="c1">## Grid type evolution</span> + <span class="s2">"_grid_variables"</span><span class="p">:</span> <span class="p">{},</span> <span class="c1"># grid variables</span> + <span class="s2">"gridcode_filename"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># filename of gridcode</span> + <span class="s2">"symlink_latest_gridcode"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># symlink to latest gridcode</span> + <span class="s2">"save_population_object"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># filename to which we should save a pickled grid object as the final thing we do</span> + <span class="s2">"joinlist"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> + <span class="s2">"do_analytics"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># if True, calculate analytics prior to return</span> + <span class="s2">"save_snapshots"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># if True, save snapshots on SIGINT</span> + <span class="s2">"restore_from_snapshot_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># file to restore from</span> + <span class="s2">"restore_from_snapshot_dir"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># dir to restore from</span> + <span class="s2">"exit_code"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># return code</span> + <span class="s2">"stop_queue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> + <span class="s2">"_killed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> + <span class="s2">"_queue_done"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> + <span class="c1">## Monte carlo type evolution</span> + <span class="c1"># TODO: make MC options</span> + <span class="c1">## Evolution from source file</span> + <span class="c1"># TODO: make run from sourcefile options.</span> + <span class="c1">########################################</span> + <span class="c1"># function caching options</span> + <span class="c1">########################################</span> + <span class="s2">"function_cache"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> + <span class="s2">"function_cache_default_maxsize"</span><span class="p">:</span> <span class="mi">256</span><span class="p">,</span> + <span class="s2">"function_cache_default_type"</span><span class="p">:</span> <span class="s2">"NullCache"</span><span class="p">,</span> <span class="c1"># one of LRUCache, LFUCache, FIFOCache, MRUCache, RRCache, TTLCache, NullCache, NoCache</span> + <span class="s2">"function_cache_TTL"</span><span class="p">:</span> <span class="mi">30</span><span class="p">,</span> + <span class="s2">"function_cache_functions"</span><span class="p">:</span> <span class="p">{</span> + <span class="c1"># key=function_name : value=(cache_size, cache_type, test_args (string))</span> + <span class="c1">#</span> + <span class="c1"># if cache_size is 0, use function_cache_default_maxsize</span> + <span class="c1"># set above</span> + <span class="c1">#</span> + <span class="c1"># if cache_type is None, use function_cache_default_type</span> + <span class="c1"># set above</span> + <span class="c1">#</span> + <span class="c1"># if n is None, no cache is set up</span> + <span class="s2">"distribution_functions.powerlaw_constant"</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s2">"NoCache"</span><span class="p">,</span> <span class="s2">"1,100,-2"</span><span class="p">),</span> + <span class="s2">"distribution_functions.calculate_constants_three_part_powerlaw"</span><span class="p">:</span> <span class="p">(</span> + <span class="mi">16</span><span class="p">,</span> + <span class="s2">"FIFOCache"</span><span class="p">,</span> + <span class="s2">"0.1,0.5,1,100,-1.3,-2.3,-2.3"</span><span class="p">,</span> + <span class="p">),</span> + <span class="s2">"distribution_functions.gaussian_normalizing_const"</span><span class="p">:</span> <span class="p">(</span> + <span class="mi">16</span><span class="p">,</span> + <span class="s2">"FIFOCache"</span><span class="p">,</span> + <span class="s2">"1.0,1.0,-10.0,+10.0"</span><span class="p">,</span> + <span class="p">),</span> + <span class="s2">"spacing_functions.const_linear"</span><span class="p">:</span> <span class="p">(</span><span class="mi">16</span><span class="p">,</span> <span class="s2">"FIFOCache"</span><span class="p">,</span> <span class="s2">"1,10,9"</span><span class="p">),</span> + <span class="s2">"spacing_functions.const_int"</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">"1,10,9"</span><span class="p">),</span> + <span class="s2">"spacing_functions.const_ranges"</span><span class="p">:</span> <span class="p">(</span> + <span class="mi">16</span><span class="p">,</span> + <span class="s2">"FIFOCache"</span><span class="p">,</span> + <span class="s2">"((0.1,0.65,10),(0.65,0.85,20),(0.85,10.0,10))"</span><span class="p">,</span> + <span class="p">),</span> + <span class="s2">"spacing_functions.gaussian_zoom"</span><span class="p">:</span> <span class="p">(</span> + <span class="mi">16</span><span class="p">,</span> + <span class="s2">"FIFOCache"</span><span class="p">,</span> + <span class="s2">"1.0,10.0,5.0,2.0,0.9,100"</span><span class="p">,</span> + <span class="p">),</span> + <span class="p">},</span> + <span class="c1">########################################</span> + <span class="c1"># HPC variables</span> + <span class="c1">########################################</span> + <span class="s2">"HPC_force_join"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if True, and the HPC variable ("slurm" or "condor") is 3, skip checking our own job and force the join</span> + <span class="s2">"HPC_rebuild_joinlist"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if True, ignore the joinlist we would usually use and rebuild it automatically</span> + <span class="c1">########################################</span> + <span class="c1"># Slurm stuff</span> + <span class="c1">########################################</span> + <span class="s2">"slurm"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># dont use the slurm by default, 0 = no slurm, 1 = launch slurm jobs, 2 = run slurm jobs</span> + <span class="s2">"slurm_ntasks"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># CPUs required per array job: usually only need this to be 1</span> + <span class="s2">"slurm_dir"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="c1"># working directory containing scripts output logs etc.</span> + <span class="s2">"slurm_njobs"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># number of scripts; set to 0 as default</span> + <span class="s2">"slurm_jobid"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="c1"># slurm job id (%A)</span> + <span class="s2">"slurm_memory"</span><span class="p">:</span> <span class="s2">"512MB"</span><span class="p">,</span> <span class="c1"># memory required for the job</span> + <span class="s2">"slurm_warn_max_memory"</span><span class="p">:</span> <span class="s2">"1024MB"</span><span class="p">,</span> <span class="c1"># warn if we set it to more than this (usually by accident)</span> + <span class="s2">"slurm_postpone_join"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if 1 do not join on slurm, join elsewhere. want to do it off the slurm grid (e.g. with more RAM)</span> + <span class="s2">"slurm_jobarrayindex"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># slurm job array index (%a)</span> + <span class="s2">"slurm_jobname"</span><span class="p">:</span> <span class="s2">"binary_c-python"</span><span class="p">,</span> <span class="c1"># default</span> + <span class="s2">"slurm_partition"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> + <span class="s2">"slurm_time"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># total time. 0 = infinite time</span> + <span class="s2">"slurm_postpone_sbatch"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if 1: don't submit, just make the script</span> + <span class="s2">"slurm_array"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># override for --array, useful for rerunning jobs</span> + <span class="s2">"slurm_array_max_jobs"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># override for the max number of concurrent array jobs</span> + <span class="s2">"slurm_extra_settings"</span><span class="p">:</span> <span class="p">{},</span> <span class="c1"># Dictionary of extra settings for Slurm to put in its launch script.</span> + <span class="s2">"slurm_sbatch"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"sbatch"</span><span class="p">),</span> <span class="c1"># sbatch command</span> + <span class="s2">"slurm_env"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"env"</span><span class="p">),</span> <span class="c1"># env location for Slurm</span> + <span class="s2">"slurm_bash"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"bash"</span><span class="p">),</span> <span class="c1"># bash location for Slurm</span> + <span class="s2">"slurm_pwd"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"pwd"</span><span class="p">),</span> <span class="c1"># pwd command location for Slurm</span> + <span class="s2">"slurm_date"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"date"</span><span class="p">),</span> <span class="c1"># bash location for Slurm</span> + <span class="c1">########################################</span> + <span class="c1"># Condor stuff</span> + <span class="c1">########################################</span> + <span class="s2">"condor"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># 1 to use condor, 0 otherwise</span> + <span class="s2">"condor_dir"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="c1"># working directory containing e.g. scripts, output, logs (e.g. should be NFS available to all)</span> + <span class="s2">"condor_njobs"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># number of scripts/jobs that CONDOR will run in total</span> + <span class="s2">"condor_ClusterID"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># condor cluster id, equivalent to Slurm's jobid</span> + <span class="s2">"condor_Process"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># condor process, equivalent to Slurm's jobarrayindex</span> + <span class="s2">"condor_postpone_submit"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if 1, the condor script is not submitted (useful for debugging). Default 0.</span> + <span class="s2">"condor_postpone_join"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if 1, data is not joined, e.g. if you want to do it off the condor grid (e.g. with more RAM). Default 0.</span> + <span class="s2">"condor_memory"</span><span class="p">:</span> <span class="mi">512</span><span class="p">,</span> <span class="c1"># in MB, the memory use (ImageSize) of the job</span> + <span class="s2">"condor_warn_max_memory"</span><span class="p">:</span> <span class="mi">1024</span><span class="p">,</span> <span class="c1"># in MB, the memory use (ImageSize) of the job</span> + <span class="s2">"condor_universe"</span><span class="p">:</span> <span class="s2">"vanilla"</span><span class="p">,</span> <span class="c1"># usually vanilla universe</span> + <span class="s2">"condor_extra_settings"</span><span class="p">:</span> <span class="p">{},</span> <span class="c1"># Place to put extra configuration for the CONDOR submit file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so.</span> + <span class="c1"># snapshots and checkpoints</span> + <span class="s2">"condor_snapshot_on_kill"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># if 1 snapshot on SIGKILL before exit</span> + <span class="s2">"condor_stream_output"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># stream stdout</span> + <span class="s2">"condor_stream_error"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># stream stderr</span> + <span class="s2">"condor_should_transfer_files"</span><span class="p">:</span> <span class="s2">"YES"</span><span class="p">,</span> + <span class="s2">"condor_when_to_transfer_output"</span><span class="p">:</span> <span class="s2">"ON_EXIT_OR_EVICT"</span><span class="p">,</span> + <span class="c1"># (useful for debugging, otherwise a lot of work)</span> + <span class="s2">"condor_requirements"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="c1"># job requirements</span> + <span class="s2">"condor_env"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"env"</span><span class="p">),</span> <span class="c1"># /usr/bin/env location</span> + <span class="s2">"condor_bash"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"bash"</span><span class="p">),</span> <span class="c1"># bash executable location</span> + <span class="s2">"condor_pwd"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"pwd"</span><span class="p">),</span> <span class="c1"># pwd command location for Condor</span> + <span class="s2">"condor_date"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"date"</span><span class="p">),</span> <span class="c1"># bash location for Condor</span> + <span class="s2">"condor_initial_dir"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># directory from which condor is run, if None is the directory in which your script is run</span> + <span class="s2">"condor_submit"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"condor_submit"</span><span class="p">),</span> <span class="c1"># the condor_submit command</span> + <span class="s2">"condor_q"</span><span class="p">:</span> <span class="n">shutil</span><span class="o">.</span><span class="n">which</span><span class="p">(</span><span class="s2">"condor_q"</span><span class="p">),</span> <span class="c1"># the condor_submit command</span> + <span class="s2">"condor_getenv"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="c1"># if True condor takes the environment at submission and copies it to the jobs. You almost certainly want this.</span> + <span class="s2">"condor_batchname"</span><span class="p">:</span> <span class="s2">"binary_c-condor"</span><span class="p">,</span> <span class="c1"># Condor batchname option</span> + <span class="s2">"condor_kill_sig"</span><span class="p">:</span> <span class="s2">"SIGINT"</span><span class="p">,</span> <span class="c1"># signal Condor should use to stop a process : note that grid.py expects this to be "SIGINT"</span> + <span class="c1"># ########################################</span> + <span class="c1"># # GRID</span> + <span class="c1"># ########################################</span> + <span class="c1"># control flow</span> + <span class="s2">"rungrid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># usually run the grid, but can be 0 to skip it (e.g. for condor/slurm admin)</span> + <span class="p">}</span></div> + +<div class="viewcode-block" id="grid_options_defaults.get_grid_options_descriptions"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_descriptions">[docs]</a> <span class="k">def</span> <span class="nf">get_grid_options_descriptions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the descriptions for all the grid options</span> + +<span class="sd"> TODO: consider putting input types for all of them</span> +<span class="sd"> """</span> + + <span class="c1"># Grid containing the descriptions of the options</span> + <span class="k">return</span> <span class="p">{</span> + <span class="s2">"tmp_dir"</span><span class="p">:</span> <span class="s2">"Directory where certain types of output are stored. The grid code is stored in that directory, as well as the custom logging libraries. Log files and other diagnostics will usually be written to this location, unless specified otherwise"</span><span class="p">,</span> <span class="c1"># TODO: improve this</span> + <span class="s2">"status_dir"</span><span class="p">:</span> <span class="s2">"Directory where grid status is stored"</span><span class="p">,</span> + <span class="s2">"_binary_c_dir"</span><span class="p">:</span> <span class="s2">"Director where binary_c is stored. This options are not really used"</span><span class="p">,</span> + <span class="s2">"_binary_c_config_executable"</span><span class="p">:</span> <span class="s2">"Full path of the binary_c-config executable. This options is not used in the population object."</span><span class="p">,</span> + <span class="s2">"_binary_c_executable"</span><span class="p">:</span> <span class="s2">"Full path to the binary_c executable. This options is not used in the population object."</span><span class="p">,</span> + <span class="s2">"_binary_c_shared_library"</span><span class="p">:</span> <span class="s2">"Full path to the libbinary_c file. This options is not used in the population object"</span><span class="p">,</span> + <span class="s2">"verbosity"</span><span class="p">:</span> <span class="s2">"Verbosity of the population code. Default is 0, by which only errors will be printed. Higher values will show more output, which is good for debugging."</span><span class="p">,</span> + <span class="s2">"log_dt"</span><span class="p">:</span> <span class="s2">"Time between verbose logging output."</span><span class="p">,</span> + <span class="s2">"log_newline"</span><span class="p">:</span> <span class="s2">"Newline character used at the end of verbose logging statements. This is </span><span class="se">\\</span><span class="s2">n (newline) by default, but </span><span class="se">\\</span><span class="s2">x0d (carriage return) might also be what you want."</span><span class="p">,</span> + <span class="s2">"n_logging_stats"</span><span class="p">:</span> <span class="s2">"Number of logging statistics used to calculate time remaining (etc.). E.g., if you set this to 10 the previous 10 calls to the verbose log will be used to construct an estimate of the time remaining."</span><span class="p">,</span> + <span class="s2">"num_cores"</span><span class="p">:</span> <span class="s2">"The number of cores that the population grid will use. You can set this manually by entering an integer great than 0. When 0 uses all logical cores. When -1 uses all physical cores. Input: int"</span><span class="p">,</span> + <span class="s2">"num_processes"</span><span class="p">:</span> <span class="s2">"Number of processes launched by multiprocessing. This should be set automatically by binary_c-python, not by the user."</span><span class="p">,</span> + <span class="s2">"_start_time_evolution"</span><span class="p">:</span> <span class="s2">"Variable storing the start timestamp of the population evolution. Set by the object itself."</span><span class="p">,</span> + <span class="s2">"_end_time_evolution"</span><span class="p">:</span> <span class="s2">"Variable storing the end timestamp of the population evolution. Set by the object itself"</span><span class="p">,</span> + <span class="s2">"_total_starcount"</span><span class="p">:</span> <span class="s2">"Variable storing the total number of systems in the generator. Used and set by the population object."</span><span class="p">,</span> + <span class="s2">"_custom_logging_shared_library_file"</span><span class="p">:</span> <span class="s2">"filename for the custom_logging shared library. Used and set by the population object"</span><span class="p">,</span> + <span class="s2">"_errors_found"</span><span class="p">:</span> <span class="s2">"Variable storing a Boolean flag whether errors by binary_c are encountered."</span><span class="p">,</span> + <span class="s2">"_errors_exceeded"</span><span class="p">:</span> <span class="s2">"Variable storing a Boolean flag whether the number of errors was higher than the set threshold (failed_systems_threshold). If True, then the command line arguments of the failing systems will not be stored in the failed_system_log files."</span><span class="p">,</span> + <span class="s2">"source_file_filename"</span><span class="p">:</span> <span class="s2">"Variable containing the source file containing lines of binary_c command line calls. These all have to start with binary_c."</span><span class="p">,</span> <span class="c1"># TODO: Expand</span> + <span class="s2">"C_auto_logging"</span><span class="p">:</span> <span class="s2">"Dictionary containing parameters to be logged by binary_c. The structure of this dictionary is as follows: the key is used as the headline which the user can then catch. The value at that key is a list of binary_c system parameters (like star[0].mass)"</span><span class="p">,</span> + <span class="s2">"C_logging_code"</span><span class="p">:</span> <span class="s2">"Variable to store the exact code that is used for the custom_logging. In this way the user can do more complex logging, as well as putting these logging strings in files."</span><span class="p">,</span> + <span class="s2">"_failed_count"</span><span class="p">:</span> <span class="s2">"Variable storing the number of failed systems."</span><span class="p">,</span> + <span class="s2">"_evolution_type_options"</span><span class="p">:</span> <span class="s2">"List containing the evolution type options."</span><span class="p">,</span> + <span class="s2">"_failed_prob"</span><span class="p">:</span> <span class="s2">"Variable storing the total probability of all the failed systems"</span><span class="p">,</span> + <span class="s2">"_failed_systems_error_codes"</span><span class="p">:</span> <span class="s2">"List storing the unique error codes raised by binary_c of the failed systems"</span><span class="p">,</span> + <span class="s2">"_grid_variables"</span><span class="p">:</span> <span class="s2">"Dictionary storing the grid_variables. These contain properties which are accessed by the _generate_grid_code function"</span><span class="p">,</span> + <span class="s2">"_population_id"</span><span class="p">:</span> <span class="s2">"Variable storing a unique 32-char hex string."</span><span class="p">,</span> + <span class="s2">"_commandline_input"</span><span class="p">:</span> <span class="s2">"String containing the arguments passed to the population object via the command line. Set and used by the population object."</span><span class="p">,</span> + <span class="s2">"_system_generator"</span><span class="p">:</span> <span class="s2">"Function object that contains the system generator function. This can be from a grid, or a source file, or a Monte Carlo grid."</span><span class="p">,</span> + <span class="s2">"gridcode_filename"</span><span class="p">:</span> <span class="s2">"Filename for the grid code. Set and used by the population object. TODO: allow the user to provide their own function, rather than only a generated function."</span><span class="p">,</span> + <span class="s2">"log_args"</span><span class="p">:</span> <span class="s2">"Boolean to log the arguments."</span><span class="p">,</span> + <span class="s2">"log_args_dir"</span><span class="p">:</span> <span class="s2">"Directory to log the arguments to."</span><span class="p">,</span> + <span class="s2">"log_file"</span><span class="p">:</span> <span class="s2">"Log file for the population object. Unused"</span><span class="p">,</span> + <span class="s2">"custom_logging_func_memaddr"</span><span class="p">:</span> <span class="s2">"Memory address where the custom_logging_function is stored. Input: int"</span><span class="p">,</span> + <span class="s2">"_count"</span><span class="p">:</span> <span class="s2">"Counter tracking which system the generator is on."</span><span class="p">,</span> + <span class="s2">"_probtot"</span><span class="p">:</span> <span class="s2">"Total probability of the population."</span><span class="p">,</span> + <span class="s2">"_main_pid"</span><span class="p">:</span> <span class="s2">"Main process ID of the master process. Used and set by the population object."</span><span class="p">,</span> + <span class="s2">"_store_memaddr"</span><span class="p">:</span> <span class="s2">"Memory address of the store object for binary_c."</span><span class="p">,</span> + <span class="s2">"failed_systems_threshold"</span><span class="p">:</span> <span class="s2">"Variable storing the maximum number of systems that are allowed to fail before logging their command line arguments to failed_systems log files"</span><span class="p">,</span> + <span class="s2">"parse_function"</span><span class="p">:</span> <span class="s2">"Function that the user can provide to handle the output the binary_c. This function has to take the arguments (self, output). Its best not to return anything in this function, and just store stuff in the self.grid_results dictionary, or just output results to a file"</span><span class="p">,</span> + <span class="c1">############################################################</span> + <span class="c1"># Condor</span> + <span class="s2">"condor"</span><span class="p">:</span> <span class="s2">"Integer flag used to control HTCondor (referred to as Condor here) jobs. Default is 0 which means no Condor. 1 means launch Condor jobs. Do not manually set this to 2 (run Condor jobs) or 3 (join Condor job data) unless you know what you are doing, this is usually done for you."</span><span class="p">,</span> + <span class="s2">"condor_dir"</span><span class="p">:</span> <span class="s2">"String. Working directory containing e.g. scripts, output, logs (e.g. should be NFS available to all jobs). This directory should not exist when you launch the Condor jobs."</span><span class="p">,</span> + <span class="s2">"condor_njobs"</span><span class="p">:</span> <span class="s2">"Integer. Number of jobs that Condor will run"</span><span class="p">,</span> + <span class="s2">"condor_ClusterID"</span><span class="p">:</span> <span class="s2">"Integer. Condor ClusterID variable, equivalent to Slurm's jobid. Jobs are numbered <ClusterID>.<Process>"</span><span class="p">,</span> + <span class="s2">"condor_Process"</span><span class="p">:</span> <span class="s2">"Integer. Condor Process variable, equivalent to Slurm's jobarrayindex. Jobs are numbered <ClusterID>.<Process>"</span><span class="p">,</span> + <span class="s2">"condor_postpone_submit"</span><span class="p">:</span> <span class="s2">"Integer. Debugging tool. If 1, the condor script is not submitted (useful for debugging). Default 0."</span><span class="p">,</span> + <span class="s2">"condor_postpone_join"</span><span class="p">:</span> <span class="s2">"Integer. Use to delay the joining of Condor grid data. If 1, data is not joined, e.g. if you want to do it off the condor grid (e.g. with more RAM). Default 0."</span><span class="p">,</span> + <span class="s2">"condor_memory"</span><span class="p">:</span> <span class="s2">"Integer. In MB, the memory use (ImageSize) of the job."</span><span class="p">,</span> + <span class="s2">"condor_warn_max_memory"</span><span class="p">:</span> <span class="s2">"Integer. In MB, the memory use (ImageSize) of the job."</span><span class="p">,</span> + <span class="s2">"condor_universe"</span><span class="p">:</span> <span class="s1">'String. The HTCondor "universe": this is "vanilla" by default.'</span><span class="p">,</span> + <span class="s2">"condor_extra_settings"</span><span class="p">:</span> <span class="s2">"Dictionary. Place to put extra configuration for the CONDOR submit file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so."</span><span class="p">,</span> + <span class="s2">"condor_snapshot_on_kill"</span><span class="p">:</span> <span class="s2">"Integer. If 1 we save a snapshot on SIGKILL before exit."</span><span class="p">,</span> + <span class="s2">"condor_stream_output"</span><span class="p">:</span> <span class="s2">"Boolean. If True, we activate Condor's stdout stream. If False, this data is copied at the end of the job."</span><span class="p">,</span> + <span class="s2">"condor_stream_error"</span><span class="p">:</span> <span class="s2">"Boolean. If True, we activate Condor's stderr stream. If False, this data is copied at the end of the job."</span><span class="p">,</span> + <span class="s2">"condor_should_transfer_files"</span><span class="p">:</span> <span class="s1">'Integer. Condor</span><span class="se">\'</span><span class="s1">s option to transfer files at the end of the job. You should set this to "YES"'</span><span class="p">,</span> + <span class="s2">"condor_when_to_transfer_output"</span><span class="p">:</span> <span class="s1">'Integer. Condor</span><span class="se">\'</span><span class="s1">s option to decide when output files are transferred. You should usually set this to "ON_EXIT_OR_EVICT"'</span><span class="p">,</span> + <span class="s2">"condor_requirements"</span><span class="p">:</span> <span class="s2">"String. Condor job requirements. These are passed to Condor directly, you should read the HTCondor manual to learn about this. If no requirements exist, leave as an string."</span><span class="p">,</span> + <span class="s2">"condor_env"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "env" command, e.g. /usr/bin/env or /bin/env, that is used in Condor launch scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"condor_bash"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "bash" command, e.g. /bin/bash, that is used in Condor launch scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"condor_pwd"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "pwd" command, e.g. /bin/pwd, that is used in Condor launch scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"condor_date"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "date" command, e.g. /usr/bin/date, that is used in Condor launch scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"condor_initial_dir"</span><span class="p">:</span> <span class="s2">"String. Directory from which condor scripts are run. If set to the default, None, this is the directory from which your script is run."</span><span class="p">,</span> + <span class="s2">"condor_submit"</span><span class="p">:</span> <span class="s1">'String. The Condor_submit command, usually "/usr/bin/condor_submit" but will depend on your HTCondor installation.'</span><span class="p">,</span> + <span class="s2">"condor_q"</span><span class="p">:</span> <span class="s1">'String. The Condor_q command, usually "/usr/bin/condor_q" but will depend on your HTCondor installation.'</span><span class="p">,</span> + <span class="s2">"condor_getenv"</span><span class="p">:</span> <span class="s2">"Boolean. If True, the default, condor takes the environment at submission and copies it to the jobs. You almost certainly want this to be True."</span><span class="p">,</span> + <span class="s2">"condor_batchname"</span><span class="p">:</span> <span class="s1">'String. Condor batchname option: this is what appears in condor_q. Defaults to "binary_c-condor"'</span><span class="p">,</span> + <span class="s2">"condor_kill_sig"</span><span class="p">:</span> <span class="s1">'String. Signal Condor should use to stop a process. Note that grid.py expects this to be "SIGINT" which is the default.'</span><span class="p">,</span> + <span class="c1">############################################################</span> + <span class="c1"># Slurm options</span> + <span class="c1">############################################################</span> + <span class="s2">"slurm"</span><span class="p">:</span> <span class="s2">"Integer flag used to control Slurm jobs. Default is 0 which means no Slurm. 1 means launch Slurm jobs. Do not manually set this to 2 (run Slurm jobs) or 3 (join Slurm job data) unless you know what you are doing, this is usually done for you."</span><span class="p">,</span> + <span class="s2">"slurm_dir"</span><span class="p">:</span> <span class="s2">"String. Working directory containing e.g. scripts, output, logs (e.g. should be NFS available to all jobs). This directory should not exist when you launch the Slurm jobs."</span><span class="p">,</span> + <span class="s2">"slurm_ntasks"</span><span class="p">:</span> <span class="s2">"Integer. Number of CPUs required per array job: usually only need this to be 1 (the default)."</span><span class="p">,</span> + <span class="s2">"slurm_njobs"</span><span class="p">:</span> <span class="s2">"Integer. Number of Slurm jobs to be launched."</span><span class="p">,</span> + <span class="s2">"slurm_jobid"</span><span class="p">:</span> <span class="s2">"Integer. Slurm job id. Each job is numbered <slurm_jobid>.<slurm_jobarrayindex>."</span><span class="p">,</span> + <span class="s2">"slurm_jobarrayindex"</span><span class="p">:</span> <span class="s2">"Integer. Slurm job array index. Each job is numbered <slurm_jobid>.<slurm_jobarrayindex>."</span><span class="p">,</span> + <span class="s2">"slurm_memory"</span><span class="p">:</span> <span class="s1">'String. Memory required for the job. Should be in megabytes in a format that Slurm understands, e.g. "512MB" (the default).'</span><span class="p">,</span> + <span class="s2">"slurm_warn_max_memory"</span><span class="p">:</span> <span class="s1">'String. If we set slurm_memory in excess of this, warn the user because this is usually a mistake. Default "1024MB".'</span><span class="p">,</span> + <span class="s2">"slurm_postpone_join"</span><span class="p">:</span> <span class="s2">"Integer, default 0. If 1 do not join job results with Slurm, instead you have to do it later manually."</span><span class="p">,</span> + <span class="s2">"slurm_jobname"</span><span class="p">:</span> <span class="s1">'String which names the Slurm jobs, default "binary_c-python".'</span><span class="p">,</span> + <span class="s2">"slurm_partition"</span><span class="p">:</span> <span class="s2">"String containing the Slurm partition name. You should check your local Slurm installation to find out partition information, e.g. using the sview command."</span><span class="p">,</span> + <span class="s2">"slurm_time"</span><span class="p">:</span> <span class="s2">"String. The time a Slurm job is allowed to take. Default is 0 which means no limit. Please check the Slurm documentation for required format of this option."</span><span class="p">,</span> + <span class="s2">"slurm_postpone_sbatch"</span><span class="p">:</span> <span class="s2">"Integer, default 0. If set to 1, do not launch Slurm jobs with sbatch, just make the scripts that would have."</span><span class="p">,</span> + <span class="s2">"slurm_array"</span><span class="p">:</span> <span class="s2">"String. Override for Slurm's --array option, useful for rerunning jobs manually. Default None."</span><span class="p">,</span> + <span class="s2">"slurm_array_max_jobs"</span><span class="p">:</span> <span class="s2">"Integer. Override for the max number of concurrent Slurm array jobs. Default None."</span><span class="p">,</span> + <span class="s2">"slurm_extra_settings"</span><span class="p">:</span> <span class="s2">"Dictionary of extra settings for Slurm to put in its launch script. Please see the Slurm documentation for the many options that are available to you."</span><span class="p">,</span> + <span class="s2">"slurm_sbatch"</span><span class="p">:</span> <span class="s1">'String. The Slurm "sbatch" submission command, usually "/usr/bin/sbatch" but will depend on your Slurm installation. By default is set automatically.'</span><span class="p">,</span> + <span class="s2">"slurm_env"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "env" command, e.g. /usr/bin/env or /bin/env, that is used in Slurm scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"slurm_bash"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "bash" command, e.g. /bin/bash, that is used in Slurm scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"slurm_pwd"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "pwd" command, e.g. /bin/pwd, that is used in Slurm scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="s2">"slurm_date"</span><span class="p">:</span> <span class="s1">'String. Points the location of the "date" command, e.g. /usr/bin/date, that is used in Slurm scripts. This is set automatically on the submit machine, so if it is different on the nodes, you should set it manually.'</span><span class="p">,</span> + <span class="c1">############################################################</span> + <span class="c1"># High power computing (HPC) variables</span> + <span class="c1">############################################################</span> + <span class="s2">"HPC_force_join"</span><span class="p">:</span> <span class="s1">'Integer, default 0. If 1, and the HPC variable ("slurm" or "condor") is 3, skip checking our own job and force the join.'</span><span class="p">,</span> + <span class="s2">"HPC_rebuild_joinlist"</span><span class="p">:</span> <span class="s2">"Integer, default 0. If 1, ignore the joinlist we would usually use and rebuild it automatically"</span><span class="p">,</span> + <span class="c1">############################################################</span> + <span class="c1"># Cacheing</span> + <span class="c1">############################################################</span> + <span class="s2">"function_cache"</span><span class="p">:</span> <span class="s2">"Boolean, default True. If True, we use a cache for certain function calls."</span><span class="p">,</span> + <span class="s2">"function_cache_default_maxsize"</span><span class="p">:</span> <span class="s2">"Integer, default 256. The default maxsize of the cache. Should be a power of 2."</span><span class="p">,</span> + <span class="s2">"function_cache_default_type"</span><span class="p">:</span> <span class="s2">"String. One of the following types: LRUCache, LFUCache, FIFOCache, MRUCache, RRCache, TTLCache, NullCache, NoCache. You can find details of what these mean in the Python cachetools manual, except fo NoCache which means no cache is used at all, and NullCache is a dummy cache that never matches, used for testing overheads."</span><span class="p">,</span> + <span class="s2">"function_cache_functions."</span><span class="p">:</span> <span class="s2">"Dict. Keys are the function names that should be in the cache. The value is a tuple of (cache_size, cache_type, test_args) where cache_size used as the size of the cache, or if 0 the function_cache_default_maxsize is used. The cache_type is the function_cache_default_type if None, otherwise is the cache type (see the list defined at function_cache_default_type). The test_args are constant arguments used to call the function when testing the cache, see cache.cache_test() for details."</span><span class="p">,</span> + <span class="c1">############################################################</span> + <span class="s2">"weight"</span><span class="p">:</span> <span class="s2">"Weight factor for each system. The calculated probability is multiplied by this. If the user wants each system to be repeated several times, then this variable should not be changed, rather change the _repeat variable instead, as that handles the reduction in probability per system. This is useful for systems that have a process with some random element in it."</span><span class="p">,</span> <span class="c1"># TODO: add more info here, regarding the evolution splitting.</span> + <span class="s2">"repeat"</span><span class="p">:</span> <span class="s2">"Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating."</span><span class="p">,</span> + <span class="s2">"evolution_type"</span><span class="p">:</span> <span class="s2">"Variable containing the type of evolution used of the grid. Multiprocessing, linear processing or possibly something else (e.g. for Slurm or Condor)."</span><span class="p">,</span> + <span class="s2">"combine_ensemble_with_thread_joining"</span><span class="p">:</span> <span class="s2">"Boolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_</span><span class="si">{population_id}</span><span class="s2">_</span><span class="si">{thread_id}</span><span class="s2">.json"</span><span class="p">,</span> + <span class="s2">"log_runtime_systems"</span><span class="p">:</span> <span class="s2">"Whether to log the runtime of the systems . Each systems run by the thread is logged to a file and is stored in the tmp_dir. (1 file per thread). Don't use this if you are planning to run a lot of systems. This is mostly for debugging and finding systems that take long to run. Integer, default = 0. if value is 1 then the systems are logged"</span><span class="p">,</span> + <span class="s2">"_total_mass_run"</span><span class="p">:</span> <span class="s2">"To count the total mass that thread/process has ran"</span><span class="p">,</span> + <span class="s2">"_total_probability_weighted_mass_run"</span><span class="p">:</span> <span class="s2">"To count the total mass * probability for each system that thread/process has ran"</span><span class="p">,</span> + <span class="s2">"_actually_evolve_system"</span><span class="p">:</span> <span class="s2">"Whether to actually evolve the systems of just act as if. for testing. used in _process_run_population_grid"</span><span class="p">,</span> + <span class="s2">"max_queue_size"</span><span class="p">:</span> <span class="s2">"Maximum size of the queue that is used to feed the processes. Don't make this too big! Default: 1000. Input: int"</span><span class="p">,</span> + <span class="s2">"_set_Moe2017_grid"</span><span class="p">:</span> <span class="s2">"Internal flag whether the Moe and di Stefano (2017) grid has been loaded"</span><span class="p">,</span> + <span class="s2">"run_zero_probability_system"</span><span class="p">:</span> <span class="s2">"Whether to run the zero probability systems. Default: True. Input: Boolean"</span><span class="p">,</span> + <span class="s2">"_zero_prob_stars_skipped"</span><span class="p">:</span> <span class="s2">"Internal counter to track how many systems are skipped because they have 0 probability"</span><span class="p">,</span> + <span class="s2">"ensemble_factor_in_probability_weighted_mass"</span><span class="p">:</span> <span class="s2">"Flag to multiply all the ensemble results with 1/probability_weighted_mass"</span><span class="p">,</span> + <span class="s2">"multiplicity_fraction_function"</span><span class="p">:</span> <span class="s2">"Which multiplicity fraction function to use. 0: None, 1: Arenou 2010, 2: Rhagavan 2010, 3: Moe and di Stefano (2017) 2017"</span><span class="p">,</span> + <span class="s2">"m&s_options"</span><span class="p">:</span> <span class="s2">"Internal variable that holds the Moe and di Stefano (2017) options. Don't write to this your self"</span><span class="p">,</span> + <span class="s2">"_loaded_Moe2017_data"</span><span class="p">:</span> <span class="s2">"Internal variable storing whether the Moe and di Stefano (2017) data has been loaded into memory"</span><span class="p">,</span> + <span class="s2">"do_dry_run"</span><span class="p">:</span> <span class="s2">"Whether to do a dry run to calculate the total probability for this run"</span><span class="p">,</span> + <span class="s2">"dry_run_hook"</span><span class="p">:</span> <span class="s2">"Function hook to be called for every system in a dry run. The function is passed a dict of the system parameters. Does nothing if None (the default)."</span><span class="p">,</span> + <span class="s2">"return_after_dry_run"</span><span class="p">:</span> <span class="s2">"If True, return immediately after a dry run (and don't run actual stars). Default is False."</span><span class="p">,</span> + <span class="s2">"exit_after_dry_run"</span><span class="p">:</span> <span class="s2">"If True, exits after a dry run. Default is False."</span><span class="p">,</span> + <span class="s2">"print_stack_on_exit"</span><span class="p">:</span> <span class="s2">"If True, prints a stack trace when the population's exit method is called."</span><span class="p">,</span> + <span class="s2">"_Moe2017_JSON_data"</span><span class="p">:</span> <span class="s2">"Location to store the loaded Moe&diStefano2017 dataset"</span><span class="p">,</span> <span class="c1"># Stores the data</span> + <span class="p">}</span></div> + + <span class="c1">#################################</span> + <span class="c1"># Grid options functions</span> + + <span class="c1"># Utility functions</span> +<div class="viewcode-block" id="grid_options_defaults.grid_options_help"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_help">[docs]</a> <span class="k">def</span> <span class="nf">grid_options_help</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">option</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that prints out the description of a grid option. Useful function for the user.</span> + +<span class="sd"> Args:</span> +<span class="sd"> option: which option you want to have the description of</span> + +<span class="sd"> returns:</span> +<span class="sd"> dict containing the option, the description if its there, otherwise empty string. And if the key doesnt exist, the dict is empty</span> +<span class="sd"> """</span> + + <span class="c1">#</span> + <span class="n">grid_options_defaults_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_defaults_dict</span><span class="p">()</span> + <span class="n">grid_options_descriptions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_descriptions</span><span class="p">()</span> + + <span class="c1">#</span> + <span class="n">option_keys</span> <span class="o">=</span> <span class="n">grid_options_defaults_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">description_keys</span> <span class="o">=</span> <span class="n">grid_options_descriptions</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1"># If the option is unknown</span> + <span class="k">if</span> <span class="n">option</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">option_keys</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Error: This is an invalid entry. Option does not exist, please choose from the following options:</span><span class="se">\n\t</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">option_keys</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span> <span class="p">{}</span> + + <span class="c1"># If its not described</span> + <span class="k">if</span> <span class="n">option</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">description_keys</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"This option has not been described properly yet. Please contact on of the authors"</span> + <span class="p">)</span> + <span class="k">return</span> <span class="p">{</span><span class="n">option</span><span class="p">:</span> <span class="s2">""</span><span class="p">}</span> + + <span class="c1"># If its known and described:</span> + <span class="nb">print</span><span class="p">(</span><span class="n">grid_options_descriptions</span><span class="p">[</span><span class="n">option</span><span class="p">])</span> + <span class="k">return</span> <span class="p">{</span><span class="n">option</span><span class="p">:</span> <span class="n">grid_options_descriptions</span><span class="p">[</span><span class="n">option</span><span class="p">]}</span></div> + +<div class="viewcode-block" id="grid_options_defaults.grid_options_description_checker"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_description_checker">[docs]</a> <span class="k">def</span> <span class="nf">grid_options_description_checker</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">print_info</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that checks which descriptions are missing</span> + +<span class="sd"> Args:</span> +<span class="sd"> print_info: whether to print out information about which options contain proper descriptions and which do not</span> + +<span class="sd"> Returns:</span> +<span class="sd"> the number of undescribed keys</span> +<span class="sd"> """</span> + + <span class="c1">#</span> + <span class="n">grid_options_defaults_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_defaults_dict</span><span class="p">()</span> + <span class="n">grid_options_descriptions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_descriptions</span><span class="p">()</span> + + <span class="c1">#</span> + <span class="n">option_keys</span> <span class="o">=</span> <span class="n">grid_options_defaults_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="n">description_keys</span> <span class="o">=</span> <span class="n">grid_options_descriptions</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + + <span class="c1">#</span> + <span class="n">undescribed_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">option_keys</span><span class="p">)</span> <span class="o">-</span> <span class="nb">set</span><span class="p">(</span><span class="n">description_keys</span><span class="p">))</span> + + <span class="k">if</span> <span class="n">undescribed_keys</span><span class="p">:</span> + <span class="k">if</span> <span class="n">print_info</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Warning: the following keys have no description yet:</span><span class="se">\n\t</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">undescribed_keys</span><span class="p">))</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Total description progress: </span><span class="si">{:.2f}%%</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="mi">100</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">description_keys</span><span class="p">)</span> <span class="o">/</span> <span class="nb">len</span><span class="p">(</span><span class="n">option_keys</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="n">undescribed_keys</span><span class="p">)</span></div> + +<div class="viewcode-block" id="grid_options_defaults.write_grid_options_to_rst_file"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.write_grid_options_to_rst_file">[docs]</a> <span class="k">def</span> <span class="nf">write_grid_options_to_rst_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">output_file</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that writes the descriptions of the grid options to an rst file</span> + +<span class="sd"> Args:</span> +<span class="sd"> output_file: target file where the grid options descriptions are written to</span> +<span class="sd"> """</span> + + <span class="c1"># Get the options and the description</span> + <span class="n">options</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_defaults_dict</span><span class="p">()</span> + <span class="n">descriptions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_grid_options_descriptions</span><span class="p">()</span> + + <span class="c1"># Get those that do not have a description</span> + <span class="n">not_described_yet</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">options</span><span class="p">)</span> <span class="o">-</span> <span class="nb">set</span><span class="p">(</span><span class="n">descriptions</span><span class="p">))</span> + + <span class="c1"># separate public and private options</span> + <span class="n">public_options</span> <span class="o">=</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">options</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"_"</span><span class="p">)]</span> + <span class="n">private_options</span> <span class="o">=</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">options</span> <span class="k">if</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"_"</span><span class="p">)]</span> + + <span class="c1"># Check input</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">output_file</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">".rst"</span><span class="p">):</span> + <span class="n">msg</span><span class="o">=</span><span class="s2">"Filename doesn't end with .rst, please provide a proper filename"</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># M&S options</span> + <span class="n">moe_di_stefano_default_options</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_Moe_di_Stefano_2017_default_options</span><span class="p">()</span> + <span class="n">moe_di_stefano_default_options_description</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_Moe_di_Stefano_2017_default_options_description</span><span class="p">()</span> + + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">output_file</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Population grid code options"</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">f</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="s2">"="</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="s2">"Population grid code options"</span><span class="p">)),</span> <span class="n">file</span><span class="o">=</span><span class="n">f</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"The following chapter contains all grid code options, along with their descriptions"</span><span class="p">,</span> + <span class="n">file</span><span class="o">=</span><span class="n">f</span><span class="p">,</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"There are </span><span class="si">{}</span><span class="s2"> options that are not described yet."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">len</span><span class="p">(</span><span class="n">not_described_yet</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">file</span><span class="o">=</span><span class="n">f</span><span class="p">,</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">f</span><span class="p">)</span> + + <span class="c1"># Start public options part</span> + <span class="bp">self</span><span class="o">.</span><span class="n">print_option_descriptions</span><span class="p">(</span> + <span class="n">f</span><span class="p">,</span> + <span class="n">public_options</span><span class="p">,</span> + <span class="n">descriptions</span><span class="p">,</span> + <span class="s2">"Public options"</span><span class="p">,</span> + <span class="s2">"The following options are meant to be changed by the user."</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Moe & di Stefano options:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">print_option_descriptions</span><span class="p">(</span> + <span class="n">f</span><span class="p">,</span> + <span class="n">moe_di_stefano_default_options</span><span class="p">,</span> + <span class="n">moe_di_stefano_default_options_description</span><span class="p">,</span> + <span class="s2">"Moe & di Stefano sampler options"</span><span class="p">,</span> + <span class="s2">"The following options are meant to be changed by the user."</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Start private options part</span> + <span class="bp">self</span><span class="o">.</span><span class="n">print_option_descriptions</span><span class="p">(</span> + <span class="n">f</span><span class="p">,</span> + <span class="n">private_options</span><span class="p">,</span> + <span class="n">descriptions</span><span class="p">,</span> + <span class="s2">"Private options"</span><span class="p">,</span> + <span class="s2">"The following options are not meant to be changed by the user, as these options are used and set internally by the object itself. The description still is provided, but just for documentation purposes."</span><span class="p">,</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="grid_options_defaults.print_option_descriptions"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.print_option_descriptions">[docs]</a> <span class="k">def</span> <span class="nf">print_option_descriptions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filehandle</span><span class="p">,</span> <span class="n">options</span><span class="p">,</span> <span class="n">descriptions</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">extra_text</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to print the description of an option</span> +<span class="sd"> """</span> + + <span class="c1"># Start public options part</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">title</span><span class="p">),</span> <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="s2">"-"</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="s2">"</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">title</span><span class="p">))),</span> <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">extra_text</span><span class="p">),</span> <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">)</span> + + <span class="k">for</span> <span class="n">option</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">options</span><span class="p">):</span> + <span class="k">if</span> <span class="n">option</span> <span class="ow">in</span> <span class="n">descriptions</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"| **</span><span class="si">{}</span><span class="s2">**: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">option</span><span class="p">,</span> <span class="n">descriptions</span><span class="p">[</span><span class="n">option</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"</span><span class="se">\n\t</span><span class="s2">"</span><span class="p">)</span> + <span class="p">),</span> + <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"| **</span><span class="si">{}</span><span class="s2">**: No description available yet"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">option</span><span class="p">),</span> + <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">,</span> + <span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">""</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">filehandle</span><span class="p">)</span></div> + +<div class="viewcode-block" id="grid_options_defaults.default_cache_dir"><a class="viewcode-back" href="../../../../population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.default_cache_dir">[docs]</a> <span class="k">def</span> <span class="nf">default_cache_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return a default cache directory path, or None if we cannot find one.</span> +<span class="sd"> """</span> + <span class="n">error_string</span> <span class="o">=</span> <span class="s2">"__*ERR*__"</span> <span class="c1"># string that cannot be a path</span> + <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="p">[</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"HOME"</span><span class="p">,</span> <span class="n">error_string</span><span class="p">),</span> <span class="s2">".cache"</span><span class="p">,</span> <span class="s2">"binary_c"</span><span class="p">),</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"TMP"</span><span class="p">,</span> <span class="n">error_string</span><span class="p">),</span> <span class="s2">"cache"</span><span class="p">),</span> + <span class="p">]:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">error_string</span> <span class="ow">in</span> <span class="n">path</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">path</span><span class="p">):</span> + <span class="k">return</span> <span class="n">path</span> + <span class="k">return</span> <span class="kc">None</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/gridcode.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/gridcode.html new file mode 100644 index 0000000000000000000000000000000000000000..17238a83dc023439b199f0b3a7771fdc72b25080 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/gridcode.html @@ -0,0 +1,1240 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.gridcode — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.gridcode</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.gridcode</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the gridcode generation functions for the binarycpython package.</span> + +<span class="sd">This class object is an extension to the population grid object</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">datetime</span> +<span class="kn">import</span> <span class="nn">importlib</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span><span class="p">,</span> <span class="n">Any</span> + + +<span class="n">_count</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1"># used for file symlinking (for testing only)</span> +<span class="n">_numba</span> <span class="o">=</span> <span class="kc">False</span> <span class="c1"># activate experimental numba code?</span> + + +<div class="viewcode-block" id="gridcode"><a class="viewcode-back" href="../../../../population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode">[docs]</a><span class="k">class</span> <span class="nc">gridcode</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension to the population grid object that contains functionality to handle the metadata that will be put in the ensemble</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the gridcode class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + + <span class="c1">###################################################</span> + <span class="c1"># Grid code functions</span> + <span class="c1">#</span> + <span class="c1"># Function below are used to run populations with</span> + <span class="c1"># a variable grid</span> + <span class="c1">###################################################</span> + <span class="k">def</span> <span class="nf">_gridcode_filename</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Returns a filename for the gridcode.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">():</span> + <span class="n">filename</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"tmp_dir"</span><span class="p">],</span> + <span class="s2">"binary_c_grid_</span><span class="si">{population_id}</span><span class="s2">.</span><span class="si">{jobid}</span><span class="s2">.py"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">population_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_population_id"</span><span class="p">],</span> + <span class="n">jobid</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">jobID</span><span class="p">(),</span> + <span class="p">),</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">filename</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"tmp_dir"</span><span class="p">],</span> + <span class="s2">"binary_c_grid_</span><span class="si">{population_id}</span><span class="s2">.py"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">population_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_population_id"</span><span class="p">]</span> + <span class="p">),</span> + <span class="p">)</span> + <span class="k">return</span> <span class="n">filename</span> + + <span class="k">def</span> <span class="nf">_add_code</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to add code to the grid code string</span> + +<span class="sd"> add code to the code_string</span> + +<span class="sd"> indent (=0) is added once at the beginning</span> +<span class="sd"> mindent (=0) is added for every line</span> + +<span class="sd"> don't use both!</span> +<span class="sd"> """</span> + + <span class="n">indent_block</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_indent_block</span><span class="p">(</span><span class="n">indent</span><span class="p">)</span> + <span class="k">for</span> <span class="n">thing</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent_block</span> <span class="o">+</span> <span class="n">thing</span> + + <span class="k">def</span> <span class="nf">_indent_block</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> return an indent block, with n extra blocks in it</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">indent_depth</span> <span class="o">+</span> <span class="n">n</span><span class="p">)</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">indent_string</span> + + <span class="k">def</span> <span class="nf">_increment_indent_depth</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">delta</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> increment the indent indent_depth by delta</span> +<span class="sd"> """</span> + <span class="bp">self</span><span class="o">.</span><span class="n">indent_depth</span> <span class="o">+=</span> <span class="n">delta</span> + + <span class="k">def</span> <span class="nf">_generate_grid_code</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dry_run</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that generates the code from which the population will be made.</span> + +<span class="sd"> dry_run: when True, it will return the starcount at the end so that we know</span> +<span class="sd"> what the total number of systems is.</span> + +<span class="sd"> The phasevol values are handled by generating a second array</span> + +<span class="sd"> Results in a generated file that contains a system_generator function.</span> + +<span class="sd"> # TODO: make sure running systems with multiplicity 3+ is also possible.</span> +<span class="sd"> # TODO: there is a lot of things going on in this function. Make sure to describe clearly what happens here. </span> +<span class="sd"> """</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span><span class="s2">"Generating grid code"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> <span class="mi">1</span><span class="p">)</span> + + <span class="n">total_grid_variables</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">])</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="c1"># Import packages</span> + <span class="s2">"import math</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"import numpy as np</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"from collections import OrderedDict</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"from binarycpython.utils.distribution_functions import *</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"from binarycpython.utils.spacing_functions import *</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"from binarycpython.utils.useful_funcs import *</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"import numba"</span> <span class="k">if</span> <span class="n">_numba</span> <span class="k">else</span> <span class="s2">""</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Make the function</span> + <span class="s2">"def grid_code(self, print_results=True):</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Increase indent_depth</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="c1"># Write some info in the function</span> + <span class="s2">"# Grid code generated on </span><span class="si">{}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()),</span> + <span class="s2">"# This function generates the systems that will be evolved with binary_c</span><span class="se">\n\n</span><span class="s2">"</span> + <span class="c1"># Set some values in the generated code:</span> + <span class="s2">"# Set initial values</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"_total_starcount = 0</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"starcounts = [0 for i in range(</span><span class="si">{}</span><span class="s2">)]</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">total_grid_variables</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> + <span class="s2">"probabilities = </span><span class="si">{}</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"probabilities_list = [0 for i in range(</span><span class="si">{}</span><span class="s2">)]</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">total_grid_variables</span> <span class="o">+</span> <span class="mi">1</span> + <span class="p">),</span> + <span class="s2">"probabilities_sum = [0 for i in range(</span><span class="si">{}</span><span class="s2">)]</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">total_grid_variables</span> <span class="o">+</span> <span class="mi">1</span> + <span class="p">),</span> + <span class="s2">"parameter_dict = </span><span class="si">{}</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"phasevol = 1</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Set up the system parameters</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"M_1 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"M_2 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"M_3 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"M_4 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"orbital_period = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"orbital_period_triple = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"orbital_period_quadruple = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"eccentricity = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"eccentricity2 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"eccentricity3 = None</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Prepare the probability</span> + <span class="s2">"# set probability lists</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">for</span> <span class="n">grid_variable_el</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span> + <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> + <span class="p">):</span> + <span class="c1"># Make probabilities dict</span> + <span class="n">grid_variable</span> <span class="o">=</span> <span class="n">grid_variable_el</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s1">'probabilities["</span><span class="si">{}</span><span class="s1">"] = 0</span><span class="se">\n</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]))</span> + + <span class="c1">#################################################################################</span> + <span class="c1"># Start of code generation</span> + <span class="c1">#################################################################################</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1"># turn vb to True to have debugging output</span> + <span class="n">vb</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="c1"># Generate code</span> + <span class="k">for</span> <span class="n">loopnr</span><span class="p">,</span> <span class="n">grid_variable_el</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span> + <span class="nb">sorted</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span> + <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">):</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Constructing/adding: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">grid_variable_el</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">2</span><span class="p">,</span> + <span class="p">)</span> + <span class="n">grid_variable</span> <span class="o">=</span> <span class="n">grid_variable_el</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> + + <span class="c1">####################</span> + <span class="c1"># top code</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"topcode"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"topcode"</span><span class="p">])</span> + + <span class="c1">#########################</span> + <span class="c1"># Set up the for loop</span> + <span class="c1"># Add comment for for loop</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"# for loop for variable </span><span class="si">{name}</span><span class="s2"> gridtype </span><span class="si">{gridtype}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">gridtype</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">],</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"sampled_values_</span><span class="si">{}</span><span class="s2"> = </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"samplerfunc"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"print('samples','</span><span class="si">{name}</span><span class="s2">',':',sampled_values_</span><span class="si">{name}</span><span class="s2">)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"print('sample </span><span class="si">{name}</span><span class="s2"> from',sampled_values_</span><span class="si">{name}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1"># calculate number of values and starting location</span> + <span class="c1">#</span> + <span class="c1"># if we're sampling a continuous variable, we</span> + <span class="c1"># have one fewer grid point than the length of the</span> + <span class="c1"># sampled_values list</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span> + <span class="s2">"centred"</span><span class="p">,</span> + <span class="s2">"centre"</span><span class="p">,</span> + <span class="s2">"center"</span><span class="p">,</span> + <span class="s2">"edge"</span><span class="p">,</span> + <span class="s2">"left edge"</span><span class="p">,</span> + <span class="s2">"left"</span><span class="p">,</span> + <span class="s2">"right"</span><span class="p">,</span> + <span class="s2">"right edge"</span><span class="p">,</span> + <span class="p">]:</span> + <span class="n">offset</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"discrete"</span><span class="p">:</span> + <span class="c1"># discrete variables sample all the points</span> + <span class="n">offset</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="n">start</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="c1"># for loop over the variable</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s1">'print("var </span><span class="si">{name}</span><span class="s1"> values ",sampled_values_</span><span class="si">{name}</span><span class="s1">," len ",len(sampled_values_</span><span class="si">{name}</span><span class="s1">)+</span><span class="si">{offset}</span><span class="s1">," gridtype </span><span class="si">{gridtype}</span><span class="s1"> offset </span><span class="si">{offset}</span><span class="se">\\</span><span class="s1">n")</span><span class="se">\n</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> + <span class="n">gridtype</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="n">stop</span> <span class="o">=</span> <span class="s2">"len(sampled_values_</span><span class="si">{name}</span><span class="s2">)+</span><span class="si">{offset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">_numba</span> <span class="ow">and</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"dry_parallel"</span><span class="p">]:</span> + <span class="c1"># Parallel outer loop</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"@numba.jit(parallel=True)</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"def __parallel_func(phasevol,_total_starcount):</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"for </span><span class="si">{name}</span><span class="s2">_sample_number in numba.prange(</span><span class="si">{stop}</span><span class="s2">):</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + <span class="k">if</span> <span class="n">start</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"if </span><span class="si">{name}</span><span class="s2">_sample_number < </span><span class="si">{start}</span><span class="s2">:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"continue</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"for </span><span class="si">{name}</span><span class="s2">_sample_number in range(</span><span class="si">{start}</span><span class="s2">,</span><span class="si">{stop}</span><span class="s2">):</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> + <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># {}_this_index is this grid point's index</span> + <span class="c1"># {}_prev_index and {}_next_index are the previous and next grid points,</span> + <span class="c1"># (which can be None if there is no previous or next, or if</span> + <span class="c1"># previous and next should not be used: this is deliberate)</span> + <span class="c1">#</span> + + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"discrete"</span><span class="p">:</span> + <span class="c1"># discrete grids only care about this,</span> + <span class="c1"># both prev and next should be None to</span> + <span class="c1"># force errors where they are used</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_this_index = </span><span class="si">{name}</span><span class="s2">_sample_number "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">),</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_prev_index = None if </span><span class="si">{name}</span><span class="s2">_this_index == 0 else (</span><span class="si">{name}</span><span class="s2">_this_index - 1) "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">),</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_next_index = None if </span><span class="si">{name}</span><span class="s2">_this_index >= (len(sampled_values_</span><span class="si">{name}</span><span class="s2">)+</span><span class="si">{offset}</span><span class="s2"> - 1) else (</span><span class="si">{name}</span><span class="s2">_this_index + 1)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span> + <span class="p">),</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span> + <span class="s2">"centred"</span><span class="p">,</span> + <span class="s2">"centre"</span><span class="p">,</span> + <span class="s2">"center"</span><span class="p">,</span> + <span class="s2">"edge"</span><span class="p">,</span> + <span class="s2">"left"</span><span class="p">,</span> + <span class="s2">"left edge"</span><span class="p">,</span> + <span class="p">]:</span> + + <span class="c1"># left and centred grids</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"if </span><span class="si">{}</span><span class="s2">_sample_number == 0:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{}</span><span class="s2">_this_index = 0;</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]),</span> <span class="n">indent</span><span class="o">=</span><span class="mi">1</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"else:</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_this_index = </span><span class="si">{name}</span><span class="s2">_sample_number "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_prev_index = (</span><span class="si">{name}</span><span class="s2">_this_index - 1) if </span><span class="si">{name}</span><span class="s2">_this_index > 0 else None "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_next_index = </span><span class="si">{name}</span><span class="s2">_this_index + 1"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"right"</span><span class="p">,</span> <span class="s2">"right edge"</span><span class="p">]:</span> + + <span class="c1"># right edged grid</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"if </span><span class="si">{name}</span><span class="s2">_sample_number == 0:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_this_index = 1;</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]),</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"else:</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_this_index = </span><span class="si">{name}</span><span class="s2">_sample_number + 1 "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">),</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_prev_index = </span><span class="si">{name}</span><span class="s2">_this_index - 1"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2">_next_index = (</span><span class="si">{name}</span><span class="s2">_this_index + 1) if </span><span class="si">{name}</span><span class="s2">_this_index < len(sampled_values_</span><span class="si">{name}</span><span class="s2">) else None"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1"># calculate phase volume</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"dphasevol"</span><span class="p">]</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span> + <span class="c1"># no phase volume required so set it to 1.0</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"dphasevol_</span><span class="si">{name}</span><span class="s2"> = 1.0 # 666</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> + <span class="p">)</span> + + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"right"</span><span class="p">,</span> <span class="s2">"right edge"</span><span class="p">]:</span> + <span class="c1"># right edges always have this and prev defined</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"dphasevol_</span><span class="si">{name}</span><span class="s2"> = (sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index] - sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_prev_index])"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"discrete"</span><span class="p">:</span> + <span class="c1"># discrete might have next defined, use it if we can,</span> + <span class="c1"># otherwise use prev</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"dphasevol_</span><span class="si">{name}</span><span class="s2"> = (sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_next_index] - sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index]) if </span><span class="si">{name}</span><span class="s2">_next_index else (sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index] - sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_prev_index])"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># left and centred always have this and next defined</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"dphasevol_</span><span class="si">{name}</span><span class="s2"> = (sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_next_index] - sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index])"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1">##############</span> + <span class="c1"># Add phasevol check:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"if dphasevol_</span><span class="si">{name}</span><span class="s2"> <= 0:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> + <span class="p">)</span> + + <span class="c1"># n that case we need another local variable which will prevent it from being run but will track those parameters</span> + <span class="c1"># Add phasevol check action:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s1">'print("Grid generator: dphasevol_</span><span class="si">{name}</span><span class="s1"> <= 0! (this=",</span><span class="si">{name}</span><span class="s1">_this_index,"=",sampled_values_</span><span class="si">{name}</span><span class="s1">[</span><span class="si">{name}</span><span class="s1">_this_index],", next=",</span><span class="si">{name}</span><span class="s1">_next_index,"=",sampled_values_</span><span class="si">{name}</span><span class="s1">[</span><span class="si">{name}</span><span class="s1">_next_index],") Skipping current sample.")'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"continue</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"print('sample </span><span class="si">{name}</span><span class="s2"> from ',sampled_values_</span><span class="si">{name}</span><span class="s2">,' at this=',</span><span class="si">{name}</span><span class="s2">_this_index,', next=',</span><span class="si">{name}</span><span class="s2">_next_index)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1"># select sampled point location based on gridtype (left, centre or right)</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span> + <span class="s2">"edge"</span><span class="p">,</span> + <span class="s2">"left"</span><span class="p">,</span> + <span class="s2">"left edge"</span><span class="p">,</span> + <span class="s2">"right"</span><span class="p">,</span> + <span class="s2">"right edge"</span><span class="p">,</span> + <span class="s2">"discrete"</span><span class="p">,</span> + <span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2"> = sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index]"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + <span class="k">elif</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"centred"</span><span class="p">,</span> <span class="s2">"centre"</span><span class="p">,</span> <span class="s2">"center"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{name}</span><span class="s2"> = 0.5 * (sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_next_index] + sampled_values_</span><span class="si">{name}</span><span class="s2">[</span><span class="si">{name}</span><span class="s2">_this_index])"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Unknown gridtype value </span><span class="si">{type}</span><span class="s2">."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">type</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"gridtype"</span><span class="p">]</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"print('hence </span><span class="si">{name}</span><span class="s2"> = ',</span><span class="si">{name}</span><span class="s2">)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1">#################################################################################</span> + <span class="c1"># Check condition and generate for loop</span> + + <span class="c1"># If the grid variable has a condition, write the check and the action</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"condition"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="c1"># Add comment</span> + <span class="s2">"# Condition for </span><span class="si">{name}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]),</span> + <span class="c1"># Add condition check</span> + <span class="s2">"if not </span><span class="si">{condition}</span><span class="s2">:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">condition</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"condition"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># Add condition failed action:</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">]</span> <span class="o">>=</span> <span class="mi">4</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s1">'print("Grid generator: Condition for </span><span class="si">{name}</span><span class="s1"> not met!")'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"continue"</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"continue"</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="c1"># Add some whitespace</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1"># Add some whitespace</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1">#########################</span> + <span class="c1"># Set up pre-code and value in some cases</span> + <span class="c1"># Add pre-code</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"precode"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{precode}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">precode</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"precode"</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_indent_block</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1"># Set phasevol</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"phasevol *= dphasevol_</span><span class="si">{name}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1">#######################</span> + <span class="c1"># Probabilities</span> + <span class="c1"># Calculate probability</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Set probabilities</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"dprob_</span><span class="si">{name}</span><span class="s2"> = dphasevol_</span><span class="si">{name}</span><span class="s2"> * (</span><span class="si">{probdist}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="n">probdist</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"probdist"</span><span class="p">],</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Save probability sum</span> + <span class="s2">"probabilities_sum[</span><span class="si">{n}</span><span class="s2">] += dprob_</span><span class="si">{name}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">n</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"probabilities_list[0] = dprob_</span><span class="si">{name}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"probabilities_list[</span><span class="si">{this}</span><span class="s2">] = probabilities_list[</span><span class="si">{prev}</span><span class="s2">] * dprob_</span><span class="si">{name}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">this</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> + <span class="n">prev</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">]</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1">##############</span> + <span class="c1"># postcode</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"postcode"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{postcode}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">postcode</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"postcode"</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_indent_block</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1">#######################</span> + <span class="c1"># Increment starcount for this parameter</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Increment starcount for </span><span class="si">{name}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]),</span> + <span class="s2">"starcounts[</span><span class="si">{n}</span><span class="s2">] += 1"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">n</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Add value to dict</span> + <span class="s1">'parameter_dict["</span><span class="si">{name}</span><span class="s1">"] = </span><span class="si">{name}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"parameter_name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># The final parts of the code, where things are returned, are within the deepest loop,</span> + <span class="c1"># but in some cases code from a higher loop needs to go under it again</span> + <span class="c1"># SO I think its better to put an if statement here that checks</span> + <span class="c1"># whether this is the last loop.</span> + <span class="k">if</span> <span class="n">loopnr</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">])</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_write_gridcode_system_call</span><span class="p">(</span> + <span class="n">grid_variable</span><span class="p">,</span> + <span class="n">dry_run</span><span class="p">,</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchpoint"</span><span class="p">],</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchcode"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="c1"># increment indent_depth</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1">####################</span> + <span class="c1"># bottom code</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"bottomcode"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"bottomcode"</span><span class="p">])</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1"># Write parts to write below the part that yield the results.</span> + <span class="c1"># this has to go in a reverse order:</span> + <span class="c1"># Here comes the stuff that is put after the deepest nested part that calls returns stuff.</span> + <span class="c1"># Here we will have a</span> + <span class="n">reverse_sorted_grid_variables</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span> + <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="s2">"grid_variable_number"</span><span class="p">],</span> + <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">loopnr</span><span class="p">,</span> <span class="n">grid_variable_el</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">reverse_sorted_grid_variables</span><span class="p">):</span> + <span class="n">grid_variable</span> <span class="o">=</span> <span class="n">grid_variable_el</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"#"</span> <span class="o">*</span> <span class="mi">40</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Code below is for finalising the handling of this iteration of the parameter </span><span class="si">{name}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">),</span> + <span class="p">)</span> + + <span class="c1"># Set phasevol</span> + <span class="c1"># TODO: fix. this isn't supposed to be the value that we give it here. discuss</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"phasevol /= dphasevol_</span><span class="si">{name}</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> + <span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">_numba</span> <span class="ow">and</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"dry_parallel"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"__parallel_func(phasevol,_total_starcount)</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># Check the branchpoint part here. The branchpoint makes sure that we can construct</span> + <span class="c1"># a grid with several multiplicities and still can make the system calls for each</span> + <span class="c1"># multiplicity without reconstructing the grid each time</span> + <span class="k">if</span> <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchpoint"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="c1"># Add comment</span> + <span class="s2">"# Condition for branchpoint at </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">reverse_sorted_grid_variables</span><span class="p">[</span><span class="n">loopnr</span> <span class="o">+</span> <span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">][</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># # Add condition check</span> + <span class="c1"># "if not {}:".format(grid_variable["condition"])</span> + <span class="c1"># + "\n"</span> + <span class="c1"># Add branchpoint</span> + <span class="s2">"if multiplicity==</span><span class="si">{}</span><span class="s2">:"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchpoint"</span><span class="p">])</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_write_gridcode_system_call</span><span class="p">(</span> + <span class="n">reverse_sorted_grid_variables</span><span class="p">[</span><span class="n">loopnr</span> <span class="o">+</span> <span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">],</span> + <span class="n">dry_run</span><span class="p">,</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchpoint"</span><span class="p">],</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="s2">"branchcode"</span><span class="p">],</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="c1">###############################</span> + <span class="c1"># Finalise print statements</span> + <span class="c1">#</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"#"</span> <span class="o">*</span> <span class="mi">40</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"if print_results:</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"print('Grid has handled </span><span class="si">{starcount}</span><span class="s2"> stars with a total probability of </span><span class="si">{probtot:g}</span><span class="s2">'.format(starcount=_total_starcount,probtot=self.grid_options['_probtot']))</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1">################</span> + <span class="c1"># Finalise return statement for dry run.</span> + <span class="c1">#</span> + <span class="k">if</span> <span class="n">dry_run</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"return _total_starcount</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + <span class="c1">#################################################################################</span> + <span class="c1"># Stop of code generation. Here the code is saved and written</span> + + <span class="c1"># Save the grid code to the grid_options</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Save grid code to grid_options"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> <span class="mi">1</span> + <span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"code_string"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">code_string</span> + + <span class="c1"># Write to file</span> + <span class="n">gridcode_filename</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gridcode_filename</span><span class="p">()</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"gridcode_filename"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gridcode_filename</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{blue}</span><span class="s2">Write grid code to </span><span class="si">{file}</span><span class="s2"> [dry_run = </span><span class="si">{dry}</span><span class="s2">]</span><span class="si">{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">blue</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"blue"</span><span class="p">],</span> + <span class="n">file</span><span class="o">=</span><span class="n">gridcode_filename</span><span class="p">,</span> + <span class="n">dry</span><span class="o">=</span><span class="n">dry_run</span><span class="p">,</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">gridcode_filename</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">file</span><span class="p">:</span> + <span class="n">file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">code_string</span><span class="p">)</span> + + <span class="c1"># perhaps create symlink</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">HPC_job</span><span class="p">()</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"symlink_latest_gridcode"</span><span class="p">]:</span> + <span class="k">global</span> <span class="n">_count</span> + <span class="n">symlink</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"tmp_dir"</span><span class="p">],</span> <span class="s2">"binary_c_grid-latest"</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">_count</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">_count</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">symlink</span><span class="p">)</span> + <span class="k">except</span><span class="p">:</span> + <span class="k">pass</span> + + <span class="k">try</span><span class="p">:</span> + <span class="n">os</span><span class="o">.</span><span class="n">symlink</span><span class="p">(</span><span class="n">gridcode_filename</span><span class="p">,</span> <span class="n">symlink</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{blue}</span><span class="s2">Symlinked grid code to </span><span class="si">{symlink}</span><span class="s2"> </span><span class="si">{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">blue</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"blue"</span><span class="p">],</span> + <span class="n">symlink</span><span class="o">=</span><span class="n">symlink</span><span class="p">,</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"symlink failed"</span><span class="p">)</span> + + <span class="k">def</span> <span class="nf">_write_gridcode_system_call</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">grid_variable</span><span class="p">,</span> <span class="n">dry_run</span><span class="p">,</span> <span class="n">branchpoint</span><span class="p">,</span> <span class="n">branchcode</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to write the block of code (as string) that handles the setting the final probability, taking into account the weight and repeat settings, incrementing the total starcount and total probability.</span> + +<span class="sd"> Then if the run is a dry run we implement the dry_run_hook or pass depending on the settings. If it is not a dry run we yield the system dict</span> +<span class="sd"> """</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"#"</span> <span class="o">*</span> <span class="mi">40</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">branchcode</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"# Branch code</span><span class="se">\n</span><span class="s2">if </span><span class="si">{branchcode}</span><span class="s2">:</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">branchcode</span><span class="o">=</span><span class="n">branchcode</span><span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">branchpoint</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"# Code below will get evaluated for every system at this level of multiplicity (last one of that being </span><span class="si">{name}</span><span class="s2">)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"# Code below will get evaluated for every generated system</span><span class="se">\n</span><span class="s2">"</span> + <span class="p">)</span> + + <span class="c1"># Factor in the custom weight input</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Weigh the probability by a custom weighting factor</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s1">'probability = self.grid_options["weight"] * probabilities_list[</span><span class="si">{n}</span><span class="s1">]'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">n</span><span class="o">=</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"grid_variable_number"</span><span class="p">]</span> + <span class="p">)</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Take into account the multiplicity fraction:</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Factor the multiplicity fraction into the probability</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"probability *= self._calculate_multiplicity_fraction(parameter_dict)"</span> + <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Divide by number of repeats</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Divide the probability by the number of repeats</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s1">'probability /= self.grid_options["repeat"]'</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Now we yield the system self.grid_options["repeat"] times.</span> + <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s2">"# Loop over the repeats</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s1">'for _ in range(self.grid_options["repeat"]):'</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"_total_starcount += 1</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># set probability and phasevol values into the system dict</span> + <span class="s1">'parameter_dict["</span><span class="si">{p}</span><span class="s1">"] = </span><span class="si">{p}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">p</span><span class="o">=</span><span class="s2">"probability"</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="s1">'parameter_dict["</span><span class="si">{v}</span><span class="s1">"] = </span><span class="si">{v}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">v</span><span class="o">=</span><span class="s2">"phasevol"</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="c1"># Increment total probability</span> + <span class="s2">"self._increment_probtot(probability)</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> + <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">dry_run</span><span class="p">:</span> + <span class="c1"># Handle what is returned, or what is not.</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"yield(parameter_dict)</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># If its a dry run, dont do anything with it</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># run the hook function, only if given</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"dry_run_hook"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span> + <span class="s2">"self.grid_options['dry_run_hook'](self, parameter_dict)</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">1</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># or pass</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"pass</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_add_code</span><span class="p">(</span><span class="s2">"#"</span> <span class="o">*</span> <span class="mi">40</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">_increment_indent_depth</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">code_string</span> + + <span class="k">def</span> <span class="nf">_load_grid_function</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that loads the grid code from file</span> +<span class="sd"> """</span> + + <span class="c1"># Code to load the</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="n">message</span><span class="o">=</span><span class="s2">"Load grid code function from </span><span class="si">{file}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">file</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"gridcode_filename"</span><span class="p">]</span> + <span class="p">),</span> + <span class="n">verbosity</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="n">minimal_verbosity</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="n">spec</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">spec_from_file_location</span><span class="p">(</span> + <span class="s2">"binary_c_python_grid"</span><span class="p">,</span> + <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"gridcode_filename"</span><span class="p">]),</span> + <span class="p">)</span> + <span class="n">grid_file</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">module_from_spec</span><span class="p">(</span><span class="n">spec</span><span class="p">)</span> + <span class="n">spec</span><span class="o">.</span><span class="n">loader</span><span class="o">.</span><span class="n">exec_module</span><span class="p">(</span><span class="n">grid_file</span><span class="p">)</span> + <span class="n">generator</span> <span class="o">=</span> <span class="n">grid_file</span><span class="o">.</span><span class="n">grid_code</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_system_generator"</span><span class="p">]</span> <span class="o">=</span> <span class="n">generator</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span><span class="s2">"Grid code loaded"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> <span class="mi">1</span><span class="p">)</span> + + <span class="k">def</span> <span class="nf">_last_grid_variable</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the last grid variable (i.e. the one with the highest grid_variable_number)</span> + +<span class="sd"> TODO: this function does not require this structure and can be simplified</span> +<span class="sd"> """</span> + + <span class="n">number</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">])</span> + <span class="k">for</span> <span class="n">grid_variable</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]:</span> + <span class="k">if</span> <span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">grid_variable</span><span class="p">][</span> + <span class="s2">"grid_variable_number"</span> + <span class="p">]</span> + <span class="o">==</span> <span class="n">number</span> <span class="o">-</span> <span class="mi">1</span> + <span class="p">):</span> + <span class="k">return</span> <span class="n">grid_variable</span> + +<div class="viewcode-block" id="gridcode.update_grid_variable"><a class="viewcode-back" href="../../../../population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.update_grid_variable">[docs]</a> <span class="k">def</span> <span class="nf">update_grid_variable</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to update the values of a grid variable.</span> + +<span class="sd"> Args:</span> +<span class="sd"> name:</span> +<span class="sd"> name of the grid variable to be changed.</span> +<span class="sd"> **kwargs:</span> +<span class="sd"> key-value pairs to override the existing grid variable data. See add_grid_variable for these names.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]:</span> + <span class="n">grid_variable</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">name</span><span class="p">]</span> + + <span class="c1"># Set the value and print</span> + <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> + <span class="n">grid_variable</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Updated grid variable: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Unknown grid variable </span><span class="si">{}</span><span class="s2"> - please create it with the add_grid_variable() method."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span></div> + +<div class="viewcode-block" id="gridcode.delete_grid_variable"><a class="viewcode-back" href="../../../../population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.delete_grid_variable">[docs]</a> <span class="k">def</span> <span class="nf">delete_grid_variable</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to delete a grid variable with the given name.</span> + +<span class="sd"> Args:</span> +<span class="sd"> name:</span> +<span class="sd"> name of the grid variable to be deleted.</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]:</span> + <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">name</span><span class="p">]</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Deleted grid variable: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Failed to remove grid variable </span><span class="si">{}</span><span class="s2">: please check it exists."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">name</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span></div> + +<div class="viewcode-block" id="gridcode.rename_grid_variable"><a class="viewcode-back" href="../../../../population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.rename_grid_variable">[docs]</a> <span class="k">def</span> <span class="nf">rename_grid_variable</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">oldname</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">newname</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to rename a grid variable.</span> + +<span class="sd"> note: this does NOT alter the order</span> +<span class="sd"> of the self.grid_options["_grid_variables"] dictionary.</span> + +<span class="sd"> The order in which the grid variables are loaded into the grid is based on their</span> +<span class="sd"> `grid_variable_number` property</span> + +<span class="sd"> Args:</span> +<span class="sd"> oldname:</span> +<span class="sd"> old name of the grid variable</span> +<span class="sd"> newname:</span> +<span class="sd"> new name of the grid variable</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">oldname</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">newname</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"_grid_variables"</span> + <span class="p">]</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">oldname</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">newname</span><span class="p">][</span><span class="s2">"name"</span><span class="p">]</span> <span class="o">=</span> <span class="n">newname</span> + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Rename grid variable: </span><span class="si">{}</span><span class="s2"> to </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">oldname</span><span class="p">,</span> <span class="n">newname</span><span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Failed to rename grid variable </span><span class="si">{}</span><span class="s2"> to </span><span class="si">{}</span><span class="s2">."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">oldname</span><span class="p">,</span> <span class="n">newname</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span></div> + +<div class="viewcode-block" id="gridcode.add_grid_variable"><a class="viewcode-back" href="../../../../population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.add_grid_variable">[docs]</a> <span class="k">def</span> <span class="nf">add_grid_variable</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="n">parameter_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="n">longname</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="n">valuerange</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">list</span><span class="p">,</span> <span class="nb">str</span><span class="p">],</span> + <span class="n">samplerfunc</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="n">probdist</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="n">dphasevol</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> + <span class="n">gridtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"centred"</span><span class="p">,</span> + <span class="n">branchpoint</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> + <span class="n">branchcode</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">precode</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">postcode</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">topcode</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">bottomcode</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">condition</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">index</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> + <span class="n">dry_parallel</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">bool</span><span class="p">,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function to add grid variables to the grid_options.</span> + +<span class="sd"> The execution of the grid generation will be through a nested for loop.</span> +<span class="sd"> Each of the grid variables will get create a deeper for loop.</span> + +<span class="sd"> The real function that generates the numbers will get written to a new file in the TMP_DIR,</span> +<span class="sd"> and then loaded imported and evaluated.</span> +<span class="sd"> beware that if you insert some destructive piece of code, it will be executed anyway.</span> +<span class="sd"> Use at own risk.</span> + +<span class="sd"> Args:</span> +<span class="sd"> name:</span> +<span class="sd"> name of parameter used in the grid Python code.</span> +<span class="sd"> This is evaluated as a parameter and you can use it throughout</span> +<span class="sd"> the rest of the function</span> + +<span class="sd"> Examples:</span> +<span class="sd"> name = 'lnM_1'</span> + +<span class="sd"> parameter_name:</span> +<span class="sd"> name of the parameter in binary_c</span> + +<span class="sd"> This name must correspond to a Python variable of the same name,</span> +<span class="sd"> which is automatic if parameter_name == name.</span> + +<span class="sd"> Note: if parameter_name != name, you must set a</span> +<span class="sd"> variable in "precode" or "postcode" to define a Python variable</span> +<span class="sd"> called parameter_name</span> + +<span class="sd"> longname:</span> +<span class="sd"> Long name of parameter</span> + +<span class="sd"> Examples:</span> +<span class="sd"> longname = 'Primary mass'</span> +<span class="sd"> range:</span> +<span class="sd"> Range of values to take. Does not get used really, the samplerfunc is used to</span> +<span class="sd"> get the values from</span> + +<span class="sd"> Examples:</span> +<span class="sd"> range = [math.log(m_min), math.log(m_max)]</span> +<span class="sd"> samplerfunc:</span> +<span class="sd"> Function returning a list or numpy array of samples spaced appropriately.</span> +<span class="sd"> You can either use a real function, or a string representation of a function call.</span> + +<span class="sd"> Examples:</span> +<span class="sd"> samplerfunc = "self.const_linear(math.log(m_min), math.log(m_max), {})".format(resolution['M_1'])</span> + +<span class="sd"> precode:</span> +<span class="sd"> Extra room for some code. This code will be evaluated within the loop of the</span> +<span class="sd"> sampling function (i.e. a value for lnM_1 is chosen already)</span> + +<span class="sd"> Examples:</span> +<span class="sd"> precode = 'M_1=math.exp(lnM_1);'</span> +<span class="sd"> postcode:</span> +<span class="sd"> Code executed after the probability is calculated.</span> +<span class="sd"> probdist:</span> +<span class="sd"> Function determining the probability that gets assigned to the sampled parameter</span> + +<span class="sd"> Examples:</span> +<span class="sd"> probdist = 'Kroupa2001(M_1)*M_1'</span> +<span class="sd"> dphasevol:</span> +<span class="sd"> part of the parameter space that the total probability is calculated with. Put to -1</span> +<span class="sd"> if you want to ignore any dphasevol calculations and set the value to 1</span> +<span class="sd"> Examples:</span> +<span class="sd"> dphasevol = 'dlnM_1'</span> +<span class="sd"> condition:</span> +<span class="sd"> condition that has to be met in order for the grid generation to continue</span> +<span class="sd"> Examples:</span> +<span class="sd"> condition = 'self.grid_options['binary']==1'</span> +<span class="sd"> gridtype:</span> +<span class="sd"> Method on how the value range is sampled. Can be either 'edge' (steps starting at</span> +<span class="sd"> the lower edge of the value range) or 'centred'</span> +<span class="sd"> (steps starting at lower edge + 0.5 * stepsize).</span> + +<span class="sd"> dry_parallel:</span> +<span class="sd"> If True, try to parallelize this variable in dry runs.</span> + +<span class="sd"> topcode:</span> +<span class="sd"> Code added at the very top of the block.</span> + +<span class="sd"> bottomcode:</span> +<span class="sd"> Code added at the very bottom of the block.</span> +<span class="sd"> """</span> + + <span class="c1"># check parameters</span> + <span class="c1"># if False and dphasevol != -1.0 and gridtype == "discrete":</span> + <span class="k">if</span> <span class="n">dphasevol</span> <span class="o">!=</span> <span class="o">-</span><span class="mf">1.0</span> <span class="ow">and</span> <span class="n">gridtype</span> <span class="o">==</span> <span class="s2">"discrete"</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Error making grid: you have set the phasevol to be not -1 and gridtype to discrete, but a discrete grid has no phasevol calculation. You should only set the gridtype to discrete and not set the phasevol in this case."</span> + <span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># Add grid_variable</span> + <span class="n">grid_variable</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"name"</span><span class="p">:</span> <span class="n">name</span><span class="p">,</span> + <span class="s2">"parameter_name"</span><span class="p">:</span> <span class="n">parameter_name</span><span class="p">,</span> + <span class="s2">"longname"</span><span class="p">:</span> <span class="n">longname</span><span class="p">,</span> + <span class="s2">"valuerange"</span><span class="p">:</span> <span class="n">valuerange</span><span class="p">,</span> + <span class="s2">"samplerfunc"</span><span class="p">:</span> <span class="n">samplerfunc</span><span class="p">,</span> + <span class="s2">"precode"</span><span class="p">:</span> <span class="n">precode</span><span class="p">,</span> + <span class="s2">"postcode"</span><span class="p">:</span> <span class="n">postcode</span><span class="p">,</span> + <span class="s2">"probdist"</span><span class="p">:</span> <span class="n">probdist</span><span class="p">,</span> + <span class="s2">"dphasevol"</span><span class="p">:</span> <span class="n">dphasevol</span><span class="p">,</span> + <span class="s2">"condition"</span><span class="p">:</span> <span class="n">condition</span><span class="p">,</span> + <span class="s2">"gridtype"</span><span class="p">:</span> <span class="n">gridtype</span><span class="p">,</span> + <span class="s2">"branchpoint"</span><span class="p">:</span> <span class="n">branchpoint</span><span class="p">,</span> + <span class="s2">"branchcode"</span><span class="p">:</span> <span class="n">branchcode</span><span class="p">,</span> + <span class="s2">"topcode"</span><span class="p">:</span> <span class="n">topcode</span><span class="p">,</span> + <span class="s2">"bottomcode"</span><span class="p">:</span> <span class="n">bottomcode</span><span class="p">,</span> + <span class="s2">"grid_variable_number"</span><span class="p">:</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">]),</span> + <span class="s2">"dry_parallel"</span><span class="p">:</span> <span class="n">dry_parallel</span><span class="p">,</span> + <span class="p">}</span> + + <span class="c1"># Check for gridtype input</span> + <span class="n">allowed_gridtypes</span> <span class="o">=</span> <span class="p">[</span> + <span class="s2">"edge"</span><span class="p">,</span> + <span class="s2">"right"</span><span class="p">,</span> + <span class="s2">"right edge"</span><span class="p">,</span> + <span class="s2">"left"</span><span class="p">,</span> + <span class="s2">"left edge"</span><span class="p">,</span> + <span class="s2">"centred"</span><span class="p">,</span> + <span class="s2">"centre"</span><span class="p">,</span> + <span class="s2">"center"</span><span class="p">,</span> + <span class="s2">"discrete"</span><span class="p">,</span> + <span class="p">]</span> + + <span class="k">if</span> <span class="n">gridtype</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">allowed_gridtypes</span><span class="p">:</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Unknown gridtype </span><span class="si">{gridtype}</span><span class="s2">. Please choose one of: "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">gridtype</span><span class="o">=</span><span class="n">gridtype</span> + <span class="p">)</span> <span class="o">+</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">allowed_gridtypes</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> + + <span class="c1"># Load it into the grid_options</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_grid_variables"</span><span class="p">][</span><span class="n">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]]</span> <span class="o">=</span> <span class="n">grid_variable</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"Added grid variable: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">grid_variable</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">],</span> + <span class="mi">2</span><span class="p">,</span> + <span class="p">)</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/metadata.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/metadata.html new file mode 100644 index 0000000000000000000000000000000000000000..24b8e1ca60dc005e30085c4b8b5ac406088fdfc0 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/metadata.html @@ -0,0 +1,255 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.metadata — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.metadata</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.metadata</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the metadata functions for the binarycpython package.</span> + +<span class="sd">This class object is an extension to the population grid object</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">import</span> <span class="nn">platform</span> + +<span class="kn">from</span> <span class="nn">binarycpython.utils.dicts</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">multiply_values_dict</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.ensemble</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">binaryc_json_serializer</span><span class="p">,</span> +<span class="p">)</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="p">(</span> + <span class="n">now</span><span class="p">,</span> +<span class="p">)</span> + + +<div class="viewcode-block" id="metadata"><a class="viewcode-back" href="../../../../population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata">[docs]</a><span class="k">class</span> <span class="nc">metadata</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension to the population grid object that contains functionality to handle the metadata that will be put in the ensemble</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the metadata class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="metadata.add_system_metadata"><a class="viewcode-back" href="../../../../population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata.add_system_metadata">[docs]</a> <span class="k">def</span> <span class="nf">add_system_metadata</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Add system's metadata to the grid_ensemble_results, and add some system information to metadata.</span> +<span class="sd"> """</span> + + <span class="c1"># add metadata if it doesn't exist</span> + <span class="k">if</span> <span class="ow">not</span> <span class="s2">"metadata"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># add date</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"date"</span><span class="p">]</span> <span class="o">=</span> <span class="n">now</span><span class="p">()</span> + + <span class="c1"># add platform and build information</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"platform"</span><span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">platform</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"platform_uname"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span> + <span class="n">platform</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"platform_machine"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">machine</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"platform_node"</span><span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">node</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"platform_release"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">release</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"platform_version"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">version</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"platform_processor"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">processor</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"platform_python_build"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="n">platform</span><span class="o">.</span><span class="n">python_build</span><span class="p">()</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"platform_python_version"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">python_version</span><span class="p">()</span> + + <span class="c1"># Get hostname</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"hostname"</span><span class="p">]</span> <span class="o">=</span> <span class="n">platform</span><span class="o">.</span><span class="n">uname</span><span class="p">()[</span><span class="mi">1</span><span class="p">]</span> + + <span class="c1"># Calculate time elapsed</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"duration"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">time_elapsed</span><span class="p">()</span> + + <span class="c1"># Calculate cpu time</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"CPU_time"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">CPU_time</span><span class="p">()</span></div> + +<div class="viewcode-block" id="metadata.add_ensemble_metadata"><a class="viewcode-back" href="../../../../population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata.add_ensemble_metadata">[docs]</a> <span class="k">def</span> <span class="nf">add_ensemble_metadata</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">combined_output_dict</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to add metadata to the grid_ensemble_results and grid_options</span> +<span class="sd"> """</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"population_id"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"_population_id"</span> + <span class="p">]</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"total_probability_weighted_mass"</span> + <span class="p">]</span> <span class="o">=</span> <span class="n">combined_output_dict</span><span class="p">[</span><span class="s2">"_total_probability_weighted_mass_run"</span><span class="p">]</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"factored_in_probability_weighted_mass"</span> + <span class="p">]</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"ensemble_factor_in_probability_weighted_mass"</span><span class="p">]:</span> + <span class="n">multiply_values_dict</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"ensemble"</span><span class="p">],</span> + <span class="mf">1.0</span> + <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"total_probability_weighted_mass"</span> + <span class="p">],</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span> + <span class="s2">"factored_in_probability_weighted_mass"</span> + <span class="p">]</span> <span class="o">=</span> <span class="kc">True</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"_killed"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_killed"</span><span class="p">]</span> + + <span class="c1"># Add settings of the populations</span> + <span class="n">all_info</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">return_all_info</span><span class="p">(</span> + <span class="n">include_population_settings</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">include_binary_c_defaults</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">include_binary_c_version_info</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">include_binary_c_help_all</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_ensemble_results</span><span class="p">[</span><span class="s2">"metadata"</span><span class="p">][</span><span class="s2">"settings"</span><span class="p">]</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span> + <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">all_info</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="n">binaryc_json_serializer</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <span class="p">)</span> + + <span class="c1">##############################</span> + <span class="c1"># Update grid options</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_metadata_keylist</span><span class="p">():</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="n">combined_output_dict</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_failed_systems_error_codes"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span> + <span class="nb">set</span><span class="p">(</span><span class="n">combined_output_dict</span><span class="p">[</span><span class="s2">"_failed_systems_error_codes"</span><span class="p">])</span> + <span class="p">)</span></div> + + <span class="k">def</span> <span class="nf">_metadata_keylist</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the list of metadata keys</span> + +<span class="sd"> TODO: Consider just setting this list as a property of the object in the init</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="p">[</span> + <span class="s2">"_failed_count"</span><span class="p">,</span> + <span class="s2">"_failed_prob"</span><span class="p">,</span> + <span class="s2">"_errors_exceeded"</span><span class="p">,</span> + <span class="s2">"_errors_found"</span><span class="p">,</span> + <span class="s2">"_probtot"</span><span class="p">,</span> + <span class="s2">"_count"</span><span class="p">,</span> + <span class="s2">"_total_mass_run"</span><span class="p">,</span> + <span class="s2">"_total_probability_weighted_mass_run"</span><span class="p">,</span> + <span class="s2">"_zero_prob_stars_skipped"</span><span class="p">,</span> + <span class="s2">"_killed"</span><span class="p">,</span> + <span class="p">]</span></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/slurm.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/slurm.html new file mode 100644 index 0000000000000000000000000000000000000000..42f7a50ec7f232521d57a0e29d96e3c956278633 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/slurm.html @@ -0,0 +1,556 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.slurm — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.slurm</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.slurm</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the Slurm functions for the binarycpython package.</span> + +<span class="sd">This class object is an extension to the population grid object</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">os</span> +<span class="kn">import</span> <span class="nn">sys</span> +<span class="kn">import</span> <span class="nn">time</span> +<span class="kn">import</span> <span class="nn">stat</span> +<span class="kn">import</span> <span class="nn">pathlib</span> +<span class="kn">import</span> <span class="nn">subprocess</span> + +<span class="kn">import</span> <span class="nn">datasize</span> +<span class="kn">import</span> <span class="nn">lib_programname</span> + + +<div class="viewcode-block" id="slurm"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm">[docs]</a><span class="k">class</span> <span class="nc">slurm</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension for the Population class containing the code for Slurm grid simulations</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the slurm class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="slurm.slurmID"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurmID">[docs]</a> <span class="k">def</span> <span class="nf">slurmID</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">jobid</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return a Slurm job ID. The jobid and jobarrayindex passed in are used if given, otherwise we default to the jobid and jobarrayindex in grid_options.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">jobid</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">jobid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobid"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">jobarrayindex</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">jobarrayindex</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobarrayindex"</span><span class="p">]</span> + <span class="k">return</span> <span class="s2">"</span><span class="si">{jobid}</span><span class="s2">.</span><span class="si">{jobarrayindex}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">jobid</span><span class="o">=</span><span class="n">jobid</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="n">jobarrayindex</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="slurm.slurmpath"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurmpath">[docs]</a> <span class="k">def</span> <span class="nf">slurmpath</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the full slurm directory path.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">slurm_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">slurm_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">slurm_dir</span><span class="p">,</span> <span class="n">path</span><span class="p">))</span></div> + +<div class="viewcode-block" id="slurm.slurm_status_file"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_status_file">[docs]</a> <span class="k">def</span> <span class="nf">slurm_status_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">jobid</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Return the slurm status file corresponding to the jobid and jobarrayindex, which default to grid_options slurm_jobid and slurm_jobarrayindex, respectively.</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">slurmpath</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="n">slurm_dir</span><span class="p">),</span> + <span class="bp">self</span><span class="o">.</span><span class="n">slurmID</span><span class="p">(</span><span class="n">jobid</span><span class="o">=</span><span class="n">jobid</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="n">jobarrayindex</span><span class="p">),</span> + <span class="p">)</span></div> + +<div class="viewcode-block" id="slurm.slurm_check_requirements"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_check_requirements">[docs]</a> <span class="k">def</span> <span class="nf">slurm_check_requirements</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to check whether the slurm parameters in grid_options have been set appropriately.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> <span class="p">(</span> + <span class="kc">False</span><span class="p">,</span> + <span class="s2">"You have set slurm=</span><span class="si">{slurm}</span><span class="s2"> but not set slurm_dir (which is </span><span class="si">{slurm_dir}</span><span class="s2">). Please set it and try again."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">slurm</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">],</span> + <span class="n">slurm_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">],</span> + <span class="p">),</span> + <span class="p">)</span> + <span class="k">return</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span></div> + +<div class="viewcode-block" id="slurm.slurm_dirs"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_dirs">[docs]</a> <span class="k">def</span> <span class="nf">slurm_dirs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Directories associated specifically with this slurm job.</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span></div> + +<div class="viewcode-block" id="slurm.set_slurm_status"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.set_slurm_status">[docs]</a> <span class="k">def</span> <span class="nf">set_slurm_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">string</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Set the slurm status corresponing to the self object, which should have slurm_jobid and slurm_jobarrayindex set.</span> + +<span class="sd"> Args:</span> +<span class="sd"> string : the status string to be set</span> +<span class="sd"> slurm_dir : the directory in which the status directory is held. If not set, this defaults to the HPC directory (e.g. slurm_dir or condor_dir).</span> +<span class="sd"> """</span> + <span class="c1"># save slurm jobid to file</span> + <span class="k">if</span> <span class="n">slurm_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">slurm_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + + <span class="n">idfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">slurm_dir</span><span class="p">,</span> <span class="s2">"jobid"</span><span class="p">)</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">idfile</span><span class="p">):</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">idfile</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">fjobid</span><span class="p">:</span> + <span class="n">fjobid</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">{jobid}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">jobid</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobid"</span><span class="p">]))</span> + <span class="n">fjobid</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hach</span><span class="p">(</span><span class="n">idfile</span><span class="p">)</span> + + <span class="c1"># save slurm status</span> + <span class="n">file</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurm_status_file</span><span class="p">(</span><span class="n">slurm_dir</span><span class="o">=</span><span class="n">slurm_dir</span><span class="p">)</span> + <span class="k">if</span> <span class="n">file</span><span class="p">:</span> + <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> + <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">string</span><span class="p">)</span> + <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_fluch_hack</span><span class="p">(</span><span class="n">file</span><span class="p">)</span></div> + +<div class="viewcode-block" id="slurm.get_slurm_status"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.get_slurm_status">[docs]</a> <span class="k">def</span> <span class="nf">get_slurm_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">jobid</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Get and return the slurm status string corresponing to the self object, or jobid.jobarrayindex if they are passed in. If no status is found, returns an empty string.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">jobid</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">jobid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobid"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">jobarrayindex</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">jobarrayindex</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobarrayindex"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">jobid</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">jobarrayindex</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="k">return</span> <span class="kc">None</span> + <span class="k">try</span><span class="p">:</span> + + <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">slurm_status_file</span><span class="p">(</span> + <span class="n">slurm_dir</span><span class="o">=</span><span class="n">slurm_dir</span><span class="p">,</span> <span class="n">jobid</span><span class="o">=</span><span class="n">jobid</span><span class="p">,</span> <span class="n">jobarrayindex</span><span class="o">=</span><span class="n">jobarrayindex</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">path</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">NFS_flush_hack</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> + <span class="k">return</span> <span class="n">path</span><span class="o">.</span><span class="n">read_text</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="k">return</span> <span class="s2">""</span> + <span class="c1"># TODO: Fix bare exception</span> + <span class="k">except</span><span class="p">:</span> + <span class="k">return</span> <span class="s2">""</span></div> + +<div class="viewcode-block" id="slurm.slurm_outfile"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_outfile">[docs]</a> <span class="k">def</span> <span class="nf">slurm_outfile</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> return a standard filename for the slurm chunk files</span> +<span class="sd"> """</span> + <span class="n">file</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{id}</span><span class="s2">.gz"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slurmID</span><span class="p">(),</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">slurm_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">slurm_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">slurm_dir</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span></div> + +<div class="viewcode-block" id="slurm.make_slurm_dirs"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.make_slurm_dirs">[docs]</a> <span class="k">def</span> <span class="nf">make_slurm_dirs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to create the necessary slurm directories</span> +<span class="sd"> """</span> + + <span class="c1"># TODO: replace the code block below with a function call to slurmpath</span> + <span class="c1"># make the slurm directories</span> + <span class="k">if</span> <span class="n">slurm_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">slurm_dir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">slurm_dir</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"You must set self.grid_options['slurm_dir'] (or pass slurm_dir=whatever to make_slurm_dirs()) to a directory which we can use to set up binary_c-python's Slurm files. This should be unique to your set of grids."</span> + <span class="p">)</span> + <span class="n">os</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span> + + <span class="c1"># make a list of directories, these contain the various slurm</span> + <span class="c1"># output, status files, etc.</span> + <span class="n">dirs</span> <span class="o">=</span> <span class="p">[]</span> + <span class="k">for</span> <span class="n">slurm_subdir</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"stdout"</span><span class="p">,</span> <span class="s2">"stderr"</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">,</span> <span class="s2">"status"</span><span class="p">,</span> <span class="s2">"snapshots"</span><span class="p">]:</span> + <span class="n">dirs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">slurmpath</span><span class="p">(</span><span class="n">slurm_subdir</span><span class="p">))</span> + + <span class="c1"># make the directories: we do not allow these to already exist</span> + <span class="c1"># as the slurm directory should be a fresh location for each set of jobs</span> + <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">dirs</span><span class="p">:</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">slurmpath</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="n">slurm_dir</span><span class="p">))</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span> + <span class="n">exist_ok</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">parents</span><span class="o">=</span><span class="kc">True</span> + <span class="p">)</span> + <span class="c1"># TODO: fix this bare exception</span> + <span class="k">except</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Tried to make the directory </span><span class="si">{d}</span><span class="s2"> but it already exists. When you launch a set of binary_c jobs on Slurm, you need to set your slurm_dir to be a fresh directory with no contents."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">d</span><span class="o">=</span><span class="n">d</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># check that they have been made and exist: we need this</span> + <span class="c1"># because on network mounts (NFS) there's often a delay between the mkdir</span> + <span class="c1"># above and the actual directory being made. This shouldn't be too long...</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">True</span> + <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span> + <span class="n">count_warn</span> <span class="o">=</span> <span class="mi">10</span> + <span class="k">while</span> <span class="n">fail</span> <span class="ow">is</span> <span class="kc">True</span><span class="p">:</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">False</span> + <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span> + <span class="k">if</span> <span class="n">count</span> <span class="o">></span> <span class="n">count_warn</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Warning: Have been waiting about </span><span class="si">{count}</span><span class="s2"> seconds for Slurm directories to be made, there seems to be significant delay..."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">count</span><span class="o">=</span><span class="n">count</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">dirs</span><span class="p">:</span> + <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span> + <span class="n">fail</span> <span class="o">=</span> <span class="kc">True</span> + <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> + <span class="k">break</span></div> + +<div class="viewcode-block" id="slurm.slurm_grid"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_grid">[docs]</a> <span class="k">def</span> <span class="nf">slurm_grid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> function to be called when running grids when grid_options['slurm']>=1</span> + +<span class="sd"> if grid_options['slurm']==1, we set up the slurm script and launch the jobs, then return True to exit.</span> +<span class="sd"> if grid_options['slurm']==2, we run the stars, which means we return False to continue.</span> +<span class="sd"> if grid_options['slurm']==3, we are being called from the jobs to run the grids, return False to continue.</span> + +<span class="sd"> """</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> + <span class="c1"># run a grid of stars only, leaving the results</span> + <span class="c1"># in the appropriate outfile</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> + <span class="c1"># joining : set the evolution type to "join" and return</span> + <span class="c1"># False to continue</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"join"</span> + <span class="k">return</span> <span class="kc">False</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="c1"># if slurm=1, we should have no evolution type, we</span> + <span class="c1"># set up the Slurm scripts and get them evolving</span> + <span class="c1"># in a Slurm array</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"evolution_type"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="c1"># make dirs</span> + <span class="bp">self</span><span class="o">.</span><span class="n">make_slurm_dirs</span><span class="p">()</span> + + <span class="c1"># check we're not using too much RAM</span> + <span class="k">if</span> <span class="n">datasize</span><span class="o">.</span><span class="n">DataSize</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_memory"</span><span class="p">])</span> <span class="o">></span> <span class="n">datasize</span><span class="o">.</span><span class="n">DataSize</span><span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_warn_max_memory"</span><span class="p">]</span> + <span class="p">):</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"WARNING: you want to use </span><span class="si">{slurm_memory}</span><span class="s2"> MB of RAM : this is unlikely to be correct. If you believe it is, set slurm_warn_max_memory to something very large (it is currently </span><span class="si">{slurm_warn_max_memory}</span><span class="s2"> MB)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">slurm_memory</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_memory"</span><span class="p">],</span> + <span class="n">slurm_warn_max_memory</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"slurm_warn_max_memory"</span> + <span class="p">],</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># set up slurm_array</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_array_max_jobs"</span><span class="p">]:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_array_max_jobs"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"slurm_njobs"</span> + <span class="p">]</span> + <span class="n">slurm_array</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span> + <span class="s2">"slurm_array"</span> + <span class="p">]</span> <span class="ow">or</span> <span class="s2">"1-</span><span class="si">{njobs}</span><span class="s2">%</span><span class="si">{max_jobs}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">njobs</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_njobs"</span><span class="p">],</span> + <span class="n">max_jobs</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_array_max_jobs"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="c1"># get job id (might be passed in)</span> + <span class="c1"># TODO: is this variable used?</span> + <span class="n">jobid</span> <span class="o">=</span> <span class="p">(</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobid"</span><span class="p">]</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobid"</span><span class="p">]</span> <span class="o">!=</span> <span class="s2">""</span> + <span class="k">else</span> <span class="s2">"$SLURM_ARRAY_JOB_ID"</span> + <span class="p">)</span> + + <span class="c1"># get job array index</span> + <span class="n">jobarrayindex</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobarrayindex"</span><span class="p">]</span> + <span class="k">if</span> <span class="n">jobarrayindex</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">jobarrayindex</span> <span class="o">=</span> <span class="s2">"$SLURM_ARRAY_TASK_ID"</span> + + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_njobs"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"binary_c-python Slurm : You must set grid_option slurm_njobs to be non-zero"</span> + <span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">code</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + + <span class="c1"># build the grid command</span> + <span class="n">grid_command</span> <span class="o">=</span> <span class="p">(</span> + <span class="p">[</span> + <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_env"</span><span class="p">]),</span> + <span class="n">sys</span><span class="o">.</span><span class="n">executable</span><span class="p">,</span> + <span class="nb">str</span><span class="p">(</span><span class="n">lib_programname</span><span class="o">.</span><span class="n">get_path_executed_script</span><span class="p">()),</span> + <span class="p">]</span> + <span class="o">+</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> + <span class="o">+</span> <span class="p">[</span> + <span class="s2">"start_at="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">jobarrayindex</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"-1"</span><span class="p">,</span> <span class="c1"># do we need the -1?</span> + <span class="s2">"modulo="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_njobs"</span><span class="p">]),</span> + <span class="s2">"slurm_njobs="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_njobs"</span><span class="p">]),</span> + <span class="s2">"slurm_dir="</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">],</span> + <span class="s2">"verbosity="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"verbosity"</span><span class="p">]),</span> + <span class="s2">"num_cores="</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"num_processes"</span><span class="p">]),</span> + <span class="p">]</span> + <span class="p">)</span> + + <span class="n">grid_command</span> <span class="o">=</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">grid_command</span><span class="p">)</span> + + <span class="c1"># make slurm script</span> + <span class="n">scriptpath</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slurmpath</span><span class="p">(</span><span class="s2">"slurm_script"</span><span class="p">)</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">script</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">scriptpath</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">"utf-8"</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Could not open Slurm script at </span><span class="si">{path}</span><span class="s2"> for writing: please check you have set </span><span class="si">{slurm_dir}</span><span class="s2"> correctly (it is currently </span><span class="si">{slurm_dir}</span><span class="s2"> and can write to this directory."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">scriptpath</span><span class="p">,</span> <span class="n">slurm_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">]</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="n">slurmscript</span> <span class="o">=</span> <span class="s2">"""#!</span><span class="si">{bash}</span><span class="s2"></span> +<span class="s2"># Slurm launch script created by binary_c-python</span> + +<span class="s2"># Slurm options</span> +<span class="s2">#SBATCH --error=</span><span class="si">{slurm_dir}</span><span class="s2">/stderr/%A.</span><span class="si">%a</span><span class="s2"></span> +<span class="s2">#SBATCH --output=</span><span class="si">{slurm_dir}</span><span class="s2">/stdout/%A.</span><span class="si">%a</span><span class="s2"></span> +<span class="s2">#SBATCH --job-name=</span><span class="si">{slurm_jobname}</span><span class="s2"></span> +<span class="s2">#SBATCH --partition=</span><span class="si">{slurm_partition}</span><span class="s2"></span> +<span class="s2">#SBATCH --time=</span><span class="si">{slurm_time}</span><span class="s2"></span> +<span class="s2">#SBATCH --mem=</span><span class="si">{slurm_memory}</span><span class="s2"></span> +<span class="s2">#SBATCH --ntasks=</span><span class="si">{slurm_ntasks}</span><span class="s2"></span> +<span class="s2">#SBATCH --array=</span><span class="si">{slurm_array}</span><span class="s2"></span> +<span class="s2">#SBATCH --cpus-per-task=</span><span class="si">{ncpus}</span><span class="s2"></span> +<span class="s2">"""</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">bash</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_bash"</span><span class="p">],</span> + <span class="n">slurm_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">],</span> + <span class="n">slurm_jobname</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_jobname"</span><span class="p">],</span> + <span class="n">slurm_partition</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_partition"</span><span class="p">],</span> + <span class="n">slurm_time</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_time"</span><span class="p">],</span> + <span class="n">slurm_ntasks</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_ntasks"</span><span class="p">],</span> + <span class="n">slurm_memory</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_memory"</span><span class="p">],</span> + <span class="n">slurm_array</span><span class="o">=</span><span class="n">slurm_array</span><span class="p">,</span> + <span class="n">ncpus</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"num_processes"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_extra_settings"</span><span class="p">]:</span> + <span class="n">slurmscript</span> <span class="o">+=</span> <span class="s2">"#SBATCH --</span><span class="si">{key}</span><span class="s2"> = </span><span class="si">{value}</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">key</span><span class="o">=</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_extra_settings"</span><span class="p">][</span><span class="n">key</span><span class="p">]</span> + <span class="p">)</span> + + <span class="n">slurmscript</span> <span class="o">+=</span> <span class="s2">"""</span> + +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_CMD_LINE=</span><span class="si">{cmdline}</span><span class="s2"></span> +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_WD=`</span><span class="si">{pwd}</span><span class="s2">`</span> +<span class="s2">export BINARY_C_PYTHON_ORIGINAL_SUBMISSION_TIME=`</span><span class="si">{date}</span><span class="s2">`</span> + +<span class="s2"># set status to </span><span class="se">\"</span><span class="s2">running</span><span class="se">\"</span><span class="s2"></span> +<span class="s2">echo </span><span class="se">\"</span><span class="s2">running</span><span class="se">\"</span><span class="s2"> > </span><span class="si">{slurm_dir}</span><span class="s2">/status/$SLURM_ARRAY_JOB_ID.$SLURM_ARRAY_TASK_ID</span> + +<span class="s2"># make list of files which is checked for joining</span> +<span class="s2"># echo </span><span class="si">{slurm_dir}</span><span class="s2">/results/$SLURM_ARRAY_JOB_ID.$SLURM_ARRAY_TASK_ID.gz >> </span><span class="si">{slurm_dir}</span><span class="s2">/results/$SLURM_ARRAY_JOB_ID.all</span> + +<span class="s2"># run grid of stars and, if this returns 0, set status to finished</span> +<span class="si">{grid_command}</span><span class="s2"> slurm=2 evolution_type=grid slurm_jobid=$SLURM_ARRAY_JOB_ID slurm_jobarrayindex=$SLURM_ARRAY_TASK_ID save_population_object=</span><span class="si">{slurm_dir}</span><span class="s2">/results/$SLURM_ARRAY_JOB_ID.$SLURM_ARRAY_TASK_ID.gz && echo -n </span><span class="se">\"</span><span class="s2">finished</span><span class="se">\"</span><span class="s2"> > </span><span class="si">{slurm_dir}</span><span class="s2">/status/$SLURM_ARRAY_JOB_ID.$SLURM_ARRAY_TASK_ID && echo """</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">slurm_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">],</span> + <span class="n">grid_command</span><span class="o">=</span><span class="n">grid_command</span><span class="p">,</span> + <span class="n">cmdline</span><span class="o">=</span><span class="nb">repr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"command_line"</span><span class="p">]),</span> + <span class="n">date</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_date"</span><span class="p">],</span> + <span class="n">pwd</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_pwd"</span><span class="p">],</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_postpone_join"</span><span class="p">]:</span> + <span class="n">slurmscript</span> <span class="o">+=</span> <span class="s2">"""&& echo </span><span class="se">\"</span><span class="s2">Checking if we can join...</span><span class="se">\"</span><span class="s2"> && echo && </span><span class="si">{grid_command}</span><span class="s2"> slurm=3 evolution_type=join joinlist=</span><span class="si">{slurm_dir}</span><span class="s2">/results/$SLURM_ARRAY_JOB_ID.all slurm_jobid=$SLURM_ARRAY_JOB_ID slurm_jobarrayindex=$SLURM_ARRAY_TASK_ID</span> +<span class="s2"> """</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">slurm_dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_dir"</span><span class="p">],</span> + <span class="n">grid_command</span><span class="o">=</span><span class="n">grid_command</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">slurmscript</span> <span class="o">+=</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> + + <span class="c1"># write to script, close it and make it executable by</span> + <span class="c1"># all (so the slurm user can pick it up)</span> + <span class="n">script</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">slurmscript</span><span class="p">)</span> + <span class="n">script</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + <span class="n">os</span><span class="o">.</span><span class="n">chmod</span><span class="p">(</span> + <span class="n">scriptpath</span><span class="p">,</span> + <span class="n">stat</span><span class="o">.</span><span class="n">S_IREAD</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IWRITE</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IEXEC</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IRGRP</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IXGRP</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IROTH</span> + <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IXOTH</span><span class="p">,</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_postpone_sbatch"</span><span class="p">]:</span> + <span class="c1"># call sbatch to launch the jobs</span> + <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_sbatch"</span><span class="p">],</span> <span class="n">scriptpath</span><span class="p">]</span> + + <span class="k">with</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span> + <span class="n">cmd</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span> + <span class="p">)</span> <span class="k">as</span> <span class="n">pipes</span><span class="p">:</span> + + <span class="n">std_out</span><span class="p">,</span> <span class="n">std_err</span> <span class="o">=</span> <span class="n">pipes</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span> + <span class="k">if</span> <span class="n">pipes</span><span class="o">.</span><span class="n">returncode</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="c1"># an error happened!</span> + <span class="n">err_msg</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{red}{err}</span><span class="se">\n</span><span class="s2">Return Code: </span><span class="si">{code}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">err</span><span class="o">=</span><span class="n">std_err</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span> + <span class="n">code</span><span class="o">=</span><span class="n">pipes</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> + <span class="n">red</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"red"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="p">)</span> + <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="n">err_msg</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">std_err</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{red}{err}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">red</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"red"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="n">err</span><span class="o">=</span><span class="n">std_err</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">),</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{yellow}{out}{reset}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">yellow</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"yellow"</span><span class="p">],</span> + <span class="n">reset</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ANSI_colours</span><span class="p">[</span><span class="s2">"reset"</span><span class="p">],</span> + <span class="n">out</span><span class="o">=</span><span class="n">std_out</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">),</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># just say we would have (use this for testing)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Slurm script is at </span><span class="si">{path}</span><span class="s2"> but has not been launched"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">path</span><span class="o">=</span><span class="n">scriptpath</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="c1"># some messages to the user, then return</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"slurm_postpone_sbatch"</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Slurm script written, but launching the jobs with sbatch was postponed."</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Slurm jobs launched"</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"All done in slurm_grid()."</span><span class="p">)</span> + + <span class="c1"># return True so we exit immediately</span> + <span class="k">return</span> <span class="kc">True</span></div> + +<div class="viewcode-block" id="slurm.slurm_queue_stats"><a class="viewcode-back" href="../../../../population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_queue_stats">[docs]</a> <span class="k">def</span> <span class="nf">slurm_queue_stats</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to XXX</span> + +<span class="sd"> TODO: is this function finished?</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="kc">None</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/spacing_functions.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/spacing_functions.html new file mode 100644 index 0000000000000000000000000000000000000000..ef987c9c67397aba3a5a5ae46a3ec35ba189bc17 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/spacing_functions.html @@ -0,0 +1,795 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.spacing_functions — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.spacing_functions</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.spacing_functions</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">Module containing the spacing functions for the binarycpython package. Very under-populated at the moment, but more are likely to come soon</span> + +<span class="sd">This class object is an extension to the population grid object</span> + +<span class="sd">Tasks:</span> +<span class="sd"> TODO: add more spacing functions to this module.</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E1101</span> + +<span class="kn">import</span> <span class="nn">sys</span> +<span class="kn">import</span> <span class="nn">math</span> +<span class="kn">import</span> <span class="nn">json</span> +<span class="kn">import</span> <span class="nn">functools</span> +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span> +<span class="kn">import</span> <span class="nn">traceback</span> + +<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> +<span class="kn">import</span> <span class="nn">cachetools</span> +<span class="kn">import</span> <span class="nn">diskcache</span> + +<span class="c1"># from binarycpython.utils.grid import Population</span> + +<span class="kn">import</span> <span class="nn">py_rinterpolate</span> + + +<div class="viewcode-block" id="spacing_functions"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions">[docs]</a><span class="k">class</span> <span class="nc">spacing_functions</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Extension for the Population class containing the code for spacing functions</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the spacing_functions class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + +<div class="viewcode-block" id="spacing_functions.const_linear"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_linear">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span><span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"spacing_functions.const_linear"</span><span class="p">])</span> + <span class="k">def</span> <span class="nf">const_linear</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">min_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">max_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">steps</span><span class="p">:</span> <span class="nb">int</span> + <span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Samples a range linearly. Uses numpy linspace, and returns an array of floats. Do NOT use this for integers.</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_bound: lower bound of range</span> +<span class="sd"> max_bound: upper bound of range</span> +<span class="sd"> steps: number of segments between min_bound and max_bound</span> + +<span class="sd"> Returns:</span> +<span class="sd"> np.linspace(min_bound, max_bound, steps)</span> +<span class="sd"> """</span> + <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="n">min_bound</span><span class="p">,</span> <span class="n">max_bound</span><span class="p">,</span> <span class="n">steps</span><span class="p">)</span></div> + +<div class="viewcode-block" id="spacing_functions.const_int"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_int">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span><span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"spacing_functions.const_int"</span><span class="p">])</span> + <span class="k">def</span> <span class="nf">const_int</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">min_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">max_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">steps</span><span class="p">:</span> <span class="nb">int</span> + <span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Samples an integer range linearly. Returns a list of ints.</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_bound: lower bound of range, must be an integer (is converted to int)</span> +<span class="sd"> max_bound: upper bound of range, must be an integer (is converted to int)</span> +<span class="sd"> steps: number of segments between min_bound and max_bound</span> + +<span class="sd"> Returns:</span> +<span class="sd"> range(min_bound,max_bound,step)</span> + +<span class="sd"> where step is int((int(max_bound)-int(min_bound))/steps)</span> +<span class="sd"> """</span> + + <span class="n">step</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="nb">int</span><span class="p">(</span><span class="n">max_bound</span><span class="p">)</span> <span class="o">-</span> <span class="nb">int</span><span class="p">(</span><span class="n">min_bound</span><span class="p">))</span> <span class="o">/</span> <span class="nb">max</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">steps</span> <span class="o">-</span> <span class="mi">1</span><span class="p">))</span> + <span class="k">if</span> <span class="n">steps</span> <span class="o"><=</span> <span class="mi">1</span><span class="p">:</span> + <span class="k">return</span> <span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">min_bound</span><span class="p">)]</span> + <span class="k">return</span> <span class="nb">range</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">min_bound</span><span class="p">),</span> <span class="nb">int</span><span class="p">(</span><span class="n">max_bound</span> <span class="o">+</span> <span class="n">step</span><span class="p">),</span> <span class="n">step</span><span class="p">)</span></div> + + <span class="c1">############################################################</span> +<div class="viewcode-block" id="spacing_functions.const_ranges"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_ranges">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span><span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"spacing_functions.const_ranges"</span><span class="p">])</span> + <span class="k">def</span> <span class="nf">const_ranges</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ranges</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Samples a series of ranges linearly.</span> + +<span class="sd"> Args:</span> +<span class="sd"> ranges: a tuple of tuples passed to the self.const_linear() spacing function.</span> + +<span class="sd"> Returns:</span> +<span class="sd"> numpy array of masses</span> + +<span class="sd"> Example:</span> +<span class="sd"> The following allocates 10 stars between 0.1 and 0.65, 20 stars between 0.65</span> +<span class="sd"> and 0.85, and 10 stars between 0.85 and 10.0 Msun.</span> + +<span class="sd"> samplerfunc="const_ranges((({},{},{}),({},{},{}),({},{},{})))".format(</span> +<span class="sd"> 0.1,0.65,10,</span> +<span class="sd"> 0.65,0.85,20,</span> +<span class="sd"> 0.85,10.0,10</span> +<span class="sd"> ),</span> + +<span class="sd"> """</span> + + <span class="n">masses</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">empty</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> + <span class="k">for</span> <span class="n">valuerange</span> <span class="ow">in</span> <span class="n">ranges</span><span class="p">:</span> + <span class="n">masses</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">masses</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">const_linear</span><span class="p">(</span><span class="o">*</span><span class="n">valuerange</span><span class="p">))</span> + <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">unique</span><span class="p">(</span><span class="n">masses</span><span class="p">)</span></div> + + <span class="c1">############################################################</span> +<div class="viewcode-block" id="spacing_functions.peak_normalized_gaussian_func"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.peak_normalized_gaussian_func">[docs]</a> <span class="k">def</span> <span class="nf">peak_normalized_gaussian_func</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">mean</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> <span class="n">sigma</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> + <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function to evaluate a Gaussian at a given point, note</span> +<span class="sd"> that the normalization is such that the peak is always 1.0,</span> +<span class="sd"> not that the integral is 1.0</span> + +<span class="sd"> Args:</span> +<span class="sd"> x: location at which to evaluate the distribution</span> +<span class="sd"> mean: mean of the Gaussian</span> +<span class="sd"> sigma: standard deviation of the Gaussian</span> + +<span class="sd"> Returns:</span> +<span class="sd"> value of the Gaussian at x</span> +<span class="sd"> """</span> + + <span class="n">gaussian_prefactor</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="c1"># / math.sqrt(2.0 * math.pi)</span> + + <span class="n">r</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">sigma</span> + <span class="n">y</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">mean</span><span class="p">)</span> <span class="o">*</span> <span class="n">r</span> + <span class="k">return</span> <span class="n">gaussian_prefactor</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="mf">0.5</span> <span class="o">*</span> <span class="n">y</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span></div> + + <span class="c1">############################################################</span> +<div class="viewcode-block" id="spacing_functions.gaussian_zoom"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.gaussian_zoom">[docs]</a> <span class="nd">@cachetools</span><span class="o">.</span><span class="n">cachedmethod</span><span class="p">(</span> + <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">caches</span><span class="p">[</span><span class="s2">"spacing_functions.gaussian_zoom"</span><span class="p">]</span> + <span class="p">)</span> + <span class="k">def</span> <span class="nf">gaussian_zoom</span><span class="p">(</span> + <span class="bp">self</span><span class="p">,</span> + <span class="n">min_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">max_bound</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">zoom_mean</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">zoom_dispersion</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">zoom_magnitude</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">],</span> + <span class="n">steps</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> + <span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Samples such that a region is zoomed in according to a 1-Gaussian function</span> + +<span class="sd"> Args:</span> +<span class="sd"> min_bound: lower bound of range</span> +<span class="sd"> max_bound: upper bound of range</span> +<span class="sd"> zoom_mean: mean of the Gaussian zoom location</span> +<span class="sd"> zoom_dispersion: dispersion of the Gaussian</span> +<span class="sd"> zoom_magnitude: depth of the Gaussian (should be 0<= zoom_magntiude <1)</span> +<span class="sd"> steps: number of segments between min_bound and max_bound assuming a linear step</span> +<span class="sd"> this is what you'd normally call "resolution"</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Numpy array of sample values</span> +<span class="sd"> """</span> + + <span class="c1"># linear spacing: this is what we'd have</span> + <span class="c1"># in the absence of a Gaussian zoom</span> + <span class="n">linear_spacing</span> <span class="o">=</span> <span class="p">(</span><span class="n">max_bound</span> <span class="o">-</span> <span class="n">min_bound</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="n">steps</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> + + <span class="c1"># make the list of values</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">min_bound</span> + <span class="n">array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([])</span> + <span class="k">while</span> <span class="n">x</span> <span class="o"><=</span> <span class="n">max_bound</span><span class="p">:</span> + <span class="n">array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">array</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span> + <span class="n">g</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">peak_normalized_gaussian_func</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">zoom_mean</span><span class="p">,</span> <span class="n">zoom_dispersion</span><span class="p">)</span> + <span class="n">f</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">-</span> <span class="n">zoom_magnitude</span> <span class="o">*</span> <span class="n">g</span> + <span class="n">dx</span> <span class="o">=</span> <span class="n">linear_spacing</span> <span class="o">*</span> <span class="n">f</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">dx</span> + + <span class="c1"># force the last array member to be max_bound if it's not</span> + <span class="k">if</span> <span class="n">array</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">!=</span> <span class="n">max_bound</span><span class="p">:</span> + <span class="n">array</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">max_bound</span> + + <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">unique</span><span class="p">(</span><span class="n">array</span><span class="p">)</span></div> + +<div class="viewcode-block" id="spacing_functions.const_dt"><a class="viewcode-back" href="../../../../population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_dt">[docs]</a> <span class="k">def</span> <span class="nf">const_dt</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">usecache</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> const_dt returns a list of masses spaced at a constant age difference</span> + +<span class="sd"> Args:</span> +<span class="sd"> dt: the time difference between the masses (1000.0 Myr, used when logspacing==False)</span> +<span class="sd"> dlogt : the delta log10(time) difference between masses (0.1 dex, used when logspacing==True)</span> +<span class="sd"> mmin: the minimum mass to be considered in the stellar lifetime interpolation table (0.07 Msun)</span> +<span class="sd"> mmax: the maximum mass to be considered in the stellar lifetime interpolation table (100.0 Msun)</span> +<span class="sd"> nres: the resolution of the stellar lifetime interpolation table (100)</span> +<span class="sd"> logspacing: whether to use log-spaced time, in which case dt is actually d(log10(t))</span> +<span class="sd"> tmin: the minimum time to consider (Myr, default 3.0 Myr)</span> +<span class="sd"> tmax: the maximum time to consider (Myr, default None which means we use the grid option 'max_evolution_time')</span> +<span class="sd"> max_evolution_time: overrides bse_options['max_evolution_time'] if set</span> +<span class="sd"> mindm: a tuple of tuples containing a mass range and minimum mass spacing in that range. The default is ((0.07,1.0,0.1),(1.0,300.0,1.0)) allocated a minimum dm of 0.1Msun in the mass range 0.07 to 1.0 Msun and 1.0Msun in the range 1.0 to 300.0 Msun. Anything you set overrides this. Note, if you use only one tuple, you must set it with a trailing comma, thus, e.g. ((0.07,1.0,0.1),). (default None)</span> +<span class="sd"> maxdm: a list of tuples similar to mindm but specifying a maximum mass spacing. In the case of maxdm, if the third option in each tuple is negative it is treated as a log step (its absolute value is used as the step). (default None)</span> +<span class="sd"> fsample: a global sampling (Shannon-like) factor (<1) to improve resolution (default 1.0, set to smaller to improve resolution)</span> +<span class="sd"> factor: all masses generated are multiplied by this after generation</span> +<span class="sd"> showtable: if True, the mass list and times are shown to stdout after generation</span> +<span class="sd"> showlist: if True, show the mass list once generated</span> +<span class="sd"> logmasses: if True, the masses are logged with math.log()</span> +<span class="sd"> log10masses: if True, the masses are logged with math.log10()</span> +<span class="sd"> usecache: if True (the default) uses cached results if they are saved (in cachedir) and cachedir is not None</span> +<span class="sd"> cachedir: where the cache is stored. if None, defaults to grid_options['cache_dir']+'/const_dt_cache'</span> +<span class="sd"> vb : verbose logging flag (default False)</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Array of masses.</span> + +<span class="sd"> Example:</span> +<span class="sd"> # these are lines set as options to Population.add_grid_value(...)</span> + +<span class="sd"> # linear time bins of 1Gyr</span> +<span class="sd"> samplerfunc="self.const_dt(self,dt=1000,nres=100,mmin=0.07,mmax=2.0,showtable=True)"</span> + +<span class="sd"> # logarithmic spacing in time, generally suitable for Galactic</span> +<span class="sd"> # chemical evolution yield grids.</span> +<span class="sd"> samplerfunc="self.const_dt(self,dlogt=0.1,nres=100,mmin=0.07,mmax=80.0,maxdm=((0.07,1.0,0.1),(1.0,10.0,1.0),(10.0,80.0,2.0)),showtable=True,logspacing=True,fsample=1.0/4.0)"</span> + +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">usecache</span><span class="p">:</span> + <span class="k">if</span> <span class="n">cachedir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">cachedir</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"cache_dir"</span><span class="p">]</span> + + <span class="k">if</span> <span class="n">cachedir</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">cachedir</span> <span class="o">+=</span> <span class="s2">"/const_dt_cache"</span> + <span class="n">cache</span> <span class="o">=</span> <span class="n">diskcache</span><span class="o">.</span><span class="n">Cache</span><span class="p">(</span><span class="n">cachedir</span><span class="p">)</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Use const_dt cache in </span><span class="si">{}</span><span class="s2"> [cache object </span><span class="si">{}</span><span class="s2">]"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cachedir</span><span class="p">,</span> <span class="n">cache</span><span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"const_dt uses no cache"</span><span class="p">)</span> + <span class="n">cache</span> <span class="o">=</span> <span class="kc">None</span> + + <span class="k">def</span> <span class="nf">_const_dt_wrapper</span><span class="p">(</span> + <span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">num_cores</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">bse_options</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">dt</span><span class="o">=</span><span class="mf">1000.0</span><span class="p">,</span> + <span class="n">dlogt</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> + <span class="n">mmin</span><span class="o">=</span><span class="mf">0.07</span><span class="p">,</span> + <span class="n">mmax</span><span class="o">=</span><span class="mf">100.0</span><span class="p">,</span> + <span class="n">nres</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span> + <span class="n">logspacing</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">tmin</span><span class="o">=</span><span class="mf">3.0</span><span class="p">,</span> <span class="c1"># start at 3Myr</span> + <span class="n">tmax</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="c1"># use max_evolution_time by default</span> + <span class="n">max_evolution_time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">mindm</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="c1"># tuple of tuples</span> + <span class="n">maxdm</span><span class="o">=</span><span class="p">((</span><span class="mf">0.07</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">),</span> <span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">300.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)),</span> <span class="c1"># tuple of tuples</span> + <span class="n">fsample</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> + <span class="n">factor</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> + <span class="n">logmasses</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">log10masses</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">showlist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">showtable</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">usecache</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="n">vb</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Wrapper function for the const_dt funtion which handles verbose logging and filtering of arguments</span> +<span class="sd"> """</span> + + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"call _const_dt num_cores=</span><span class="si">{}</span><span class="s2"> dt=</span><span class="si">{}</span><span class="s2"> dlogt=</span><span class="si">{}</span><span class="s2"> mmin=</span><span class="si">{}</span><span class="s2"> mmax=</span><span class="si">{}</span><span class="s2"> nres=</span><span class="si">{}</span><span class="s2"> logspacing=</span><span class="si">{}</span><span class="s2"> tmin=</span><span class="si">{}</span><span class="s2"> mindm=</span><span class="si">{}</span><span class="s2"> maxdm=</span><span class="si">{}</span><span class="s2"> fsample=</span><span class="si">{}</span><span class="s2"> factor=</span><span class="si">{}</span><span class="s2"> logmasses=</span><span class="si">{}</span><span class="s2"> log10masses=</span><span class="si">{}</span><span class="s2"> showlist=</span><span class="si">{}</span><span class="s2"> usecache=</span><span class="si">{}</span><span class="s2"> [cache=</span><span class="si">{}</span><span class="s2"> vb=</span><span class="si">{}</span><span class="s2">]"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">num_cores</span><span class="p">,</span> + <span class="n">dt</span><span class="p">,</span> + <span class="n">dlogt</span><span class="p">,</span> + <span class="n">mmin</span><span class="p">,</span> + <span class="n">mmax</span><span class="p">,</span> + <span class="n">nres</span><span class="p">,</span> + <span class="n">logspacing</span><span class="p">,</span> + <span class="n">tmin</span><span class="p">,</span> + <span class="n">mindm</span><span class="p">,</span> + <span class="n">maxdm</span><span class="p">,</span> + <span class="n">fsample</span><span class="p">,</span> + <span class="n">factor</span><span class="p">,</span> + <span class="n">logmasses</span><span class="p">,</span> + <span class="n">log10masses</span><span class="p">,</span> + <span class="n">showlist</span><span class="p">,</span> + <span class="n">usecache</span><span class="p">,</span> + <span class="n">cache</span><span class="p">,</span> + <span class="n">vb</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="n">traceback</span><span class="o">.</span><span class="n">print_stack</span><span class="p">()</span> + + <span class="c1"># strip bse_options of options that will not affect</span> + <span class="c1"># _const_dt</span> + <span class="n">bse_stripped</span> <span class="o">=</span> <span class="n">bse_options</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> + + <span class="n">del_keys</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"multiplicity"</span><span class="p">]</span> + <span class="k">for</span> <span class="n">del_key</span> <span class="ow">in</span> <span class="n">del_keys</span><span class="p">:</span> + <span class="k">if</span> <span class="n">del_key</span> <span class="ow">in</span> <span class="n">bse_stripped</span><span class="p">:</span> + <span class="k">del</span> <span class="n">bse_stripped</span><span class="p">[</span><span class="n">del_key</span><span class="p">]</span> + + <span class="c1"># make a JSON string of the options (this can be</span> + <span class="c1"># used to check the cache)</span> + <span class="n">bse_options_json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span> + <span class="n">bse_stripped</span><span class="p">,</span> <span class="n">sort_keys</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">vb</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"BSE options JSON:"</span><span class="p">,</span> <span class="n">bse_options_json</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">_const_dt</span><span class="p">(</span> + <span class="n">cachedir</span><span class="o">=</span><span class="n">cachedir</span><span class="p">,</span> + <span class="n">num_cores</span><span class="o">=</span><span class="n">num_cores</span><span class="p">,</span> + <span class="n">bse_options_json</span><span class="o">=</span><span class="n">bse_options_json</span><span class="p">,</span> + <span class="n">dt</span><span class="o">=</span><span class="n">dt</span><span class="p">,</span> + <span class="n">dlogt</span><span class="o">=</span><span class="n">dlogt</span><span class="p">,</span> + <span class="n">mmin</span><span class="o">=</span><span class="n">mmin</span><span class="p">,</span> + <span class="n">mmax</span><span class="o">=</span><span class="n">mmax</span><span class="p">,</span> + <span class="n">nres</span><span class="o">=</span><span class="n">nres</span><span class="p">,</span> + <span class="n">logspacing</span><span class="o">=</span><span class="n">logspacing</span><span class="p">,</span> + <span class="n">tmin</span><span class="o">=</span><span class="n">tmin</span><span class="p">,</span> + <span class="n">tmax</span><span class="o">=</span><span class="n">tmax</span><span class="p">,</span> + <span class="n">max_evolution_time</span><span class="o">=</span><span class="n">max_evolution_time</span><span class="p">,</span> + <span class="n">mindm</span><span class="o">=</span><span class="n">mindm</span><span class="p">,</span> + <span class="n">maxdm</span><span class="o">=</span><span class="n">maxdm</span><span class="p">,</span> + <span class="n">fsample</span><span class="o">=</span><span class="n">fsample</span><span class="p">,</span> + <span class="n">logmasses</span><span class="o">=</span><span class="n">logmasses</span><span class="p">,</span> + <span class="n">log10masses</span><span class="o">=</span><span class="n">log10masses</span><span class="p">,</span> + <span class="n">showlist</span><span class="o">=</span><span class="n">showlist</span><span class="p">,</span> + <span class="n">showtable</span><span class="o">=</span><span class="n">showtable</span><span class="p">,</span> + <span class="n">usecache</span><span class="o">=</span><span class="n">usecache</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># if we want to use the cache, set the __decorator</span> + <span class="c1"># to just be the cache.memoize function, otherwise</span> + <span class="c1"># make it a wrapped function that just returns the</span> + <span class="c1"># _const_dt function acting on its arguments</span> + <span class="k">def</span> <span class="nf">__dummy_decorator</span><span class="p">(</span><span class="n">func</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Placeholder decorator function</span> +<span class="sd"> """</span> + + <span class="nd">@functools</span><span class="o">.</span><span class="n">wraps</span><span class="p">(</span><span class="n">func</span><span class="p">)</span> + <span class="k">def</span> <span class="nf">wrapped</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Dummy wrapper function</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="n">func</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">wrapped</span> + + <span class="k">if</span> <span class="n">cache</span><span class="p">:</span> + <span class="n">__decorator</span> <span class="o">=</span> <span class="n">cache</span><span class="o">.</span><span class="n">memoize</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">__decorator</span> <span class="o">=</span> <span class="n">__dummy_decorator</span> + + <span class="nd">@__decorator</span> + <span class="k">def</span> <span class="nf">_const_dt</span><span class="p">(</span> + <span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">num_cores</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">bse_options_json</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="c1"># JSON string</span> + <span class="n">dt</span><span class="o">=</span><span class="mf">1000.0</span><span class="p">,</span> + <span class="n">dlogt</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> + <span class="n">mmin</span><span class="o">=</span><span class="mf">0.07</span><span class="p">,</span> + <span class="n">mmax</span><span class="o">=</span><span class="mf">100.0</span><span class="p">,</span> + <span class="n">nres</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span> + <span class="n">logspacing</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">tmin</span><span class="o">=</span><span class="mf">3.0</span><span class="p">,</span> <span class="c1"># start at 3Myr</span> + <span class="n">tmax</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="c1"># use max_evolution_time by default</span> + <span class="n">max_evolution_time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> + <span class="n">mindm</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="c1"># tuple of tuples</span> + <span class="n">maxdm</span><span class="o">=</span><span class="p">((</span><span class="mf">0.07</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">),</span> <span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">300.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)),</span> <span class="c1"># tuple of tuples</span> + <span class="n">fsample</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> + <span class="n">factor</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> + <span class="n">logmasses</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">log10masses</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">showlist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">showtable</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">usecache</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> + <span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> first thing to do is make a stellar lifetime table</span> +<span class="sd"> </span> +<span class="sd"> we should use the bse_options_json passed in</span> +<span class="sd"> so our lifetime_population uses the same physics</span> +<span class="sd"> as the main grid</span> + +<span class="sd"> TODO: Describe this function better with arguments and </span> +<span class="sd"> """</span> + + <span class="c1"># convert bse_options to dict</span> + <span class="n">bse_options</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">bse_options_json</span><span class="p">)</span> + + <span class="c1"># perhaps override max_evolution_time</span> + <span class="k">if</span> <span class="n">max_evolution_time</span><span class="p">:</span> + <span class="n">bse_options</span><span class="p">[</span><span class="s2">"max_evolution_time"</span><span class="p">]</span> <span class="o">=</span> <span class="n">max_evolution_time</span> + + <span class="n">lifetime_population</span> <span class="o">=</span> <span class="n">Population</span><span class="p">()</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">bse_options</span> <span class="o">=</span> <span class="n">bse_options</span> + + <span class="c1"># we only want to evolve the star during nuclear burning,</span> + <span class="c1"># we don't want a dry run of the grid</span> + <span class="c1"># we want to use the right number of CPU cores</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> + <span class="n">do_dry_run</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">num_cores</span><span class="o">=</span><span class="n">num_cores</span><span class="p">,</span> + <span class="n">max_stellar_type_1</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> + <span class="n">save_ensemble_chunks</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">symlink_latest_gridcode</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> + <span class="n">modulo</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">start_at</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="n">slurm</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="n">condor</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="n">multiplicity</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">ensemble</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> + <span class="n">ensemble_dt</span><span class="o">=</span><span class="mf">1e3</span><span class="p">,</span> + <span class="n">ensemble_logdt</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> + <span class="c1"># for debugging</span> + <span class="n">verbosity</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">log_dt</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># make a grid in M1</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">add_grid_variable</span><span class="p">(</span> + <span class="n">name</span><span class="o">=</span><span class="s2">"lnM_1"</span><span class="p">,</span> + <span class="n">parameter_name</span><span class="o">=</span><span class="s2">"M_1"</span><span class="p">,</span> + <span class="n">longname</span><span class="o">=</span><span class="s2">"log Primary mass"</span><span class="p">,</span> <span class="c1"># == single-star mass</span> + <span class="n">valuerange</span><span class="o">=</span><span class="p">[</span><span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">mmin</span><span class="p">),</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">mmax</span><span class="p">)],</span> + <span class="n">samplerfunc</span><span class="o">=</span><span class="s2">"self.const_linear(math.log(</span><span class="si">{mmin}</span><span class="s2">),math.log(</span><span class="si">{mmax}</span><span class="s2">),</span><span class="si">{nres}</span><span class="s2">)"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">mmin</span><span class="o">=</span><span class="n">mmin</span><span class="p">,</span> <span class="n">mmax</span><span class="o">=</span><span class="n">mmax</span><span class="p">,</span> <span class="n">nres</span><span class="o">=</span><span class="n">nres</span> + <span class="p">),</span> + <span class="n">probdist</span><span class="o">=</span><span class="s2">"1"</span><span class="p">,</span> <span class="c1"># dprob/dm1 : we don't care, so just set it to 1</span> + <span class="n">dphasevol</span><span class="o">=</span><span class="s2">"dlnM_1"</span><span class="p">,</span> + <span class="n">precode</span><span class="o">=</span><span class="s2">"M_1=math.exp(lnM_1)"</span><span class="p">,</span> + <span class="n">condition</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="c1"># Impose a condition on this grid variable. Mostly for a check for yourself</span> + <span class="n">gridtype</span><span class="o">=</span><span class="s2">"edge"</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># set up the parse function</span> + <span class="k">def</span> <span class="nf">_parse_function</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">output</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Parse function for the const_dt binary_c calls</span> +<span class="sd"> """</span> + + <span class="k">if</span> <span class="n">output</span><span class="p">:</span> + <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">output</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span> + <span class="n">data</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">()</span> + <span class="k">if</span> <span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"SINGLE_STAR_LIFETIME"</span><span class="p">:</span> + <span class="c1"># append (log10(mass), log10(lifetime)) tuples</span> + <span class="n">logm</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span> + <span class="n">logt</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="mi">2</span><span class="p">]))</span> + <span class="c1"># print(line)</span> + <span class="c1"># print("logM=",logm,"M=",10.0**logm," -> logt=",logt)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table m->t"</span><span class="p">][</span><span class="n">logm</span><span class="p">]</span> <span class="o">=</span> <span class="n">logt</span> + <span class="bp">self</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table t->m"</span><span class="p">][</span><span class="n">logt</span><span class="p">]</span> <span class="o">=</span> <span class="n">logm</span> + + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> + <span class="n">parse_function</span><span class="o">=</span><span class="n">_parse_function</span><span class="p">,</span> + <span class="p">)</span> + + <span class="c1"># run to build the interpolation table</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Running population to make lifetime interpolation table, please wait"</span> + <span class="p">)</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">evolve</span><span class="p">()</span> + <span class="c1"># print("Data table",lifetime_population.grid_results['interpolation table t->m'])</span> + + <span class="k">if</span> <span class="p">(</span> + <span class="s2">"interpolation table t->m"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span> + <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table t->m"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="p">)</span> + <span class="o">==</span> <span class="mi">0</span> + <span class="p">):</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\n\n\n</span><span class="s2">Error: The t->m lifetime table is empty. One usual cause for this is that the tmax or max_evolution_time option (currently passed in to const_dt as </span><span class="si">{tmax}</span><span class="s2">) is too short for there to be any entries in the table before the first timestep. Try increasing tmax and max_evolution_time, shorten the timestep or, if using log times, set tstart to be closer to 0.</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">tmax</span><span class="o">=</span><span class="n">tmax</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span> + + <span class="c1"># convert to nested lists for the interpolator</span> + <span class="c1">#</span> + <span class="c1"># make time -> mass table</span> + <span class="n">data_table_time_mass</span> <span class="o">=</span> <span class="p">[]</span> + <span class="n">times</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table t->m"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">time</span> <span class="ow">in</span> <span class="n">times</span><span class="p">:</span> + <span class="n">mass</span> <span class="o">=</span> <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table t->m"</span><span class="p">][</span> + <span class="n">time</span> + <span class="p">]</span> + <span class="c1"># we have to make sure the time is monotonic (not guaranteed at high mass)</span> + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data_table_time_mass</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">data_table_time_mass</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">time</span><span class="p">,</span> <span class="n">mass</span><span class="p">])</span> + <span class="k">elif</span> <span class="n">mass</span> <span class="o"><</span> <span class="n">data_table_time_mass</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">]:</span> + <span class="n">data_table_time_mass</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">time</span><span class="p">,</span> <span class="n">mass</span><span class="p">])</span> + + <span class="c1"># make mass -> time table</span> + <span class="n">data_table_mass_time</span> <span class="o">=</span> <span class="p">[]</span> + <span class="n">masses</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span> + <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table m->t"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> + <span class="p">)</span> + <span class="k">for</span> <span class="n">mass</span> <span class="ow">in</span> <span class="n">masses</span><span class="p">:</span> + <span class="n">time</span> <span class="o">=</span> <span class="n">lifetime_population</span><span class="o">.</span><span class="n">grid_results</span><span class="p">[</span><span class="s2">"interpolation table m->t"</span><span class="p">][</span> + <span class="n">mass</span> + <span class="p">]</span> + <span class="n">data_table_mass_time</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">mass</span><span class="p">,</span> <span class="n">time</span><span class="p">])</span> + + <span class="c1"># set up interpolators</span> + <span class="n">interpolator_time_mass</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">data_table_time_mass</span><span class="p">,</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="c1"># mass # lifetime</span> + <span class="p">)</span> + <span class="n">interpolator_mass_time</span> <span class="o">=</span> <span class="n">py_rinterpolate</span><span class="o">.</span><span class="n">Rinterpolate</span><span class="p">(</span> + <span class="n">table</span><span class="o">=</span><span class="n">data_table_mass_time</span><span class="p">,</span> + <span class="n">nparams</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">ndata</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> + <span class="n">verbosity</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="c1"># lifetime # mass</span> + <span class="p">)</span> + + <span class="k">def</span> <span class="nf">_mass_from_time</span><span class="p">(</span><span class="n">linear_time</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to get a mass given a time, calculated by using the interpolator_time_mass</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="p">(</span> + <span class="mf">10.0</span> + <span class="o">**</span> <span class="n">interpolator_time_mass</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">linear_time</span><span class="p">)])[</span><span class="mi">0</span><span class="p">]</span> + <span class="p">)</span> + + <span class="k">def</span> <span class="nf">_time_from_mass</span><span class="p">(</span><span class="n">mass</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to get a time given a mass, calculated by using the interpolator_time_mass</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="mf">10.0</span> <span class="o">**</span> <span class="n">interpolator_mass_time</span><span class="o">.</span><span class="n">interpolate</span><span class="p">([</span><span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">mass</span><span class="p">)])[</span><span class="mi">0</span><span class="p">]</span> + + <span class="k">def</span> <span class="nf">_uniq</span><span class="p">(</span><span class="n">_list</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return a list containing only unique elements</span> + +<span class="sd"> TODO: move this to the functions file</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">_list</span><span class="p">)))</span> + + <span class="k">def</span> <span class="nf">_format</span><span class="p">(</span><span class="n">_list</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to format a list of numbers as %g strings</span> +<span class="sd"> """</span> + + <span class="k">return</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="s2">"</span><span class="si">{x:g}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">))</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">_list</span><span class="p">]</span> + + <span class="c1"># construct mass list, always include the min and max</span> + <span class="n">mass_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">mmin</span><span class="p">,</span> <span class="n">mmax</span><span class="p">]</span> + + <span class="c1"># first, make sure the stars are separated by only</span> + <span class="c1"># maxdm</span> + <span class="k">if</span> <span class="n">maxdm</span><span class="p">:</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">maxdm</span><span class="p">:</span> + <span class="n">range_min</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">range_max</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> + <span class="n">dm</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> + <span class="k">if</span> <span class="n">dm</span> <span class="o"><</span> <span class="mf">0.0</span><span class="p">:</span> + <span class="c1"># use log scale</span> + <span class="n">dlogm</span> <span class="o">=</span> <span class="o">-</span><span class="n">dm</span> + <span class="n">logm</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">mmin</span><span class="p">)</span> + <span class="n">logmmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">mmax</span><span class="p">)</span> + <span class="n">logrange_min</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">range_min</span><span class="p">)</span> + <span class="n">logrange_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">range_max</span><span class="p">)</span> + <span class="k">while</span> <span class="n">logm</span> <span class="o"><=</span> <span class="n">logmmax</span><span class="p">:</span> + <span class="k">if</span> <span class="n">logrange_min</span> <span class="o"><=</span> <span class="n">logm</span> <span class="o"><=</span> <span class="n">logrange_max</span><span class="p">:</span> + <span class="n">mass_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">logm</span><span class="p">))</span> + <span class="n">logm</span> <span class="o">+=</span> <span class="n">dlogm</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># use linear scale</span> + <span class="n">m</span> <span class="o">=</span> <span class="n">mmin</span> + <span class="k">while</span> <span class="n">m</span> <span class="o"><=</span> <span class="n">mmax</span><span class="p">:</span> + <span class="k">if</span> <span class="n">range_min</span> <span class="o"><=</span> <span class="n">m</span> <span class="o"><=</span> <span class="n">range_max</span><span class="p">:</span> + <span class="n">mass_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">m</span><span class="p">)</span> + <span class="n">m</span> <span class="o">+=</span> <span class="n">dm</span> + + <span class="c1"># start time loop at tmax or max_evolution_time</span> + <span class="n">t</span> <span class="o">=</span> <span class="n">tmax</span> <span class="k">if</span> <span class="n">tmax</span> <span class="k">else</span> <span class="n">bse_options</span><span class="p">[</span><span class="s2">"max_evolution_time"</span><span class="p">]</span> + + <span class="c1"># set default mass list</span> + <span class="k">if</span> <span class="n">logspacing</span><span class="p">:</span> + <span class="n">logt</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> + <span class="n">logtmin</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">tmin</span><span class="p">)</span> + <span class="k">while</span> <span class="n">logt</span> <span class="o">></span> <span class="n">logtmin</span><span class="p">:</span> + <span class="n">m</span> <span class="o">=</span> <span class="n">_mass_from_time</span><span class="p">(</span><span class="mf">10.0</span> <span class="o">**</span> <span class="n">logt</span><span class="p">)</span> + <span class="n">mass_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">m</span><span class="p">)</span> + <span class="n">logt</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">logtmin</span><span class="p">,</span> <span class="n">logt</span> <span class="o">-</span> <span class="n">dlogt</span> <span class="o">*</span> <span class="n">fsample</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">while</span> <span class="n">t</span> <span class="o">></span> <span class="n">tmin</span><span class="p">:</span> + <span class="n">m</span> <span class="o">=</span> <span class="n">_mass_from_time</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> + <span class="n">mass_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">m</span><span class="p">)</span> + <span class="n">t</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">tmin</span><span class="p">,</span> <span class="n">t</span> <span class="o">-</span> <span class="n">dt</span> <span class="o">*</span> <span class="n">fsample</span><span class="p">)</span> + + <span class="c1"># make mass list unique</span> + <span class="n">mass_list</span> <span class="o">=</span> <span class="n">_uniq</span><span class="p">(</span><span class="n">mass_list</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">mindm</span><span class="p">:</span> + <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">mindm</span><span class="p">:</span> + <span class="n">range_min</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">range_max</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> + <span class="n">mindm</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> + <span class="c1"># impose a minimum dm: if two masses in the list</span> + <span class="c1"># are separated by < this, remove the second</span> + <span class="k">for</span> <span class="n">index</span><span class="p">,</span> <span class="n">mass</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">mass_list</span><span class="p">):</span> + <span class="k">if</span> <span class="n">index</span> <span class="o">></span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">range_min</span> <span class="o"><=</span> <span class="n">mass</span> <span class="o"><=</span> <span class="n">range_max</span><span class="p">:</span> + <span class="n">dm</span> <span class="o">=</span> <span class="n">mass_list</span><span class="p">[</span><span class="n">index</span><span class="p">]</span> <span class="o">-</span> <span class="n">mass_list</span><span class="p">[</span><span class="n">index</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> + <span class="k">if</span> <span class="n">dm</span> <span class="o"><</span> <span class="n">mindm</span><span class="p">:</span> + <span class="n">mass_list</span><span class="p">[</span><span class="n">index</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.0</span> + <span class="n">mass_list</span> <span class="o">=</span> <span class="n">_uniq</span><span class="p">(</span><span class="n">mass_list</span><span class="p">)</span> + <span class="k">if</span> <span class="n">mass_list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">:</span> + <span class="n">mass_list</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span> + + <span class="c1"># apply multiplication factor if given</span> + <span class="k">if</span> <span class="n">factor</span> <span class="ow">and</span> <span class="n">factor</span> <span class="o">!=</span> <span class="mf">1.0</span><span class="p">:</span> + <span class="n">mass_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">m</span> <span class="o">*</span> <span class="n">factor</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">mass_list</span><span class="p">]</span> + + <span class="c1"># reformat numbers</span> + <span class="n">mass_list</span> <span class="o">=</span> <span class="n">_format</span><span class="p">(</span><span class="n">mass_list</span><span class="p">)</span> + + <span class="c1"># show the mass<>time table?</span> + <span class="k">if</span> <span class="n">showtable</span><span class="p">:</span> + <span class="n">twas</span> <span class="o">=</span> <span class="mf">0.0</span> + <span class="n">logtwas</span> <span class="o">=</span> <span class="mf">0.0</span> + <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">m</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">mass_list</span><span class="p">):</span> + <span class="n">t</span> <span class="o">=</span> <span class="n">_time_from_mass</span><span class="p">(</span><span class="n">m</span><span class="p">)</span> + <span class="n">logt</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> + <span class="k">if</span> <span class="n">twas</span> <span class="o">></span> <span class="mf">0.0</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{i:4d}</span><span class="s2"> m=</span><span class="si">{m:13g}</span><span class="s2"> t=</span><span class="si">{t:13g}</span><span class="s2"> log10(t)=</span><span class="si">{logt:13g}</span><span class="s2"> dt=</span><span class="si">{dt:13g}</span><span class="s2"> dlog10(t)=</span><span class="si">{dlogt:13g}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="p">,</span> + <span class="n">m</span><span class="o">=</span><span class="n">m</span><span class="p">,</span> + <span class="n">t</span><span class="o">=</span><span class="n">t</span><span class="p">,</span> + <span class="n">logt</span><span class="o">=</span><span class="n">logt</span><span class="p">,</span> + <span class="n">dt</span><span class="o">=</span><span class="n">twas</span> <span class="o">-</span> <span class="n">t</span><span class="p">,</span> + <span class="n">dlogt</span><span class="o">=</span><span class="n">logtwas</span> <span class="o">-</span> <span class="n">logt</span><span class="p">,</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"</span><span class="si">{i:4d}</span><span class="s2"> m=</span><span class="si">{m:13g}</span><span class="s2"> t=</span><span class="si">{t:13g}</span><span class="s2"> log10(t)=</span><span class="si">{logt:13g}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="p">,</span> <span class="n">m</span><span class="o">=</span><span class="n">m</span><span class="p">,</span> <span class="n">t</span><span class="o">=</span><span class="n">t</span><span class="p">,</span> <span class="n">logt</span><span class="o">=</span><span class="n">logt</span> + <span class="p">)</span> + <span class="p">)</span> + <span class="n">twas</span> <span class="o">=</span> <span class="n">t</span> + <span class="n">logtwas</span> <span class="o">=</span> <span class="n">logt</span> + <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span> + + <span class="c1"># return the mass list as a numpy array</span> + <span class="n">mass_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">unique</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">mass_list</span><span class="p">))</span> + + <span class="c1"># perhaps log the masses</span> + <span class="k">if</span> <span class="n">logmasses</span><span class="p">:</span> + <span class="n">mass_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">mass_array</span><span class="p">)</span> + <span class="k">if</span> <span class="n">log10masses</span><span class="p">:</span> + <span class="n">mass_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">mass_array</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">mass_array</span> + + <span class="c1"># call _const_dt and return the mass_list</span> + <span class="c1">#</span> + <span class="c1"># Note: because _const_dt is cached to disk, calling it may</span> + <span class="c1"># use the cached result.</span> + <span class="c1">#</span> + <span class="c1"># Note: we send a sorted JSON string instead of the</span> + <span class="c1"># bse_options dict to make sure the order is preserved</span> + + <span class="n">mass_list</span> <span class="o">=</span> <span class="n">_const_dt_wrapper</span><span class="p">(</span> + <span class="n">cachedir</span><span class="o">=</span><span class="n">cachedir</span><span class="p">,</span> + <span class="n">num_cores</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"num_cores"</span><span class="p">],</span> + <span class="n">bse_options</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">bse_options</span><span class="p">,</span> + <span class="o">**</span><span class="n">kwargs</span><span class="p">,</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">cache</span><span class="p">:</span> + <span class="n">cache</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> + + <span class="k">if</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"showlist"</span><span class="p">,</span> <span class="kc">True</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"const_dt mass list (</span><span class="si">{}</span><span class="s2"> masses)</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mass_list</span><span class="p">)),</span> <span class="n">mass_list</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">mass_list</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/population_extensions/version_info.html b/docs/build/html/_modules/binarycpython/utils/population_extensions/version_info.html new file mode 100644 index 0000000000000000000000000000000000000000..f4df170bb8a9039989fd640708a64cb8ca6efef8 --- /dev/null +++ b/docs/build/html/_modules/binarycpython/utils/population_extensions/version_info.html @@ -0,0 +1,542 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>binarycpython.utils.population_extensions.version_info — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script> + <script src="../../../../_static/jquery.js"></script> + <script src="../../../../_static/underscore.js"></script> + <script src="../../../../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../../../../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../../../../genindex.html" /> + <link rel="search" title="Search" href="../../../../search.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../../../../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../../../../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../modules.html">Binarycpython code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../../../../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../../../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../../../../index.html" class="icon icon-home"></a> »</li> + <li><a href="../../../index.html">Module code</a> »</li> + <li>binarycpython.utils.population_extensions.version_info</li> + <li class="wy-breadcrumbs-aside"> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for binarycpython.utils.population_extensions.version_info</h1><div class="highlight"><pre> +<span></span><span class="sd">"""</span> +<span class="sd">File containing the class object containing the functions to handle binary_c version info.</span> + +<span class="sd">This class will be used to extend the population object</span> + +<span class="sd">NOTE: could these functions not just be normal functions rather than class methods? I see hardly any use of the self</span> +<span class="sd">"""</span> + +<span class="c1"># pylint: disable=E0203</span> + +<span class="kn">import</span> <span class="nn">copy</span> +<span class="kn">import</span> <span class="nn">os</span> + +<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span> + +<span class="kn">from</span> <span class="nn">binarycpython</span> <span class="kn">import</span> <span class="n">_binary_c_bindings</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.functions</span> <span class="kn">import</span> <span class="n">isfloat</span> + + +<div class="viewcode-block" id="version_info"><a class="viewcode-back" href="../../../../population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info">[docs]</a><span class="k">class</span> <span class="nc">version_info</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Class object containing the functions to handle binary_c version info.</span> + +<span class="sd"> This class will be used to extend the population object</span> +<span class="sd"> """</span> + + <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Init function for the version_info class</span> +<span class="sd"> """</span> + + <span class="k">return</span> + + <span class="c1">########################################################</span> + <span class="c1"># version_info functions</span> + <span class="c1">########################################################</span> +<div class="viewcode-block" id="version_info.return_binary_c_version_info"><a class="viewcode-back" href="../../../../population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.return_binary_c_version_info">[docs]</a> <span class="k">def</span> <span class="nf">return_binary_c_version_info</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parsed</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">dict</span><span class="p">]:</span> + <span class="sd">"""</span> +<span class="sd"> Function that returns the version information of binary_c. This function calls the function</span> +<span class="sd"> _binary_c_bindings.return_version_info()</span> + +<span class="sd"> Args:</span> +<span class="sd"> parsed: Boolean flag whether to parse the version_info output of binary_c. default = False</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Either the raw string of binary_c or a parsed version of this in the form of a nested</span> +<span class="sd"> dictionary</span> +<span class="sd"> """</span> + + <span class="n">found_prev</span> <span class="o">=</span> <span class="kc">False</span> + <span class="k">if</span> <span class="s2">"BINARY_C_MACRO_HEADER"</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span> + <span class="c1"># the env var is already present. lets save that and put that back later</span> + <span class="n">found_prev</span> <span class="o">=</span> <span class="kc">True</span> + <span class="n">prev_value</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C_MACRO_HEADER"</span><span class="p">]</span> + + <span class="c1">#</span> + <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C_MACRO_HEADER"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"macroxyz"</span> + + <span class="c1"># Get version_info</span> + <span class="n">raw_version_info</span> <span class="o">=</span> <span class="n">_binary_c_bindings</span><span class="o">.</span><span class="n">return_version_info</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + + <span class="c1"># delete value</span> + <span class="k">del</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C_MACRO_HEADER"</span><span class="p">]</span> + + <span class="c1"># put stuff back if we found a previous one</span> + <span class="k">if</span> <span class="n">found_prev</span><span class="p">:</span> + <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">"BINARY_C_MACRO_HEADER"</span><span class="p">]</span> <span class="o">=</span> <span class="n">prev_value</span> + + <span class="c1"># parse if wanted</span> + <span class="k">if</span> <span class="n">parsed</span><span class="p">:</span> + <span class="n">parsed_version_info</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_binary_c_version_info</span><span class="p">(</span><span class="n">raw_version_info</span><span class="p">)</span> + <span class="k">return</span> <span class="n">parsed_version_info</span> + + <span class="k">return</span> <span class="n">raw_version_info</span></div> + +<div class="viewcode-block" id="version_info.parse_binary_c_version_info"><a class="viewcode-back" href="../../../../population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.parse_binary_c_version_info">[docs]</a> <span class="k">def</span> <span class="nf">parse_binary_c_version_info</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">version_info_string</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span> + <span class="sd">"""</span> +<span class="sd"> Function that parses the binary_c version info. Long function with a lot of branches</span> + +<span class="sd"> Args:</span> +<span class="sd"> version_info_string: raw output of version_info call to binary_c</span> + +<span class="sd"> Returns:</span> +<span class="sd"> Parsed version of the version info, which is a dictionary containing the keys: 'isotopes' for isotope info, 'argpairs' for argument pair info (TODO: explain), 'ensembles' for ensemble settings/info, 'macros' for macros, 'elements' for atomic element info, 'DTlimit' for (TODO: explain), 'nucleosynthesis_sources' for nucleosynthesis sources, and 'miscellaneous' for all those that were not caught by the previous groups. 'git_branch', 'git_build', 'revision' and 'email' are also keys, but its clear what those contain.</span> +<span class="sd"> """</span> + + <span class="n">version_info_dict</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># Clean data and put in correct shape</span> + <span class="n">splitted</span> <span class="o">=</span> <span class="n">version_info_string</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span> + <span class="n">cleaned</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">splitted</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">el</span> <span class="o">==</span> <span class="s2">""</span><span class="p">}</span> + + <span class="c1">##########################</span> + <span class="c1"># Network:</span> + <span class="c1"># Split off all the networks and parse the info.</span> + + <span class="n">networks</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Network "</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">=</span> <span class="n">cleaned</span> <span class="o">-</span> <span class="n">networks</span> + + <span class="n">networks_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">networks</span><span class="p">:</span> + <span class="n">network_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Network "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"=="</span><span class="p">)</span> + + <span class="n">network_number</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> + <span class="n">network_dict</span><span class="p">[</span><span class="s2">"network_number"</span><span class="p">]</span> <span class="o">=</span> <span class="n">network_number</span> + + <span class="n">network_info_split</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + + <span class="n">shortname</span> <span class="o">=</span> <span class="n">network_info_split</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="n">network_dict</span><span class="p">[</span><span class="s2">"shortname"</span><span class="p">]</span> <span class="o">=</span> <span class="n">shortname</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">network_info_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">":"</span><span class="p">):</span> + <span class="n">network_split_info_extra</span> <span class="o">=</span> <span class="n">network_info_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">":"</span><span class="p">)</span> + + <span class="n">longname</span> <span class="o">=</span> <span class="n">network_split_info_extra</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="n">network_dict</span><span class="p">[</span><span class="s2">"longname"</span><span class="p">]</span> <span class="o">=</span> <span class="n">longname</span> + + <span class="n">implementation</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">network_split_info_extra</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"implemented in"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="p">)</span> + <span class="k">if</span> <span class="n">implementation</span><span class="p">:</span> + <span class="n">network_dict</span><span class="p">[</span><span class="s2">"implemented_in"</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> + <span class="n">i</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">"()"</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">implementation</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">()</span> + <span class="p">]</span> + + <span class="n">networks_dict</span><span class="p">[</span><span class="n">network_number</span><span class="p">]</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">network_dict</span><span class="p">)</span> + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"networks"</span><span class="p">]</span> <span class="o">=</span> <span class="n">networks_dict</span> <span class="k">if</span> <span class="n">networks_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##########################</span> + <span class="c1"># Isotopes:</span> + <span class="c1"># Split off</span> + <span class="n">isotopes</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Isotope "</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">isotopes</span> + + <span class="n">isotope_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">isotopes</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Isotope "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + + <span class="n">isotope_info</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + <span class="n">name</span> <span class="o">=</span> <span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" "</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + + <span class="c1"># Get details</span> + <span class="n">mass_g</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span> + <span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"("</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">][:</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="p">)</span> + <span class="n">mass_amu</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span> + <span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"("</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="p">)</span> + <span class="n">mass_mev</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span> + <span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">")"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="p">)</span> + <span class="n">A</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">")"</span><span class="p">,</span> <span class="s2">""</span><span class="p">))</span> + <span class="n">Z</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">isotope_info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> + + <span class="c1">#</span> + <span class="n">isotope_dict</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"name"</span><span class="p">:</span> <span class="n">name</span><span class="p">,</span> + <span class="s2">"Z"</span><span class="p">:</span> <span class="n">Z</span><span class="p">,</span> + <span class="s2">"A"</span><span class="p">:</span> <span class="n">A</span><span class="p">,</span> + <span class="s2">"mass_mev"</span><span class="p">:</span> <span class="n">mass_mev</span><span class="p">,</span> + <span class="s2">"mass_g"</span><span class="p">:</span> <span class="n">mass_g</span><span class="p">,</span> + <span class="s2">"mass_amu"</span><span class="p">:</span> <span class="n">mass_amu</span><span class="p">,</span> + <span class="p">}</span> + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"isotopes"</span><span class="p">]</span> <span class="o">=</span> <span class="n">isotope_dict</span> <span class="k">if</span> <span class="n">isotope_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##########################</span> + <span class="c1"># Arg pairs:</span> + <span class="c1"># Split off</span> + <span class="n">argpairs</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"ArgPair"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">argpairs</span> + + <span class="n">argpair_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">argpairs</span><span class="p">):</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"ArgPair "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" "</span><span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="n">argpair_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="kc">None</span><span class="p">):</span> + <span class="n">argpair_dict</span><span class="p">[</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="p">{</span><span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">2</span><span class="p">]}</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">argpair_dict</span><span class="p">[</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]][</span><span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"argpairs"</span><span class="p">]</span> <span class="o">=</span> <span class="n">argpair_dict</span> <span class="k">if</span> <span class="n">argpair_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##########################</span> + <span class="c1"># ensembles:</span> + <span class="c1"># Split off</span> + <span class="n">ensembles</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Ensemble"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">ensembles</span> + + <span class="n">ensemble_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">ensemble_filter_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">ensembles</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Ensemble "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">split_info</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"filter"</span><span class="p">):</span> + <span class="n">ensemble_dict</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">filter_no</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"filter "</span><span class="p">,</span> <span class="s2">""</span><span class="p">))</span> + <span class="n">ensemble_filter_dict</span><span class="p">[</span><span class="n">filter_no</span><span class="p">]</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"ensembles"</span><span class="p">]</span> <span class="o">=</span> <span class="n">ensemble_dict</span> <span class="k">if</span> <span class="n">ensemble_dict</span> <span class="k">else</span> <span class="kc">None</span> + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"ensemble_filters"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">ensemble_filter_dict</span> <span class="k">if</span> <span class="n">ensemble_filter_dict</span> <span class="k">else</span> <span class="kc">None</span> + <span class="p">)</span> + + <span class="c1">##########################</span> + <span class="c1"># macros:</span> + <span class="c1"># Split off</span> + <span class="n">macros</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"macroxyz"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">macros</span> + + <span class="n">param_type_dict</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"STRING"</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="s2">"FLOAT"</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> + <span class="s2">"MACRO"</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> + <span class="s2">"INT"</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> + <span class="s2">"LONG_INT"</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> + <span class="s2">"UINT"</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> + <span class="p">}</span> + + <span class="n">macros_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">macros</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"macroxyz "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" : "</span><span class="p">)</span> + <span class="n">param_type</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + + <span class="n">new_split</span> <span class="o">=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + <span class="n">param_name</span> <span class="o">=</span> <span class="n">new_split</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="n">param_value</span> <span class="o">=</span> <span class="s2">" is "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">new_split</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span> + <span class="n">param_value</span> <span class="o">=</span> <span class="n">param_value</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + + <span class="c1"># print("macro ",param_name,"=",param_value," float?",isfloat(param_value)," int?",isint(param_value))</span> + + <span class="c1"># If we're trying to set the value to "on", check that</span> + <span class="c1"># it doesn't already exist. If it does, do nothing, as the</span> + <span class="c1"># extra information is better than just "on"</span> + <span class="k">if</span> <span class="n">param_name</span> <span class="ow">in</span> <span class="n">macros_dict</span><span class="p">:</span> + <span class="c1"># print("already exists (is ",macros_dict[param_name]," float? ",isfloat(macros_dict[param_name]),", int? ",isint(macros_dict[param_name]),") : check that we can improve it")</span> + <span class="k">if</span> <span class="n">macros_dict</span><span class="p">[</span><span class="n">param_name</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"on"</span><span class="p">:</span> + <span class="c1"># update with better value</span> + <span class="n">store</span> <span class="o">=</span> <span class="kc">True</span> + <span class="k">elif</span> <span class="p">(</span> + <span class="n">isfloat</span><span class="p">(</span><span class="n">macros_dict</span><span class="p">[</span><span class="n">param_name</span><span class="p">])</span> <span class="ow">is</span> <span class="kc">False</span> + <span class="ow">and</span> <span class="n">isfloat</span><span class="p">(</span><span class="n">param_value</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">True</span> + <span class="p">):</span> + <span class="c1"># store the number we now have to replace the non-number we had</span> + <span class="n">store</span> <span class="o">=</span> <span class="kc">True</span> + <span class="k">else</span><span class="p">:</span> + <span class="c1"># don't override existing number</span> + <span class="n">store</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="c1"># if store:</span> + <span class="c1"># print("Found improved macro value of param",param_name,", was ",macros_dict[param_name],", is",param_value)</span> + <span class="c1"># else:</span> + <span class="c1"># print("Cannot improve: use old value")</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">store</span> <span class="o">=</span> <span class="kc">True</span> + + <span class="k">if</span> <span class="n">store</span><span class="p">:</span> + <span class="c1"># Sometimes the macros have extra information behind it.</span> + <span class="c1"># Needs an update in outputting by binary_c (RGI: what does this mean David???)</span> + <span class="k">try</span><span class="p">:</span> + <span class="n">macros_dict</span><span class="p">[</span><span class="n">param_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">param_type_dict</span><span class="p">[</span><span class="n">param_type</span><span class="p">](</span><span class="n">param_value</span><span class="p">)</span> + <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> + <span class="n">macros_dict</span><span class="p">[</span><span class="n">param_name</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">param_value</span><span class="p">)</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"macros"</span><span class="p">]</span> <span class="o">=</span> <span class="n">macros_dict</span> <span class="k">if</span> <span class="n">macros_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##########################</span> + <span class="c1"># Elements:</span> + <span class="c1"># Split off:</span> + <span class="n">elements</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Element"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">elements</span> + + <span class="c1"># Fill dict:</span> + <span class="n">elements_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">elements</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Element "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" : "</span><span class="p">)</span> + <span class="n">name_info</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + + <span class="c1"># get isotope info</span> + <span class="n">isotopes</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">if</span> <span class="ow">not</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"0"</span><span class="p">:</span> + <span class="n">isotope_string</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" = "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + <span class="n">isotopes</span> <span class="o">=</span> <span class="p">{</span> + <span class="nb">int</span><span class="p">(</span><span class="n">split_isotope</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="mi">0</span><span class="p">]):</span> <span class="n">split_isotope</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span> + <span class="k">for</span> <span class="n">split_isotope</span> <span class="ow">in</span> <span class="n">isotope_string</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" "</span><span class="p">)</span> + <span class="p">}</span> + + <span class="n">elements_dict</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">name_info</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"name"</span><span class="p">:</span> <span class="n">name_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> + <span class="s2">"atomic_number"</span><span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="n">name_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> + <span class="s2">"amt_isotopes"</span><span class="p">:</span> <span class="nb">len</span><span class="p">(</span><span class="n">isotopes</span><span class="p">),</span> + <span class="s2">"isotopes"</span><span class="p">:</span> <span class="n">isotopes</span><span class="p">,</span> + <span class="p">}</span> + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"elements"</span><span class="p">]</span> <span class="o">=</span> <span class="n">elements_dict</span> <span class="k">if</span> <span class="n">elements_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##########################</span> + <span class="c1"># dt_limits:</span> + <span class="c1"># split off</span> + <span class="n">dt_limits</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"DTlimit"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">dt_limits</span> + + <span class="c1"># Fill dict</span> + <span class="n">dt_limits_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">dt_limits</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"DTlimit "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" : "</span><span class="p">)</span> + <span class="n">dt_limits_dict</span><span class="p">[</span><span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()]</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"index"</span><span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> + <span class="s2">"value"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]),</span> + <span class="p">}</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"dt_limits"</span><span class="p">]</span> <span class="o">=</span> <span class="n">dt_limits_dict</span> <span class="k">if</span> <span class="n">dt_limits_dict</span> <span class="k">else</span> <span class="kc">None</span> + + <span class="c1">##############################</span> + <span class="c1"># Units</span> + + <span class="n">units</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Unit "</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">units</span> + <span class="n">units_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">units</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Unit "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)</span> + <span class="n">s</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span> + <span class="n">long</span><span class="p">,</span> <span class="n">short</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">'"'</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">s</span><span class="p">]</span> + <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> + <span class="n">long</span><span class="p">,</span> <span class="n">short</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Warning: Failed to split unit string </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">el</span><span class="p">))</span> + + <span class="n">to_cgs</span> <span class="o">=</span> <span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">())[</span><span class="mi">3</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">'"'</span><span class="p">)</span> + <span class="n">code_units</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span> + <span class="n">code_unit_type_num</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">code_units</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">'"'</span><span class="p">))</span> + <span class="n">code_unit_type</span> <span class="o">=</span> <span class="n">code_units</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">'"'</span><span class="p">)</span> + <span class="n">code_unit_cgs_value</span> <span class="o">=</span> <span class="n">code_units</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">'"'</span><span class="p">)</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">")"</span><span class="p">)</span> + <span class="n">units_dict</span><span class="p">[</span><span class="n">long</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> + <span class="s2">"long"</span><span class="p">:</span> <span class="n">long</span><span class="p">,</span> + <span class="s2">"short"</span><span class="p">:</span> <span class="n">short</span><span class="p">,</span> + <span class="s2">"to_cgs"</span><span class="p">:</span> <span class="n">to_cgs</span><span class="p">,</span> + <span class="s2">"code_unit_type_num"</span><span class="p">:</span> <span class="n">code_unit_type_num</span><span class="p">,</span> + <span class="s2">"code_unit_type"</span><span class="p">:</span> <span class="n">code_unit_type</span><span class="p">,</span> + <span class="s2">"code_unit_cgs_value"</span><span class="p">:</span> <span class="n">code_unit_cgs_value</span><span class="p">,</span> + <span class="p">}</span> + + <span class="c1"># Add the list of units</span> + <span class="n">units</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Units: "</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">units</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">units</span><span class="p">:</span> + <span class="n">el</span> <span class="o">=</span> <span class="n">el</span><span class="p">[</span><span class="mi">7</span><span class="p">:]</span> <span class="c1"># removes "Units: "</span> + <span class="n">units_dict</span><span class="p">[</span><span class="s2">"units list"</span><span class="p">]</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">"Units:"</span><span class="p">)</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"units"</span><span class="p">]</span> <span class="o">=</span> <span class="n">units_dict</span> + + <span class="c1">##########################</span> + <span class="c1"># Nucleosynthesis sources:</span> + <span class="c1"># Split off</span> + <span class="n">nucsyn_sources</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Nucleosynthesis"</span><span class="p">)}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">nucsyn_sources</span> + + <span class="c1"># Fill dict</span> + <span class="n">nucsyn_sources_dict</span> <span class="o">=</span> <span class="p">{}</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">nucsyn_sources</span><span class="p">:</span> + <span class="n">split_info</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Nucleosynthesis source"</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + <span class="n">nucsyn_sources_dict</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">split_info</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span> <span class="o">=</span> <span class="n">split_info</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"nucleosynthesis_sources"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">nucsyn_sources_dict</span> <span class="k">if</span> <span class="n">nucsyn_sources_dict</span> <span class="k">else</span> <span class="kc">None</span> + <span class="p">)</span> + + <span class="c1">##########################</span> + <span class="c1"># miscellaneous:</span> + <span class="c1"># All those that I didn't catch with the above filters. Could try to get some more out though.</span> + + <span class="n">misc_dict</span> <span class="o">=</span> <span class="p">{}</span> + + <span class="c1"># Filter out git revision</span> + <span class="n">git_revision</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"git revision"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"git_revision"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">git_revision</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"git revision "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'"'</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">git_revision</span><span class="p">)</span> + + <span class="c1"># filter out git url</span> + <span class="n">git_url</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"git URL"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"git_url"</span><span class="p">]</span> <span class="o">=</span> <span class="n">git_url</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"git URL "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'"'</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">git_url</span><span class="p">)</span> + + <span class="c1"># filter out version</span> + <span class="n">version</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Version"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">version</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Version "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">version</span><span class="p">)</span> + + <span class="n">git_branch</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"git branch"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"git_branch"</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> + <span class="n">git_branch</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"git branch "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'"'</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="p">)</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">git_branch</span><span class="p">)</span> + + <span class="n">build</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Build"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"build"</span><span class="p">]</span> <span class="o">=</span> <span class="n">build</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Build: "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'"'</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">build</span><span class="p">)</span> + + <span class="n">email</span> <span class="o">=</span> <span class="p">[</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="n">el</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"Email"</span><span class="p">)]</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"email"</span><span class="p">]</span> <span class="o">=</span> <span class="n">email</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"Email "</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="nb">set</span><span class="p">(</span><span class="n">email</span><span class="p">)</span> + + <span class="n">other_items</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">cleaned</span> <span class="k">if</span> <span class="s2">" is "</span> <span class="ow">in</span> <span class="n">el</span><span class="p">}</span> + <span class="n">cleaned</span> <span class="o">-=</span> <span class="n">other_items</span> + + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">other_items</span><span class="p">:</span> + <span class="n">split</span> <span class="o">=</span> <span class="n">el</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">" is "</span><span class="p">)</span> + <span class="n">key</span> <span class="o">=</span> <span class="n">split</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="n">val</span> <span class="o">=</span> <span class="s2">" is "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">split</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> + <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">misc_dict</span><span class="p">:</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="n">key</span> <span class="o">+</span> <span class="s2">" (alt)"</span><span class="p">]</span> <span class="o">=</span> <span class="n">val</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">misc_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">val</span> + + <span class="n">misc_dict</span><span class="p">[</span><span class="s2">"uncaught"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">cleaned</span><span class="p">)</span> + + <span class="n">version_info_dict</span><span class="p">[</span><span class="s2">"miscellaneous"</span><span class="p">]</span> <span class="o">=</span> <span class="n">misc_dict</span> <span class="k">if</span> <span class="n">misc_dict</span> <span class="k">else</span> <span class="kc">None</span> + <span class="k">return</span> <span class="n">version_info_dict</span></div> + +<div class="viewcode-block" id="version_info.minimum_stellar_mass"><a class="viewcode-back" href="../../../../population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.minimum_stellar_mass">[docs]</a> <span class="k">def</span> <span class="nf">minimum_stellar_mass</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Function to return the minimum stellar mass (in Msun) from binary_c.</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_minimum_stellar_mass</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_minimum_stellar_mass</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">return_binary_c_version_info</span><span class="p">(</span><span class="n">parsed</span><span class="o">=</span><span class="kc">True</span><span class="p">)[</span> + <span class="s2">"macros"</span> + <span class="p">][</span><span class="s2">"BINARY_C_MINIMUM_STELLAR_MASS"</span><span class="p">]</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_minimum_stellar_mass</span></div></div> +</pre></div> + + </div> + </div> + <footer> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html b/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html index 557e874fdb09eed95b28d81e36153e66d03eec3e..9350a80585276b358278d6b4153df3213a8f55c7 100644 --- a/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html +++ b/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.run_system_wrapper — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.run_system_wrapper</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.run_system_wrapper</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Module containing the utility function run_system,</span> @@ -273,48 +191,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/binarycpython/utils/useful_funcs.html b/docs/build/html/_modules/binarycpython/utils/useful_funcs.html index a3bfb7399558d51ed2662e293e259f08e91f4c9c..736c680b65897c85e802fc97aec843a847a09d41 100644 --- a/docs/build/html/_modules/binarycpython/utils/useful_funcs.html +++ b/docs/build/html/_modules/binarycpython/utils/useful_funcs.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>binarycpython.utils.useful_funcs — binary_c-python documentation</title> + <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> <script src="../../../_static/jquery.js"></script> <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> + <script src="../../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../../index.html">Docs</a> »</li> - + <li><a href="../../../index.html" class="icon icon-home"></a> »</li> <li><a href="../../index.html">Module code</a> »</li> - <li>binarycpython.utils.useful_funcs</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Source code for binarycpython.utils.useful_funcs</h1><div class="highlight"><pre> <span></span><span class="sd">"""</span> <span class="sd">Collection of useful functions.</span> @@ -164,7 +82,7 @@ <span class="sd"> - rzams(m, z) gives you the ZAMS radius of a star</span> <span class="sd"> - ZAMS_collision(m1, m2, e, sep, z) returns 1 if stars collide on the ZAMS</span> <span class="sd"> - roche_lobe(q): returns roche lobe radius in units of separation</span> -<span class="sd"> - ragb(m, z): radius at first thermal pulse</span> +<span class="sd"> - ragb(m): radius at first thermal pulse</span> <span class="sd"> - minimum_period_for_RLOF(M1, M2, metallicity, store_memaddr=-1): function to calculate the minimum period that leads to RLOF on ZAMS</span> <span class="sd"> - minimum_separation_for_RLOF(M1, M2, metallicity, store_memaddr=-1): function to calculate the minimum period that leads to RLOF on ZAMS</span> <span class="sd"> - maximum_mass_ratio_for_RLOF(M1, orbital_period, store_memaddr=None): Function to calculate the maximum mass ratio that leads to RLOF on ZAMS</span> @@ -539,48 +457,36 @@ </pre></div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html index cf98d3543337023bdc02c768ab07725741904d4d..ac162e48f0179b98d20c56d2b1194d4a315fad09 100644 --- a/docs/build/html/_modules/index.html +++ b/docs/build/html/_modules/index.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Overview: module code — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -92,116 +46,83 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li>Overview: module code</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>All modules for which code is available</h1> <ul><li><a href="binarycpython/utils/custom_logging_functions.html">binarycpython.utils.custom_logging_functions</a></li> +<li><a href="binarycpython/utils/dicts.html">binarycpython.utils.dicts</a></li> +<li><a href="binarycpython/utils/ensemble.html">binarycpython.utils.ensemble</a></li> <li><a href="binarycpython/utils/functions.html">binarycpython.utils.functions</a></li> <li><a href="binarycpython/utils/grid.html">binarycpython.utils.grid</a></li> <li><a href="binarycpython/utils/plot_functions.html">binarycpython.utils.plot_functions</a></li> +<li><a href="binarycpython/utils/population_extensions/HPC.html">binarycpython.utils.population_extensions.HPC</a></li> +<li><a href="binarycpython/utils/population_extensions/analytics.html">binarycpython.utils.population_extensions.analytics</a></li> +<li><a href="binarycpython/utils/population_extensions/cache.html">binarycpython.utils.population_extensions.cache</a></li> +<li><a href="binarycpython/utils/population_extensions/condor.html">binarycpython.utils.population_extensions.condor</a></li> +<li><a href="binarycpython/utils/population_extensions/dataIO.html">binarycpython.utils.population_extensions.dataIO</a></li> +<li><a href="binarycpython/utils/population_extensions/distribution_functions.html">binarycpython.utils.population_extensions.distribution_functions</a></li> +<li><a href="binarycpython/utils/population_extensions/grid_options_defaults.html">binarycpython.utils.population_extensions.grid_options_defaults</a></li> +<li><a href="binarycpython/utils/population_extensions/gridcode.html">binarycpython.utils.population_extensions.gridcode</a></li> +<li><a href="binarycpython/utils/population_extensions/metadata.html">binarycpython.utils.population_extensions.metadata</a></li> +<li><a href="binarycpython/utils/population_extensions/slurm.html">binarycpython.utils.population_extensions.slurm</a></li> +<li><a href="binarycpython/utils/population_extensions/spacing_functions.html">binarycpython.utils.population_extensions.spacing_functions</a></li> +<li><a href="binarycpython/utils/population_extensions/version_info.html">binarycpython.utils.population_extensions.version_info</a></li> <li><a href="binarycpython/utils/run_system_wrapper.html">binarycpython.utils.run_system_wrapper</a></li> <li><a href="binarycpython/utils/useful_funcs.html">binarycpython.utils.useful_funcs</a></li> </ul> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/_sources/dicts.rst.txt b/docs/build/html/_sources/dicts.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..baa02e9c2782c321147934a3738676002977a908 --- /dev/null +++ b/docs/build/html/_sources/dicts.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.dicts + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/distribution_functions.rst.txt b/docs/build/html/_sources/distribution_functions.rst.txt deleted file mode 100644 index 5881ee38299d5af76771ac7312abd140886f99d1..0000000000000000000000000000000000000000 --- a/docs/build/html/_sources/distribution_functions.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -distribution_functions module -================================= - -.. automodule:: binarycpython.utils.distribution_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/build/html/_sources/ensemble.rst.txt b/docs/build/html/_sources/ensemble.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..00c573086e74b84a1bac5ddf1afb07c7545853c5 --- /dev/null +++ b/docs/build/html/_sources/ensemble.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.ensemble + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/grid_options_defaults.rst.txt b/docs/build/html/_sources/grid_options_defaults.rst.txt deleted file mode 100644 index c66555ac9989dff3ad956f893683dc34c4dc4c46..0000000000000000000000000000000000000000 --- a/docs/build/html/_sources/grid_options_defaults.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -Grid options and descriptions -============================= - -.. automodule:: binarycpython.utils.grid_options_defaults - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/build/html/_sources/hpc_functions.rst.txt b/docs/build/html/_sources/hpc_functions.rst.txt deleted file mode 100644 index d336a0be090ee3eac23c4342286fe8895e0aea6f..0000000000000000000000000000000000000000 --- a/docs/build/html/_sources/hpc_functions.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -hpc\_functions module -================================= - -.. automodule:: binarycpython.utils.hpc_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/build/html/_sources/modules.rst.txt b/docs/build/html/_sources/modules.rst.txt index d4aaac5025cbb089f2754ed01ef8bd92f70bf81c..ce6f94e48b1de9e38dc33e8c6dceb7b468c3934f 100644 --- a/docs/build/html/_sources/modules.rst.txt +++ b/docs/build/html/_sources/modules.rst.txt @@ -6,13 +6,25 @@ This chapter contains the (auto)documentation for all the functions and modules :maxdepth: 4 custom_logging_functions - distribution_functions + dicts + ensemble functions grid - grid_options_defaults - hpc_functions plot_functions + population_extensions/analytics + population_extensions/cache + population_extensions/condor + population_extensions/dataIO + population_extensions/distribution_functions + population_extensions/gridcode + population_extensions/grid_logging + population_extensions/grid_options_defaults + population_extensions/HPC + population_extensions/metadata + population_extensions/Moe_di_Stefano_2017 + population_extensions/slurm + population_extensions/spacing_functions + population_extensions/version_info run_system_wrapper - spacing_functions stellar_types - useful_funcs \ No newline at end of file + useful_funcs diff --git a/docs/build/html/_sources/population_extensions/HPC.rst.txt b/docs/build/html/_sources/population_extensions/HPC.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..d8e791e19810997bff2a67a6a646ad047b8c71a9 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/HPC.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.HPC + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/analytics.rst.txt b/docs/build/html/_sources/population_extensions/analytics.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..cb2de4881075b53f8140b5fe3eeacd3105acf74e --- /dev/null +++ b/docs/build/html/_sources/population_extensions/analytics.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.analytics + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/cache.rst.txt b/docs/build/html/_sources/population_extensions/cache.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..68c73899ab34cc8ea8d28d830ccfc5ab9efbc5d2 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/cache.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.cache + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/condor.rst.txt b/docs/build/html/_sources/population_extensions/condor.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..f29b807109a0f67c101771af867998514b3762a0 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/condor.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.condor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/dataIO.rst.txt b/docs/build/html/_sources/population_extensions/dataIO.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..420598310f0f885850525702766be2ebd29a936f --- /dev/null +++ b/docs/build/html/_sources/population_extensions/dataIO.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.dataIO + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/distribution_functions.rst.txt b/docs/build/html/_sources/population_extensions/distribution_functions.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..30bed60948cdf4caf648ff46506e6c1f0074f77b --- /dev/null +++ b/docs/build/html/_sources/population_extensions/distribution_functions.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.distribution_functions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/grid_options_defaults.rst.txt b/docs/build/html/_sources/population_extensions/grid_options_defaults.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..d833ab268a26bcf0fb18687e162eed4b5e132907 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/grid_options_defaults.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.grid_options_defaults + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/gridcode.rst.txt b/docs/build/html/_sources/population_extensions/gridcode.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..66a99558b9e27b2693fa109e8d8746bd4127ff6f --- /dev/null +++ b/docs/build/html/_sources/population_extensions/gridcode.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.gridcode + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/metadata.rst.txt b/docs/build/html/_sources/population_extensions/metadata.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..399fb229d33b16f8eed0753a6132210baaf97e18 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/metadata.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.metadata + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/slurm.rst.txt b/docs/build/html/_sources/population_extensions/slurm.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d5c73e2643e398371434165be6daa2f413f907e --- /dev/null +++ b/docs/build/html/_sources/population_extensions/slurm.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.slurm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/spacing_functions.rst.txt b/docs/build/html/_sources/population_extensions/spacing_functions.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..a3a3cb44ab5022261c91e9232f01452a6352d479 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/spacing_functions.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.spacing_functions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/population_extensions/version_info.rst.txt b/docs/build/html/_sources/population_extensions/version_info.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..4193c1fe16eb7fed614f1bc4d0236507e5706d76 --- /dev/null +++ b/docs/build/html/_sources/population_extensions/version_info.rst.txt @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.version_info + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/build/html/_sources/spacing_functions.rst.txt b/docs/build/html/_sources/spacing_functions.rst.txt deleted file mode 100644 index be0cf254dd52aafbde7404c588be65abcc46493e..0000000000000000000000000000000000000000 --- a/docs/build/html/_sources/spacing_functions.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -spacing\_functions module -================================= - -.. automodule:: binarycpython.utils.spacing_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css index 912859b55d96750bff001bb79037a83a6c02332c..603f6a8798e7f7b07f32dfd1e0ad785b85bc7010 100644 --- a/docs/build/html/_static/basic.css +++ b/docs/build/html/_static/basic.css @@ -731,8 +731,9 @@ dl.glossary dt { .classifier:before { font-style: normal; - margin: 0.5em; + margin: 0 0.5em; content: ":"; + display: inline-block; } abbr, acronym { diff --git a/docs/build/html/_static/css/badge_only.css b/docs/build/html/_static/css/badge_only.css index 3c33cef5450e1a6e12a4e33928cf2bdcdc4db2e0..e380325bc6e273d9142c2369883d2a4b2a069cf1 100644 --- a/docs/build/html/_static/css/badge_only.css +++ b/docs/build/html/_static/css/badge_only.css @@ -1 +1 @@ -.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:"ï€"}.icon-book:before{content:"ï€"}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} +.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff b/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff similarity index 100% rename from docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff rename to docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 b/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 similarity index 100% rename from docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 rename to docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff b/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff similarity index 100% rename from docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff rename to docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 b/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 similarity index 100% rename from docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 rename to docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.eot b/docs/build/html/_static/css/fonts/fontawesome-webfont.eot similarity index 100% rename from docs/build/html/_static/fonts/fontawesome-webfont.eot rename to docs/build/html/_static/css/fonts/fontawesome-webfont.eot diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.svg b/docs/build/html/_static/css/fonts/fontawesome-webfont.svg similarity index 100% rename from docs/build/html/_static/fonts/fontawesome-webfont.svg rename to docs/build/html/_static/css/fonts/fontawesome-webfont.svg diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.ttf b/docs/build/html/_static/css/fonts/fontawesome-webfont.ttf similarity index 100% rename from docs/build/html/_static/fonts/fontawesome-webfont.ttf rename to docs/build/html/_static/css/fonts/fontawesome-webfont.ttf diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff b/docs/build/html/_static/css/fonts/fontawesome-webfont.woff similarity index 100% rename from docs/build/html/_static/fonts/fontawesome-webfont.woff rename to docs/build/html/_static/css/fonts/fontawesome-webfont.woff diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff2 b/docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 similarity index 100% rename from docs/build/html/_static/fonts/fontawesome-webfont.woff2 rename to docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff b/docs/build/html/_static/css/fonts/lato-bold-italic.woff similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-bolditalic.woff rename to docs/build/html/_static/css/fonts/lato-bold-italic.woff diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 b/docs/build/html/_static/css/fonts/lato-bold-italic.woff2 similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 rename to docs/build/html/_static/css/fonts/lato-bold-italic.woff2 diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff b/docs/build/html/_static/css/fonts/lato-bold.woff similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-bold.woff rename to docs/build/html/_static/css/fonts/lato-bold.woff diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff2 b/docs/build/html/_static/css/fonts/lato-bold.woff2 similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-bold.woff2 rename to docs/build/html/_static/css/fonts/lato-bold.woff2 diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff b/docs/build/html/_static/css/fonts/lato-normal-italic.woff similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-italic.woff rename to docs/build/html/_static/css/fonts/lato-normal-italic.woff diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff2 b/docs/build/html/_static/css/fonts/lato-normal-italic.woff2 similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-italic.woff2 rename to docs/build/html/_static/css/fonts/lato-normal-italic.woff2 diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff b/docs/build/html/_static/css/fonts/lato-normal.woff similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-regular.woff rename to docs/build/html/_static/css/fonts/lato-normal.woff diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff2 b/docs/build/html/_static/css/fonts/lato-normal.woff2 similarity index 100% rename from docs/build/html/_static/fonts/Lato/lato-regular.woff2 rename to docs/build/html/_static/css/fonts/lato-normal.woff2 diff --git a/docs/build/html/_static/css/theme.css b/docs/build/html/_static/css/theme.css index aed8cef0668288648615f650e93e648e00e8c4d0..0d9ae7e1a45b82198c53548383a570d924993371 100644 --- a/docs/build/html/_static/css/theme.css +++ b/docs/build/html/_static/css/theme.css @@ -1,6 +1,4 @@ -/* sphinx_rtd_theme version 0.4.3 | MIT license */ -/* Built 20190212 16:02 */ -*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:.5cm}p,h2,.rst-content .toctree-wrapper p.caption,h3{orphans:3;widows:3}h2,.rst-content .toctree-wrapper p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*! +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,.wy-nav-top a,.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.7.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2"),url("../fonts/fontawesome-webfont.woff?v=4.7.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.7.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.wy-menu-vertical li span.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-left.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-left.toctree-expand,.rst-content .fa-pull-left.admonition-title,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content dl dt .fa-pull-left.headerlink,.rst-content p.caption .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.rst-content code.download span.fa-pull-left:first-child,.fa-pull-left.icon{margin-right:.3em}.fa.fa-pull-right,.wy-menu-vertical li span.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-right.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-right.toctree-expand,.rst-content .fa-pull-right.admonition-title,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content dl dt .fa-pull-right.headerlink,.rst-content p.caption .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.rst-content code.download span.fa-pull-right:first-child,.fa-pull-right.icon{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content .code-block-caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content .code-block-caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:"ï€"}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:"ï€"}.fa-search-plus:before{content:""}.fa-search-minus:before{content:"ï€"}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:"ï€"}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:"ï€"}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:"ï€"}.fa-map-marker:before{content:"ï"}.fa-adjust:before{content:"ï‚"}.fa-tint:before{content:"ïƒ"}.fa-edit:before,.fa-pencil-square-o:before{content:"ï„"}.fa-share-square-o:before{content:"ï…"}.fa-check-square-o:before{content:"ï†"}.fa-arrows:before{content:"ï‡"}.fa-step-backward:before{content:"ïˆ"}.fa-fast-backward:before{content:"ï‰"}.fa-backward:before{content:"ïŠ"}.fa-play:before{content:"ï‹"}.fa-pause:before{content:"ïŒ"}.fa-stop:before{content:"ï"}.fa-forward:before{content:"ïŽ"}.fa-fast-forward:before{content:"ï"}.fa-step-forward:before{content:"ï‘"}.fa-eject:before{content:"ï’"}.fa-chevron-left:before{content:"ï“"}.fa-chevron-right:before{content:"ï”"}.fa-plus-circle:before{content:"ï•"}.fa-minus-circle:before{content:"ï–"}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:"ï—"}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:"ï˜"}.fa-question-circle:before{content:"ï™"}.fa-info-circle:before{content:"ïš"}.fa-crosshairs:before{content:"ï›"}.fa-times-circle-o:before{content:"ïœ"}.fa-check-circle-o:before{content:"ï"}.fa-ban:before{content:"ïž"}.fa-arrow-left:before{content:"ï "}.fa-arrow-right:before{content:"ï¡"}.fa-arrow-up:before{content:"ï¢"}.fa-arrow-down:before{content:"ï£"}.fa-mail-forward:before,.fa-share:before{content:"ï¤"}.fa-expand:before{content:"ï¥"}.fa-compress:before{content:"ï¦"}.fa-plus:before{content:"ï§"}.fa-minus:before{content:"ï¨"}.fa-asterisk:before{content:"ï©"}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:"ïª"}.fa-gift:before{content:"ï«"}.fa-leaf:before{content:"ï¬"}.fa-fire:before,.icon-fire:before{content:"ï"}.fa-eye:before{content:"ï®"}.fa-eye-slash:before{content:"ï°"}.fa-warning:before,.fa-exclamation-triangle:before{content:"ï±"}.fa-plane:before{content:"ï²"}.fa-calendar:before{content:"ï³"}.fa-random:before{content:"ï´"}.fa-comment:before{content:"ïµ"}.fa-magnet:before{content:"ï¶"}.fa-chevron-up:before{content:"ï·"}.fa-chevron-down:before{content:"ï¸"}.fa-retweet:before{content:"ï¹"}.fa-shopping-cart:before{content:"ïº"}.fa-folder:before{content:"ï»"}.fa-folder-open:before{content:"ï¼"}.fa-arrows-v:before{content:"ï½"}.fa-arrows-h:before{content:"ï¾"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"ï‚€"}.fa-twitter-square:before{content:"ï‚"}.fa-facebook-square:before{content:"ï‚‚"}.fa-camera-retro:before{content:""}.fa-key:before{content:"ï‚„"}.fa-gears:before,.fa-cogs:before{content:"ï‚…"}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:"ï‚‹"}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:"ï‚"}.fa-external-link:before{content:""}.fa-sign-in:before{content:"ï‚"}.fa-trophy:before{content:"ï‚‘"}.fa-github-square:before{content:"ï‚’"}.fa-upload:before{content:"ï‚“"}.fa-lemon-o:before{content:"ï‚”"}.fa-phone:before{content:"ï‚•"}.fa-square-o:before{content:"ï‚–"}.fa-bookmark-o:before{content:"ï‚—"}.fa-phone-square:before{content:""}.fa-twitter:before{content:"ï‚™"}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:"ï‚›"}.fa-unlock:before{content:""}.fa-credit-card:before{content:"ï‚"}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:"ï‚ "}.fa-bullhorn:before{content:"ï‚¡"}.fa-bell:before{content:""}.fa-certificate:before{content:"ï‚£"}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:"ï‚¥"}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:"ï‚§"}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:"ï‚©"}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:"ï‚«"}.fa-globe:before{content:""}.fa-wrench:before{content:"ï‚"}.fa-tasks:before{content:"ï‚®"}.fa-filter:before{content:"ï‚°"}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:"ïƒ"}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:"ïƒ"}.fa-table:before{content:""}.fa-magic:before{content:"ïƒ"}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:"ïƒ"}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:"ïƒ "}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:"ïƒ"}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:"ï‚¢"}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:"ï„€"}.fa-angle-double-right:before{content:"ï„"}.fa-angle-double-up:before{content:"ï„‚"}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:"ï„„"}.fa-angle-right:before{content:"ï„…"}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:"ï„‹"}.fa-circle-o:before{content:""}.fa-quote-left:before{content:"ï„"}.fa-quote-right:before{content:""}.fa-spinner:before{content:"ï„"}.fa-circle:before{content:"ï„‘"}.fa-mail-reply:before,.fa-reply:before{content:"ï„’"}.fa-github-alt:before{content:"ï„“"}.fa-folder-o:before{content:"ï„”"}.fa-folder-open-o:before{content:"ï„•"}.fa-smile-o:before{content:""}.fa-frown-o:before{content:"ï„™"}.fa-meh-o:before{content:""}.fa-gamepad:before{content:"ï„›"}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:"ï„"}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:"ï„ "}.fa-code:before{content:"ï„¡"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"ï„¢"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"ï„£"}.fa-location-arrow:before{content:""}.fa-crop:before{content:"ï„¥"}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:"ï„§"}.fa-question:before{content:""}.fa-info:before{content:"ï„©"}.fa-exclamation:before{content:""}.fa-superscript:before{content:"ï„«"}.fa-subscript:before{content:""}.fa-eraser:before{content:"ï„"}.fa-puzzle-piece:before{content:"ï„®"}.fa-microphone:before{content:"ï„°"}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:"ï„´"}.fa-rocket:before{content:""}.fa-maxcdn:before{content:"ï„¶"}.fa-chevron-circle-left:before{content:"ï„·"}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:"ï„»"}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:"ï…€"}.fa-ellipsis-h:before{content:"ï…"}.fa-ellipsis-v:before{content:"ï…‚"}.fa-rss-square:before{content:"ï…ƒ"}.fa-play-circle:before{content:"ï…„"}.fa-ticket:before{content:"ï……"}.fa-minus-square:before{content:"ï…†"}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:"ï…‡"}.fa-level-up:before{content:"ï…ˆ"}.fa-level-down:before{content:"ï…‰"}.fa-check-square:before{content:"ï…Š"}.fa-pencil-square:before{content:"ï…‹"}.fa-external-link-square:before{content:"ï…Œ"}.fa-share-square:before{content:"ï…"}.fa-compass:before{content:"ï…Ž"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"ï…"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"ï…‘"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"ï…’"}.fa-euro:before,.fa-eur:before{content:"ï…“"}.fa-gbp:before{content:"ï…”"}.fa-dollar:before,.fa-usd:before{content:"ï…•"}.fa-rupee:before,.fa-inr:before{content:"ï…–"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"ï…—"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"ï…˜"}.fa-won:before,.fa-krw:before{content:"ï…™"}.fa-bitcoin:before,.fa-btc:before{content:"ï…š"}.fa-file:before{content:"ï…›"}.fa-file-text:before{content:"ï…œ"}.fa-sort-alpha-asc:before{content:"ï…"}.fa-sort-alpha-desc:before{content:"ï…ž"}.fa-sort-amount-asc:before{content:"ï… "}.fa-sort-amount-desc:before{content:"ï…¡"}.fa-sort-numeric-asc:before{content:"ï…¢"}.fa-sort-numeric-desc:before{content:"ï…£"}.fa-thumbs-up:before{content:"ï…¤"}.fa-thumbs-down:before{content:"ï…¥"}.fa-youtube-square:before{content:"ï…¦"}.fa-youtube:before{content:"ï…§"}.fa-xing:before{content:"ï…¨"}.fa-xing-square:before{content:"ï…©"}.fa-youtube-play:before{content:"ï…ª"}.fa-dropbox:before{content:"ï…«"}.fa-stack-overflow:before{content:"ï…¬"}.fa-instagram:before{content:"ï…"}.fa-flickr:before{content:"ï…®"}.fa-adn:before{content:"ï…°"}.fa-bitbucket:before,.icon-bitbucket:before{content:"ï…±"}.fa-bitbucket-square:before{content:"ï…²"}.fa-tumblr:before{content:"ï…³"}.fa-tumblr-square:before{content:"ï…´"}.fa-long-arrow-down:before{content:"ï…µ"}.fa-long-arrow-up:before{content:"ï…¶"}.fa-long-arrow-left:before{content:"ï…·"}.fa-long-arrow-right:before{content:"ï…¸"}.fa-apple:before{content:"ï…¹"}.fa-windows:before{content:"ï…º"}.fa-android:before{content:"ï…»"}.fa-linux:before{content:"ï…¼"}.fa-dribbble:before{content:"ï…½"}.fa-skype:before{content:"ï…¾"}.fa-foursquare:before{content:""}.fa-trello:before{content:"ï†"}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:"ï†"}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:"ï†"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:"ï†"}.fa-yahoo:before{content:""}.fa-google:before{content:"ï† "}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:"ï†"}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:"ï‡"}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"ï‡"}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"ï‡"}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:"ï‡"}.fa-sliders:before{content:""}.fa-share-alt:before{content:"ï‡ "}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:"ï‡"}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:"ïˆ"}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:"ïˆ"}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:"ïˆ"}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:"ïˆ"}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:"ïˆ"}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-hotel:before,.fa-bed:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-yc:before,.fa-y-combinator:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"ï‰"}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:"ï‰"}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:"ï‰"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:"ï‰"}.fa-creative-commons:before{content:""}.fa-gg:before{content:"ï‰ "}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-tv:before,.fa-television:before{content:""}.fa-contao:before{content:"ï‰"}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:"ïŠ"}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:"ïŠ"}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:"ïŠ"}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:"ïŠ"}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:"ïŠ "}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:""}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-signing:before,.fa-sign-language:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:"ïŠ"}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-vcard:before,.fa-address-card:before{content:""}.fa-vcard-o:before,.fa-address-card-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:"ï‹€"}.fa-id-badge:before{content:"ï‹"}.fa-drivers-license:before,.fa-id-card:before{content:"ï‹‚"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:"ï‹„"}.fa-free-code-camp:before{content:"ï‹…"}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"ï‹‹"}.fa-shower:before{content:""}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"ï‹"}.fa-podcast:before{content:""}.fa-window-maximize:before{content:"ï‹"}.fa-window-minimize:before{content:"ï‹‘"}.fa-window-restore:before{content:"ï‹’"}.fa-times-rectangle:before,.fa-window-close:before{content:"ï‹“"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"ï‹”"}.fa-bandcamp:before{content:"ï‹•"}.fa-grav:before{content:"ï‹–"}.fa-etsy:before{content:"ï‹—"}.fa-imdb:before{content:""}.fa-ravelry:before{content:"ï‹™"}.fa-eercast:before{content:""}.fa-microchip:before{content:"ï‹›"}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:"ï‹"}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:"ï‹ "}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content table>caption .headerlink,.rst-content table>caption a .headerlink,a .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content table>caption .headerlink,.rst-content table>caption .btn .headerlink,.btn .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content table>caption .headerlink,.rst-content table>caption .nav .headerlink,.nav .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.btn .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.nav .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.btn .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.nav .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.admonition{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo,.rst-content .wy-alert-warning.admonition{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title,.rst-content .wy-alert-warning.admonition .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.admonition{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.admonition{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.admonition{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 .3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.3576515979%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.3576515979%;width:48.821174201%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.3576515979%;width:31.7615656014%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type="datetime-local"]{padding:.34375em .625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{position:absolute;content:"";display:block;left:0;top:0;width:36px;height:12px;border-radius:4px;background:#ccc;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27AE60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:.3em;display:block}.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content .toctree-wrapper p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content .toctree-wrapper p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:before,.wy-breadcrumbs:after{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs li code,.wy-breadcrumbs li .rst-content tt,.rst-content .wy-breadcrumbs li tt{padding:5px;border:none;background:none}.wy-breadcrumbs li code.literal,.wy-breadcrumbs li .rst-content tt.literal,.rst-content .wy-breadcrumbs li tt.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#3a7ca8;height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin:12px 0 0 0;display:block;font-weight:bold;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a{color:#404040}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980B9;text-align:center;padding:.809em;display:block;color:#fcfcfc;margin-bottom:.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:normal;color:rgba(255,255,255,0.3)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:gray}footer p{margin-bottom:12px}footer span.commit code,footer span.commit .rst-content tt,.rst-content footer span.commit tt{padding:0px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:1em;background:none;border:none;color:gray}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{width:100%}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:before,.rst-breadcrumbs-buttons:after{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-side-scroll{width:auto}.wy-side-nav-search{width:auto}.wy-menu.wy-menu-vertical{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1100px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content img{max-width:100%;height:auto}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure p:last-child.caption{margin-bottom:0px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;display:block;overflow:auto}.rst-content pre.literal-block,.rst-content div[class^='highlight']{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px 0}.rst-content pre.literal-block div[class^='highlight'],.rst-content div[class^='highlight'] div[class^='highlight']{padding:0px;border:none;margin:0}.rst-content div[class^='highlight'] td.code{width:100%}.rst-content .linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;display:block;overflow:auto}.rst-content div[class^='highlight'] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content pre.literal-block,.rst-content div[class^='highlight'] pre,.rst-content .linenodiv pre{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;line-height:1.4}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^='highlight'],.rst-content div[class^='highlight'] pre{white-space:pre-wrap}}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last,.rst-content .admonition .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .section ol p:last-child,.rst-content .section ul p:last-child{margin-bottom:24px}.rst-content .line-block{margin-left:0px;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content .toctree-wrapper p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink{visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content .toctree-wrapper p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after,.rst-content table>caption .headerlink:after,.rst-content .code-block-caption .headerlink:after{content:"ïƒ";font-family:FontAwesome}.rst-content h1:hover .headerlink:after,.rst-content h2:hover .headerlink:after,.rst-content .toctree-wrapper p.caption:hover .headerlink:after,.rst-content h3:hover .headerlink:after,.rst-content h4:hover .headerlink:after,.rst-content h5:hover .headerlink:after,.rst-content h6:hover .headerlink:after,.rst-content dl dt:hover .headerlink:after,.rst-content p.caption:hover .headerlink:after,.rst-content table>caption:hover .headerlink:after,.rst-content .code-block-caption:hover .headerlink:after{visibility:visible}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:baseline;position:relative;top:-0.4em;line-height:0;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:gray}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.docutils.citation tt,.rst-content table.docutils.citation code,.rst-content table.docutils.footnote tt,.rst-content table.docutils.footnote code{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}.rst-content table.docutils td .last,.rst-content table.docutils td .last :last-child{margin-bottom:0}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content tt,.rst-content tt,.rst-content code{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;padding:2px 5px}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{color:#E74C3C}.rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{font-weight:bold;color:#404040}.rst-content pre,.rst-content kbd,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold;margin-bottom:12px}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:#555}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-weight:normal;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child,.rst-content code.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-regular.eot");src:url("../fonts/Lato/lato-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-regular.woff2") format("woff2"),url("../fonts/Lato/lato-regular.woff") format("woff"),url("../fonts/Lato/lato-regular.ttf") format("truetype");font-weight:400;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bold.eot");src:url("../fonts/Lato/lato-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bold.woff2") format("woff2"),url("../fonts/Lato/lato-bold.woff") format("woff"),url("../fonts/Lato/lato-bold.ttf") format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bolditalic.eot");src:url("../fonts/Lato/lato-bolditalic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bolditalic.woff2") format("woff2"),url("../fonts/Lato/lato-bolditalic.woff") format("woff"),url("../fonts/Lato/lato-bolditalic.ttf") format("truetype");font-weight:700;font-style:italic}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-italic.eot");src:url("../fonts/Lato/lato-italic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-italic.woff2") format("woff2"),url("../fonts/Lato/lato-italic.woff") format("woff"),url("../fonts/Lato/lato-italic.ttf") format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:url("../fonts/RobotoSlab/roboto-slab.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.ttf") format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.ttf") format("truetype")} + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:"ï€"}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:"ï€"}.fa-search-plus:before{content:""}.fa-search-minus:before{content:"ï€"}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:"ï€"}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:"ï€"}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:"ï€"}.fa-map-marker:before{content:"ï"}.fa-adjust:before{content:"ï‚"}.fa-tint:before{content:"ïƒ"}.fa-edit:before,.fa-pencil-square-o:before{content:"ï„"}.fa-share-square-o:before{content:"ï…"}.fa-check-square-o:before{content:"ï†"}.fa-arrows:before{content:"ï‡"}.fa-step-backward:before{content:"ïˆ"}.fa-fast-backward:before{content:"ï‰"}.fa-backward:before{content:"ïŠ"}.fa-play:before{content:"ï‹"}.fa-pause:before{content:"ïŒ"}.fa-stop:before{content:"ï"}.fa-forward:before{content:"ïŽ"}.fa-fast-forward:before{content:"ï"}.fa-step-forward:before{content:"ï‘"}.fa-eject:before{content:"ï’"}.fa-chevron-left:before{content:"ï“"}.fa-chevron-right:before{content:"ï”"}.fa-plus-circle:before{content:"ï•"}.fa-minus-circle:before{content:"ï–"}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:"ï—"}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:"ï˜"}.fa-question-circle:before{content:"ï™"}.fa-info-circle:before{content:"ïš"}.fa-crosshairs:before{content:"ï›"}.fa-times-circle-o:before{content:"ïœ"}.fa-check-circle-o:before{content:"ï"}.fa-ban:before{content:"ïž"}.fa-arrow-left:before{content:"ï "}.fa-arrow-right:before{content:"ï¡"}.fa-arrow-up:before{content:"ï¢"}.fa-arrow-down:before{content:"ï£"}.fa-mail-forward:before,.fa-share:before{content:"ï¤"}.fa-expand:before{content:"ï¥"}.fa-compress:before{content:"ï¦"}.fa-plus:before{content:"ï§"}.fa-minus:before{content:"ï¨"}.fa-asterisk:before{content:"ï©"}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:"ïª"}.fa-gift:before{content:"ï«"}.fa-leaf:before{content:"ï¬"}.fa-fire:before,.icon-fire:before{content:"ï"}.fa-eye:before{content:"ï®"}.fa-eye-slash:before{content:"ï°"}.fa-exclamation-triangle:before,.fa-warning:before{content:"ï±"}.fa-plane:before{content:"ï²"}.fa-calendar:before{content:"ï³"}.fa-random:before{content:"ï´"}.fa-comment:before{content:"ïµ"}.fa-magnet:before{content:"ï¶"}.fa-chevron-up:before{content:"ï·"}.fa-chevron-down:before{content:"ï¸"}.fa-retweet:before{content:"ï¹"}.fa-shopping-cart:before{content:"ïº"}.fa-folder:before{content:"ï»"}.fa-folder-open:before{content:"ï¼"}.fa-arrows-v:before{content:"ï½"}.fa-arrows-h:before{content:"ï¾"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"ï‚€"}.fa-twitter-square:before{content:"ï‚"}.fa-facebook-square:before{content:"ï‚‚"}.fa-camera-retro:before{content:""}.fa-key:before{content:"ï‚„"}.fa-cogs:before,.fa-gears:before{content:"ï‚…"}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:"ï‚‹"}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:"ï‚"}.fa-external-link:before{content:""}.fa-sign-in:before{content:"ï‚"}.fa-trophy:before{content:"ï‚‘"}.fa-github-square:before{content:"ï‚’"}.fa-upload:before{content:"ï‚“"}.fa-lemon-o:before{content:"ï‚”"}.fa-phone:before{content:"ï‚•"}.fa-square-o:before{content:"ï‚–"}.fa-bookmark-o:before{content:"ï‚—"}.fa-phone-square:before{content:""}.fa-twitter:before{content:"ï‚™"}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:"ï‚›"}.fa-unlock:before{content:""}.fa-credit-card:before{content:"ï‚"}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:"ï‚ "}.fa-bullhorn:before{content:"ï‚¡"}.fa-bell:before{content:""}.fa-certificate:before{content:"ï‚£"}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:"ï‚¥"}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:"ï‚§"}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:"ï‚©"}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:"ï‚«"}.fa-globe:before{content:""}.fa-wrench:before{content:"ï‚"}.fa-tasks:before{content:"ï‚®"}.fa-filter:before{content:"ï‚°"}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:"ïƒ"}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:"ïƒ"}.fa-table:before{content:""}.fa-magic:before{content:"ïƒ"}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:"ïƒ"}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:"ïƒ "}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:"ïƒ"}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:"ï‚¢"}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:"ï„€"}.fa-angle-double-right:before{content:"ï„"}.fa-angle-double-up:before{content:"ï„‚"}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:"ï„„"}.fa-angle-right:before{content:"ï„…"}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:"ï„‹"}.fa-circle-o:before{content:""}.fa-quote-left:before{content:"ï„"}.fa-quote-right:before{content:""}.fa-spinner:before{content:"ï„"}.fa-circle:before{content:"ï„‘"}.fa-mail-reply:before,.fa-reply:before{content:"ï„’"}.fa-github-alt:before{content:"ï„“"}.fa-folder-o:before{content:"ï„”"}.fa-folder-open-o:before{content:"ï„•"}.fa-smile-o:before{content:""}.fa-frown-o:before{content:"ï„™"}.fa-meh-o:before{content:""}.fa-gamepad:before{content:"ï„›"}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:"ï„"}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:"ï„ "}.fa-code:before{content:"ï„¡"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"ï„¢"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"ï„£"}.fa-location-arrow:before{content:""}.fa-crop:before{content:"ï„¥"}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:"ï„§"}.fa-question:before{content:""}.fa-info:before{content:"ï„©"}.fa-exclamation:before{content:""}.fa-superscript:before{content:"ï„«"}.fa-subscript:before{content:""}.fa-eraser:before{content:"ï„"}.fa-puzzle-piece:before{content:"ï„®"}.fa-microphone:before{content:"ï„°"}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:"ï„´"}.fa-rocket:before{content:""}.fa-maxcdn:before{content:"ï„¶"}.fa-chevron-circle-left:before{content:"ï„·"}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:"ï„»"}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:"ï…€"}.fa-ellipsis-h:before{content:"ï…"}.fa-ellipsis-v:before{content:"ï…‚"}.fa-rss-square:before{content:"ï…ƒ"}.fa-play-circle:before{content:"ï…„"}.fa-ticket:before{content:"ï……"}.fa-minus-square:before{content:"ï…†"}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:"ï…‡"}.fa-level-up:before{content:"ï…ˆ"}.fa-level-down:before{content:"ï…‰"}.fa-check-square:before{content:"ï…Š"}.fa-pencil-square:before{content:"ï…‹"}.fa-external-link-square:before{content:"ï…Œ"}.fa-share-square:before{content:"ï…"}.fa-compass:before{content:"ï…Ž"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"ï…"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"ï…‘"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"ï…’"}.fa-eur:before,.fa-euro:before{content:"ï…“"}.fa-gbp:before{content:"ï…”"}.fa-dollar:before,.fa-usd:before{content:"ï…•"}.fa-inr:before,.fa-rupee:before{content:"ï…–"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"ï…—"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"ï…˜"}.fa-krw:before,.fa-won:before{content:"ï…™"}.fa-bitcoin:before,.fa-btc:before{content:"ï…š"}.fa-file:before{content:"ï…›"}.fa-file-text:before{content:"ï…œ"}.fa-sort-alpha-asc:before{content:"ï…"}.fa-sort-alpha-desc:before{content:"ï…ž"}.fa-sort-amount-asc:before{content:"ï… "}.fa-sort-amount-desc:before{content:"ï…¡"}.fa-sort-numeric-asc:before{content:"ï…¢"}.fa-sort-numeric-desc:before{content:"ï…£"}.fa-thumbs-up:before{content:"ï…¤"}.fa-thumbs-down:before{content:"ï…¥"}.fa-youtube-square:before{content:"ï…¦"}.fa-youtube:before{content:"ï…§"}.fa-xing:before{content:"ï…¨"}.fa-xing-square:before{content:"ï…©"}.fa-youtube-play:before{content:"ï…ª"}.fa-dropbox:before{content:"ï…«"}.fa-stack-overflow:before{content:"ï…¬"}.fa-instagram:before{content:"ï…"}.fa-flickr:before{content:"ï…®"}.fa-adn:before{content:"ï…°"}.fa-bitbucket:before,.icon-bitbucket:before{content:"ï…±"}.fa-bitbucket-square:before{content:"ï…²"}.fa-tumblr:before{content:"ï…³"}.fa-tumblr-square:before{content:"ï…´"}.fa-long-arrow-down:before{content:"ï…µ"}.fa-long-arrow-up:before{content:"ï…¶"}.fa-long-arrow-left:before{content:"ï…·"}.fa-long-arrow-right:before{content:"ï…¸"}.fa-apple:before{content:"ï…¹"}.fa-windows:before{content:"ï…º"}.fa-android:before{content:"ï…»"}.fa-linux:before{content:"ï…¼"}.fa-dribbble:before{content:"ï…½"}.fa-skype:before{content:"ï…¾"}.fa-foursquare:before{content:""}.fa-trello:before{content:"ï†"}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:"ï†"}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:"ï†"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:"ï†"}.fa-yahoo:before{content:""}.fa-google:before{content:"ï† "}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:"ï†"}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:"ï‡"}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"ï‡"}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"ï‡"}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:"ï‡"}.fa-sliders:before{content:""}.fa-share-alt:before{content:"ï‡ "}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:"ï‡"}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:"ïˆ"}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:"ïˆ"}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:"ïˆ"}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:"ïˆ"}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:"ïˆ"}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"ï‰"}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:"ï‰"}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:"ï‰"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:"ï‰"}.fa-creative-commons:before{content:""}.fa-gg:before{content:"ï‰ "}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:"ï‰"}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:"ïŠ"}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:"ïŠ"}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:"ïŠ"}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:"ïŠ"}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:"ïŠ "}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:"ïŠ"}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:"ï‹€"}.fa-id-badge:before{content:"ï‹"}.fa-drivers-license:before,.fa-id-card:before{content:"ï‹‚"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:"ï‹„"}.fa-free-code-camp:before{content:"ï‹…"}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"ï‹‹"}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"ï‹"}.fa-podcast:before{content:""}.fa-window-maximize:before{content:"ï‹"}.fa-window-minimize:before{content:"ï‹‘"}.fa-window-restore:before{content:"ï‹’"}.fa-times-rectangle:before,.fa-window-close:before{content:"ï‹“"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"ï‹”"}.fa-bandcamp:before{content:"ï‹•"}.fa-grav:before{content:"ï‹–"}.fa-etsy:before{content:"ï‹—"}.fa-imdb:before{content:""}.fa-ravelry:before{content:"ï‹™"}.fa-eercast:before{content:""}.fa-microchip:before{content:"ï‹›"}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:"ï‹"}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:"ï‹ "}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.rst-content .wy-breadcrumbs li tt,.wy-breadcrumbs li .rst-content tt,.wy-breadcrumbs li code{padding:5px;border:none;background:none}.rst-content .wy-breadcrumbs li tt.literal,.wy-breadcrumbs li .rst-content tt.literal,.wy-breadcrumbs li code.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.field-list>dt:after,html.writer-html5 .rst-content dl.footnote>dt:after{content:":"}html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.footnote>dt>span.brackets{margin-right:.5rem}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{font-style:italic}html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.footnote>dd p,html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/docs/build/html/_static/fonts/Inconsolata-Bold.ttf b/docs/build/html/_static/fonts/Inconsolata-Bold.ttf deleted file mode 100644 index 809c1f5828f86235347019a50e78b4b486a6a045..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Inconsolata-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Inconsolata-Regular.ttf b/docs/build/html/_static/fonts/Inconsolata-Regular.ttf deleted file mode 100644 index fc981ce7ad6c42d2384f0ef74b73174b9302ee65..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Inconsolata-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Inconsolata.ttf b/docs/build/html/_static/fonts/Inconsolata.ttf deleted file mode 100644 index 4b8a36d249a05a0fe1575dc3d96ef7079dba6b07..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Inconsolata.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato-Bold.ttf b/docs/build/html/_static/fonts/Lato-Bold.ttf deleted file mode 100644 index 1d23c7066e095b5bff2c373d4064dc4f33659783..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato-Regular.ttf b/docs/build/html/_static/fonts/Lato-Regular.ttf deleted file mode 100644 index 0f3d0f837d24834b9b5b0a6b735459c56f5e75c3..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.eot b/docs/build/html/_static/fonts/Lato/lato-bold.eot deleted file mode 100644 index 3361183a419c188282a8545eaa8d8e298b8ffaab..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.ttf b/docs/build/html/_static/fonts/Lato/lato-bold.ttf deleted file mode 100644 index 29f691d5ed0c2d3d224423bb0288e6bd59292511..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot b/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot deleted file mode 100644 index 3d4154936b42522fac84900c689a901ac12875c0..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf b/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf deleted file mode 100644 index f402040b3e5360b90f3a12ca2afab2cd7244e16f..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.eot b/docs/build/html/_static/fonts/Lato/lato-italic.eot deleted file mode 100644 index 3f826421a1d97b09797fad3d781a666a39eb45c9..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.ttf b/docs/build/html/_static/fonts/Lato/lato-italic.ttf deleted file mode 100644 index b4bfc9b24aa993977662352c881c6e42f99f77e0..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-italic.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.eot b/docs/build/html/_static/fonts/Lato/lato-regular.eot deleted file mode 100644 index 11e3f2a5f0f9b8c7ef6affae8c543d20f7c112be..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.ttf b/docs/build/html/_static/fonts/Lato/lato-regular.ttf deleted file mode 100644 index 74decd9ebb8d805201934266b3bda6a9d5831024..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/Lato/lato-regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf b/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf deleted file mode 100644 index df5d1df2730433013f41bf2698cbe249b075aa02..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf b/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf deleted file mode 100644 index eb52a7907362cc3392eb74892883f5d9e260b638..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot deleted file mode 100644 index 79dc8efed3447d6588baa2bb74122d56f3500038..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf deleted file mode 100644 index df5d1df2730433013f41bf2698cbe249b075aa02..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot deleted file mode 100644 index 2f7ca78a1eb34f0f98feb07ab1231d077b248940..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot and /dev/null differ diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf deleted file mode 100644 index eb52a7907362cc3392eb74892883f5d9e260b638..0000000000000000000000000000000000000000 Binary files a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf and /dev/null differ diff --git a/docs/build/html/_static/js/badge_only.js b/docs/build/html/_static/js/badge_only.js new file mode 100644 index 0000000000000000000000000000000000000000..526d7234b6538603393d419ae2330b3fd6e57ee8 --- /dev/null +++ b/docs/build/html/_static/js/badge_only.js @@ -0,0 +1 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); \ No newline at end of file diff --git a/docs/build/html/_static/js/html5shiv-printshiv.min.js b/docs/build/html/_static/js/html5shiv-printshiv.min.js new file mode 100644 index 0000000000000000000000000000000000000000..2b43bd062e9689f9f4016931d08e7143d555539d --- /dev/null +++ b/docs/build/html/_static/js/html5shiv-printshiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/docs/build/html/_static/js/html5shiv.min.js b/docs/build/html/_static/js/html5shiv.min.js new file mode 100644 index 0000000000000000000000000000000000000000..cd1c674f5e3a290a12386156500df3c50903a46b --- /dev/null +++ b/docs/build/html/_static/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/docs/build/html/_static/js/modernizr.min.js b/docs/build/html/_static/js/modernizr.min.js deleted file mode 100644 index f65d47974786ee51c258f680bd9be621629244f5..0000000000000000000000000000000000000000 --- a/docs/build/html/_static/js/modernizr.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.6.2 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load - */ -;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; diff --git a/docs/build/html/_static/js/theme.js b/docs/build/html/_static/js/theme.js index 8555d79b71a1a347857e06b8a6223df1ccdd7859..1fddb6ee4a60f30b4a4c4b3ad1f1604043f77981 100644 --- a/docs/build/html/_static/js/theme.js +++ b/docs/build/html/_static/js/theme.js @@ -1,3 +1 @@ -/* sphinx_rtd_theme version 0.4.3 | MIT license */ -/* Built 20190212 16:02 */ -require=function r(s,a,l){function c(e,n){if(!a[e]){if(!s[e]){var i="function"==typeof require&&require;if(!n&&i)return i(e,!0);if(u)return u(e,!0);var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(n){return c(s[e][1][n]||n)},o,o.exports,r,s,a,l)}return a[e].exports}for(var u="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(e){var i=this;void 0===e&&(e=!0),i.isRunning||(i.isRunning=!0,jQuery(function(n){i.init(n),i.reset(),i.win.on("hashchange",i.reset),e&&i.win.on("scroll",function(){i.linkScroll||i.winScroll||(i.winScroll=!0,requestAnimationFrame(function(){i.onScroll()}))}),i.win.on("resize",function(){i.winResize||(i.winResize=!0,requestAnimationFrame(function(){i.onResize()}))}),i.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(i){i(document);var t=this;this.navBar=i("div.wy-side-scroll:first"),this.win=i(window),i(document).on("click","[data-toggle='wy-nav-top']",function(){i("[data-toggle='wy-nav-shift']").toggleClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var n=i(this);i("[data-toggle='wy-nav-shift']").removeClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift"),t.toggleCurrent(n),t.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){i("[data-toggle='rst-versions']").toggleClass("shift-up")}),i("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),i("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),i("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i('<span class="toctree-expand"></span>'),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0<i.length&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"),i[0].scrollIntoView())}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e<n.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[n[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[e]+"CancelAnimationFrame"]||window[n[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n,e){var i=(new Date).getTime(),t=Math.max(0,16-(i-r)),o=window.setTimeout(function(){n(i+t)},t);return r=i+t,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]); \ No newline at end of file +!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),n("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),n("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n('<button class="toctree-expand" title="Open/close menu"></button>'),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var i=(new Date).getTime(),o=Math.max(0,16-(i-n)),r=window.setTimeout((function(){e(i+o)}),o);return n=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()}).call(window)},function(n,e){n.exports=jQuery},function(n,e,t){}]); \ No newline at end of file diff --git a/docs/build/html/_static/searchtools.js b/docs/build/html/_static/searchtools.js index 58ff35c4345d19830352048b89abc8e7c06e4f20..002e9c4a20fb408e3cd2fd4edb11726364675c80 100644 --- a/docs/build/html/_static/searchtools.js +++ b/docs/build/html/_static/searchtools.js @@ -328,7 +328,9 @@ var Search = { var results = []; for (var prefix in objects) { - for (var name in objects[prefix]) { + for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) { + var match = objects[prefix][iMatch]; + var name = match[4]; var fullname = (prefix ? prefix + '.' : '') + name; var fullnameLower = fullname.toLowerCase() if (fullnameLower.indexOf(object) > -1) { @@ -342,7 +344,6 @@ var Search = { } else if (parts[parts.length - 1].indexOf(object) > -1) { score += Scorer.objPartialMatch; } - var match = objects[prefix][name]; var objname = objnames[match[1]][2]; var title = titles[match[0]]; // If more than one term searched for, we require other words to be diff --git a/docs/build/html/binary_c_parameters.html b/docs/build/html/binary_c_parameters.html index cf5c78529f69007817431ee185a240affd913f79..e5d412d096f1ca5a6814a0a1da2478f795dc75e8 100644 --- a/docs/build/html/binary_c_parameters.html +++ b/docs/build/html/binary_c_parameters.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Binary_c parameters — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Binary_c parameters — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Population grid code options" href="grid_options_descriptions.html" /> <link rel="prev" title="Example use case: Solar system using the API functionality" href="examples/notebook_solar_system.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -104,68 +59,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Binary_c parameters</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/binary_c_parameters.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -190,15 +107,15 @@ text-align: unset; } </style> -<div class="section" id="binary-c-parameters"> -<h1>Binary_c parameters<a class="headerlink" href="#binary-c-parameters" title="Permalink to this headline">¶</a></h1> +<section id="binary-c-parameters"> +<h1>Binary_c parameters<a class="headerlink" href="#binary-c-parameters" title="Permalink to this headline">ïƒ</a></h1> <p>The following chapter contains all the parameters that the current version of binary_c can handle, along with their descriptions and other properties.</p> <dl class="simple"> <dt>This information was obtained by the following binary_c build:</dt><dd><p><strong>binary_c git branch</strong>: branch_david <strong>binary_c git revision</strong>: 5834:20211216:a3146490e <strong>Built on</strong>: Dec 20 2021 20:33:01</p> </dd> </dl> -<div class="section" id="section-stars"> -<h2>Section: stars<a class="headerlink" href="#section-stars" title="Permalink to this headline">¶</a></h2> +<section id="section-stars"> +<h2>Section: stars<a class="headerlink" href="#section-stars" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: metallicity</div> <div class="line"><strong>Description</strong>: This sets the metallicity of the stars, i.e. the amount (by mass) of matter which is not hydrogen or helium. If you are using the BSE algorithm, this must be 1e-4 <= metallicity <= 0.03. See also nucsyn_metallicity and effective_metallicity.</div> @@ -1579,9 +1496,9 @@ <div class="line"><strong>Parameter input type</strong>: Float</div> <div class="line"><strong>Default value</strong>: NULL</div> </div> -</div> -<div class="section" id="section-binary"> -<h2>Section: binary<a class="headerlink" href="#section-binary" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-binary"> +<h2>Section: binary<a class="headerlink" href="#section-binary" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: separation</div> <div class="line"><strong>Description</strong>: Set the orbital separation (actually the semi-major axis) of the binary (internal index 0, stellar indices 0 and 1) in solar radii. Note that if the orbital period is given, it is used to calculate the separation. So if you want to set the separation instead, either do not set the orbital period or set the orbital period to zero (0.0).</div> @@ -2741,9 +2658,9 @@ <div class="line"><strong>Parameter input type</strong>: Float</div> <div class="line"><strong>Default value</strong>: 0.05</div> </div> -</div> -<div class="section" id="section-nucsyn"> -<h2>Section: nucsyn<a class="headerlink" href="#section-nucsyn" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-nucsyn"> +<h2>Section: nucsyn<a class="headerlink" href="#section-nucsyn" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: third_dup</div> <div class="line"><strong>Description</strong>: If True, enables third dredge up. Requires NUCSYN and NUCSYN_THIRD_DREDGE_UP.</div> @@ -3004,9 +2921,9 @@ <div class="line"><strong>Parameter input type</strong>: Float</div> <div class="line"><strong>Default value</strong>: NULL</div> </div> -</div> -<div class="section" id="section-output"> -<h2>Section: output<a class="headerlink" href="#section-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-output"> +<h2>Section: output<a class="headerlink" href="#section-output" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: david_logging_function</div> <div class="line"><strong>Description</strong>: Function to choose which kind of information gets logged Requires DAVID. Choices are: 0= None, >0 for custom logging functions</div> @@ -3298,9 +3215,9 @@ <div class="line"><strong>Default value</strong>: 0</div> <div class="line"><strong>Extra</strong>: Ignore</div> </div> -</div> -<div class="section" id="section-input"> -<h2>Section: input<a class="headerlink" href="#section-input" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-input"> +<h2>Section: input<a class="headerlink" href="#section-input" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: MINT_dir</div> <div class="line"><strong>Description</strong>: Location of MINT algorithm data.</div> @@ -3415,9 +3332,9 @@ <div class="line"><strong>Default value</strong>: 0.1</div> <div class="line"><strong>Extra</strong>:</div> </div> -</div> -<div class="section" id="section-i-o"> -<h2>Section: i/o<a class="headerlink" href="#section-i-o" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-i-o"> +<h2>Section: i/o<a class="headerlink" href="#section-i-o" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: go</div> <div class="line"><strong>Description</strong>: batchmode control command</div> @@ -3478,9 +3395,9 @@ <div class="line"><strong>Description</strong>: Output batchmode status information.</div> <div class="line"><strong>Extra</strong>: Ignore</div> </div> -</div> -<div class="section" id="section-algorithms"> -<h2>Section: algorithms<a class="headerlink" href="#section-algorithms" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-algorithms"> +<h2>Section: algorithms<a class="headerlink" href="#section-algorithms" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: repeat</div> <div class="line"><strong>Description</strong>: If > 1, repeats the system as many times as required. Handy if you’re using Monte-Carlo kicks and want to sample the parameter space well. Also, if you are running speed tests this is good to give a statistically more reasonable result. (See e.g. ‘tbse pgo’).</div> @@ -3493,9 +3410,9 @@ <div class="line"><strong>Parameter input type</strong>: Integer</div> <div class="line"><strong>Default value</strong>: 0</div> </div> -</div> -<div class="section" id="section-misc"> -<h2>Section: misc<a class="headerlink" href="#section-misc" title="Permalink to this headline">¶</a></h2> +</section> +<section id="section-misc"> +<h2>Section: misc<a class="headerlink" href="#section-misc" title="Permalink to this headline">ïƒ</a></h2> <div class="line-block"> <div class="line"><strong>Parameter</strong>: random_seed</div> <div class="line"><strong>Description</strong>: Random number seed, usually a (possibly negative) integer. Useful for exactly reproducing the evolution of a system which involves a kick (which is a Monte-Carlo, i.e. pseudorandom, process).</div> @@ -3567,62 +3484,44 @@ <div class="line"><strong>Default value</strong>: NULL</div> <div class="line"><strong>Extra</strong>: Ignore</div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="grid_options_descriptions.html" class="btn btn-neutral float-right" title="Population grid code options" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="examples/notebook_solar_system.html" class="btn btn-neutral float-left" title="Example use case: Solar system using the API functionality" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="examples/notebook_solar_system.html" class="btn btn-neutral float-left" title="Example use case: Solar system using the API functionality" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="grid_options_descriptions.html" class="btn btn-neutral float-right" title="Population grid code options" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/custom_logging_functions.html b/docs/build/html/custom_logging_functions.html index e5d9a0707660f2d8ec151eb36f233c307853a966..97d0b0a7ed6bf9ffcf052c8c93b017239884aa80 100644 --- a/docs/build/html/custom_logging_functions.html +++ b/docs/build/html/custom_logging_functions.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>custom_logging_functions module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>custom_logging_functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="distribution_functions module" href="distribution_functions.html" /> + <link rel="next" title="functions module" href="dicts.html" /> <link rel="prev" title="Binarycpython code" href="modules.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2 current"><a class="current reference internal" href="#">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>custom_logging_functions module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/custom_logging_functions.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,13 +121,13 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.custom_logging_functions"> -<span id="custom-logging-functions-module"></span><h1>custom_logging_functions module<a class="headerlink" href="#module-binarycpython.utils.custom_logging_functions" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.custom_logging_functions"> +<span id="custom-logging-functions-module"></span><h1>custom_logging_functions module<a class="headerlink" href="#module-binarycpython.utils.custom_logging_functions" title="Permalink to this headline">ïƒ</a></h1> <p>Module containing functions for the custom logging functionality. The functions here make it possible for the user to define binaryc output logs on runtime</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.autogen_C_logging_code"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">autogen_C_logging_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logging_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#autogen_C_logging_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.autogen_C_logging_code" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">autogen_C_logging_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logging_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#autogen_C_logging_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.autogen_C_logging_code" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that auto-generates PRINTF statements for binaryc. Input is a dictionary where the key is the header of that logging line and items which are lists of parameters that will be put in that logging line</p> @@ -236,7 +162,7 @@ and items which are lists of parameters that will be put in that logging line</p <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.binary_c_log_code"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">binary_c_log_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#binary_c_log_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.binary_c_log_code" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">binary_c_log_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#binary_c_log_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.binary_c_log_code" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to construct the code to construct the custom logging function</p> <p class="rubric">Example</p> <p>Code to log and terminate evolution when the primary star becomes a NS:</p> @@ -281,7 +207,7 @@ and items which are lists of parameters that will be put in that logging line</p <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.binary_c_write_log_code"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">binary_c_write_log_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#binary_c_write_log_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.binary_c_write_log_code" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">binary_c_write_log_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#binary_c_write_log_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.binary_c_write_log_code" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to write the generated logging code to a file</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -299,7 +225,7 @@ and items which are lists of parameters that will be put in that logging line</p <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.compile_shared_lib"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">compile_shared_lib</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sourcefile_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#compile_shared_lib"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.compile_shared_lib" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">compile_shared_lib</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sourcefile_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#compile_shared_lib"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.compile_shared_lib" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to write the custom logging code to a file and then compile it.</p> <p>TODO: consider returning a status</p> <dl class="field-list simple"> @@ -319,7 +245,7 @@ and items which are lists of parameters that will be put in that logging line</p <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.create_and_load_logging_function"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">create_and_load_logging_function</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">custom_logging_code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_tmp_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#create_and_load_logging_function"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.create_and_load_logging_function" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">create_and_load_logging_function</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">custom_logging_code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_tmp_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#create_and_load_logging_function"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.create_and_load_logging_function" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to automatically compile the shared library with the given custom logging code and load it with ctypes.</p> <p>This function is more or less the main function of this module and unless you know what you’re doing with the other functions @@ -342,7 +268,7 @@ I recommend using this in function in combination with a function that generates <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.from_binary_c_config"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">from_binary_c_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flag</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#from_binary_c_config"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.from_binary_c_config" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">from_binary_c_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flag</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#from_binary_c_config"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.from_binary_c_config" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to run the binaryc_config command with flags</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -362,7 +288,7 @@ I recommend using this in function in combination with a function that generates <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.custom_logging_functions.return_compilation_dict"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">return_compilation_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#return_compilation_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.return_compilation_dict" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.custom_logging_functions.</span></span><span class="sig-name descname"><span class="pre">return_compilation_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/custom_logging_functions.html#return_compilation_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.custom_logging_functions.return_compilation_dict" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to build the compile command for the shared library</p> <p>Inspired by binary_c_inline_config command in Perl</p> <p>TODO: this function still has some cleaning up to do w.r.t. default values for the compile command @@ -380,61 +306,43 @@ I recommend using this in function in combination with a function that generates </dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="distribution_functions.html" class="btn btn-neutral float-right" title="distribution_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="modules.html" class="btn btn-neutral float-left" title="Binarycpython code" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="modules.html" class="btn btn-neutral float-left" title="Binarycpython code" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="dicts.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/dicts.html b/docs/build/html/dicts.html new file mode 100644 index 0000000000000000000000000000000000000000..f98415fe2d3b5fe0e263b6b276d6b07d83762a1f --- /dev/null +++ b/docs/build/html/dicts.html @@ -0,0 +1,481 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> + <script src="_static/jquery.js"></script> + <script src="_static/underscore.js"></script> + <script src="_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="_static/js/theme.js"></script> + <link rel="index" title="Index" href="genindex.html" /> + <link rel="search" title="Search" href="search.html" /> + <link rel="next" title="functions module" href="ensemble.html" /> + <link rel="prev" title="custom_logging_functions module" href="custom_logging_functions.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="index.html" class="icon icon-home"></a> »</li> + <li><a href="modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="_sources/dicts.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.dicts"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.dicts" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing functions that binary_c-python uses to modify dictionaries.</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.AutoVivificationDict"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">AutoVivificationDict</span></span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#AutoVivificationDict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.AutoVivificationDict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +<p>Implementation of perl’s autovivification feature, by overriding the +get item and the __iadd__ operator (<a class="reference external" href="https://docs.python.org/3/reference/datamodel.html?highlight=iadd#object.__iadd__">https://docs.python.org/3/reference/datamodel.html?highlight=iadd#object.__iadd__</a>)</p> +<p>This allows to set values within a subdict that might not exist yet:</p> +<p class="rubric">Example</p> +<p>newdict = {} +newdict[‘example’][‘mass’] += 10 +print(newdict) +>>> {‘example’: {‘mass’: 10}}</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.AutoVivificationDict.__getitem__"> +<span class="sig-name descname"><span class="pre">__getitem__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#AutoVivificationDict.__getitem__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.AutoVivificationDict.__getitem__" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Getitem function for the autovivication dict</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.AutoVivificationDict.__iadd__"> +<span class="sig-name descname"><span class="pre">__iadd__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#AutoVivificationDict.__iadd__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.AutoVivificationDict.__iadd__" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>iadd function (handling the +=) for the autovivication dict.</p> +</dd></dl> + +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.count_keys_recursive"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">count_keys_recursive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#count_keys_recursive"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.count_keys_recursive" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to count the total number of keys in a dictionary</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.custom_sort_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">custom_sort_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#custom_sort_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.custom_sort_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Returns a dictionary that is ordered, but can handle numbers better than normal OrderedDict</p> +<p>When the keys of the current dictionary are of mixed type, we first find all the unique types. +Sort that list of type names. Then find the values that fit that type. +Sort those and append them to the sorted keys list. +This is done until all the keys are sorted.</p> +<p>All objects other than dictionary types are directly return as they are</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.filter_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">filter_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_list</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#filter_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.filter_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to filter out keys that are contains in filter_list</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>arg_dict</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – dictionary containing the argument + default key pairs of binary_c</p></li> +<li><p><strong>filter_list</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>) – lists of keys to be filtered out</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>filtered dictionary</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.filter_dict_through_values"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">filter_dict_through_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_list</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#filter_dict_through_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.filter_dict_through_values" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to filter out keys that contain values included in filter_list</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>arg_dict</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – dictionary containing the argument + default key pairs of binary_c</p></li> +<li><p><strong>filter_list</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>) – lists of values to be filtered out</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>filtered dictionary</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.inspect_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">inspect_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">print_structure</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#inspect_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.inspect_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to (recursively) inspect a (nested) dictionary. +The object that is returned is a dictionary containing the key of the input_dict, but as value +it will return the type of what the value would be in the input_dict</p> +<p>In this way we inspect the structure of these dictionaries, rather than the exact contents.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>input_dict</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – dictionary you want to inspect</p></li> +<li><p><strong>print_structure</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – (optional, default = True)</p></li> +<li><p><strong>indent</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – (optional, default = 0) indent of the first output</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p><dl class="simple"> +<dt>Dictionary that has the same structure as the input_dict, but as values it has the</dt><dd><p>type(input_dict[key]) (except if the value is a dict)</p> +</dd> +</dl> +</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.keys_to_floats"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">keys_to_floats</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">json_data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#keys_to_floats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.keys_to_floats" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to convert all the keys of the dictionary to float to float</p> +<p>we need to convert keys to floats: +this is ~ a factor 10 faster than David’s recursive_change_key_to_float routine, probably because this version only does the float conversion, nothing else.</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.merge_dicts"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">merge_dicts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dict_1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dict_2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#merge_dicts"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.merge_dicts" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to merge two dictionaries in a custom way.</p> +<p>Behaviour:</p> +<dl class="simple"> +<dt>When dict keys are only present in one of either:</dt><dd><ul class="simple"> +<li><p>we just add the content to the new dict</p></li> +</ul> +</dd> +<dt>When dict keys are present in both, we decide based on the value types how to combine them:</dt><dd><ul class="simple"> +<li><p>dictionaries will be merged by calling recursively calling this function again</p></li> +<li><p>numbers will be added</p></li> +<li><p>(opt) lists will be appended</p></li> +<li><p>booleans are merged with logical OR</p></li> +<li><p>identical strings are just set to the string</p></li> +<li><p>non-identical strings are concatenated</p></li> +<li><p>NoneTypes are set to None</p></li> +<li><p>In the case that the instances do not match: for now I will raise an error</p></li> +</ul> +</dd> +</dl> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>dict_1</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – first dictionary</p></li> +<li><p><strong>dict_2</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – second dictionary</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>Merged dictionary</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.multiply_float_values"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">multiply_float_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">const</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#multiply_float_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.multiply_float_values" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>multiply_float_values : A function to recursively multiply values of a (nested) dictionary that are floats by a constant. Nested dictionaries call this function recursively.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>dictionary</strong> (<em>d = the</em>) – </p></li> +<li><p><strong>values</strong> (<em>const = the constant that multiplies float</em>) – </p></li> +</ul> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.multiply_values_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">multiply_values_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">factor</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#multiply_values_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.multiply_values_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that goes over dictionary recursively and multiplies the value if possible by a factor</p> +<p>If the key equals “general_infoâ€, the multiplication gets skipped</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.normalize_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">normalize_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">result_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#normalize_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.normalize_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to normalise a dictionary</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.prepare_dict"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">prepare_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">global_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">list_of_sub_keys</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#prepare_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.prepare_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that makes sure that the global dict is prepared to have a value set there. +This dictionary will store values and factors for the distribution functions, +so that they don’t have to be calculated each time.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>global_dict</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – globally accessible dictionary where factors are stored in</p></li> +<li><p><strong>list_of_sub_keys</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>) – List of keys that must become be(come) present in the global_dict</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.recursive_change_key_to_float"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">recursive_change_key_to_float</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#recursive_change_key_to_float"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.recursive_change_key_to_float" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to recursively change the key to float</p> +<p>This only works if the dict contains just sub-dicts or numbers/strings. +Does not work with lists as values</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.recursive_change_key_to_string"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">recursive_change_key_to_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_format</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'{:g}'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#recursive_change_key_to_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.recursive_change_key_to_string" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to recursively change the key back to a string but this time in a format that we decide</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.set_opts"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">set_opts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newopts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#set_opts"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.set_opts" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to take a default dict and override it with newer values.</p> +<p># TODO: consider changing this to just a dict.update</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>opts</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – dictionary with default values</p></li> +<li><p><strong>newopts</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – dictionary with new values</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>returns an updated dictionary</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.subtract_dicts"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">subtract_dicts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dict_1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dict_2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#subtract_dicts"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.subtract_dicts" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to subtract two dictionaries.</p> +<p>Only allows values to be either a dict or a numerical type</p> +<dl class="simple"> +<dt>For the overlapping keys (key name present in both dicts):</dt><dd><dl class="simple"> +<dt>When the keys are of the same type:</dt><dd><ul class="simple"> +<li><p>If the types are of numerical type: subtract the value at dict 2 from dict 1.</p></li> +<li><p>If the types are both dictionaries: call this function with the subdicts</p></li> +</ul> +</dd> +<dt>When the keys are not of the same type:</dt><dd><ul class="simple"> +<li><p>if the keys are all of numerical types</p></li> +</ul> +</dd> +</dl> +</dd> +<dt>For the unique keys:</dt><dd><ul class="simple"> +<li><p>if the key is from dict 1: adds the value to the new dict (be it numerical value or dict)</p></li> +<li><dl class="simple"> +<dt>If the key is from dict 2: Adds the negative of its value in case of numerical type.</dt><dd><p>if the type is a dict, the result of subtract_dicts({}, dict_2[key]) will be set</p> +</dd> +</dl> +</li> +</ul> +</dd> +</dl> +<p>If the result is 0, the key will be removed from the resulting dict. +If that results in an empty dict, the dict will be removed too.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>dict_1</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – first dictionary</p></li> +<li><p><strong>dict_2</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – second dictionary</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>Subtracted dictionary</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.dicts.update_dicts"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.dicts.</span></span><span class="sig-name descname"><span class="pre">update_dicts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dict_1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dict_2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/dicts.html#update_dicts"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.dicts.update_dicts" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to update dict_1 with values of dict_2 in a recursive way.</p> +<p>Behaviour:</p> +<dl class="simple"> +<dt>When dict keys are only present in one of either:</dt><dd><ul class="simple"> +<li><p>we just add the content to the new dict</p></li> +</ul> +</dd> +<dt>When dict keys are present in both, we decide based on the value types how to combine them:</dt><dd><ul class="simple"> +<li><p>value of dict2 will be taken</p></li> +</ul> +</dd> +</dl> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>dict_1</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – first dictionary</p></li> +<li><p><strong>dict_2</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – second dictionary</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>New dictionary with Updated values</p> +</dd> +</dl> +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="custom_logging_functions.html" class="btn btn-neutral float-left" title="custom_logging_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="ensemble.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/distribution_functions.html b/docs/build/html/distribution_functions.html deleted file mode 100644 index 185a00bcff086013195b3b4e9be756ad76e4780f..0000000000000000000000000000000000000000 --- a/docs/build/html/distribution_functions.html +++ /dev/null @@ -1,257 +0,0 @@ - - -<!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> -<head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>distribution_functions module — binary_c-python documentation</title> - - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> - <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> - <script src="_static/jquery.js"></script> - <script src="_static/underscore.js"></script> - <script src="_static/doctools.js"></script> - <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="functions module" href="functions.html" /> - <link rel="prev" title="custom_logging_functions module" href="custom_logging_functions.html" /> -</head> - -<body class="wy-body-for-nav"> - - - <div class="wy-grid-for-nav"> - - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> - <div class="wy-side-scroll"> - <div class="wy-side-nav-search" > - - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - - </a> - - - - - - - -<div role="search"> - <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> - <input type="text" name="q" placeholder="Search docs" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - - <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> -<ul class="current"> -<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> -<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> -<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2 current"><a class="current reference internal" href="#">distribution_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> -<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> -<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> -<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> -</ul> - - - - </div> - </div> - </nav> - - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - - <i data-toggle="wy-nav-top" class="fa fa-bars"></i> - <a href="index.html">binary_c-python</a> - - </nav> - - - <div class="wy-nav-content"> - - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - - <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - - <li><a href="modules.html">Binarycpython code</a> »</li> - - <li>distribution_functions module</li> - - - <li class="wy-breadcrumbs-aside"> - - - <a href="_sources/distribution_functions.rst.txt" rel="nofollow"> View page source</a> - - - </li> - - </ul> - - - <hr/> -</div> - <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> - <div itemprop="articleBody"> - - -<style> -/* CSS overrides for sphinx_rtd_theme */ - -/* 24px margin */ -.nbinput.nblast.container, -.nboutput.nblast.container { - margin-bottom: 19px; /* padding has already 5px */ -} - -/* ... except between code cells! */ -.nblast.container + .nbinput.container { - margin-top: -19px; -} - -.admonition > p:before { - margin-right: 4px; /* make room for the exclamation icon */ -} - -/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ -.math { - text-align: unset; -} -</style> -<div class="section" id="distribution-functions-module"> -<h1>distribution_functions module<a class="headerlink" href="#distribution-functions-module" title="Permalink to this headline">¶</a></h1> -</div> - - - </div> - - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="functions.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="custom_logging_functions.html" class="btn btn-neutral float-left" title="custom_logging_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - - </div> - - - <hr/> - - <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> - </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. -<br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. -<br><br> -Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. - - - -</footer> - - </div> - </div> - - </section> - - </div> - - - - <script type="text/javascript"> - jQuery(function () { - SphinxRtdTheme.Navigation.enable(true); - }); - </script> - - - - - - -</body> -</html> \ No newline at end of file diff --git a/docs/build/html/ensemble.html b/docs/build/html/ensemble.html new file mode 100644 index 0000000000000000000000000000000000000000..7f099243c42894899f43e9653e88611c9d87576b --- /dev/null +++ b/docs/build/html/ensemble.html @@ -0,0 +1,294 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> + <script src="_static/jquery.js"></script> + <script src="_static/underscore.js"></script> + <script src="_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="_static/js/theme.js"></script> + <link rel="index" title="Index" href="genindex.html" /> + <link rel="search" title="Search" href="search.html" /> + <link rel="next" title="functions module" href="functions.html" /> + <link rel="prev" title="functions module" href="dicts.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="index.html" class="icon icon-home"></a> »</li> + <li><a href="modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="_sources/ensemble.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.ensemble"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.ensemble" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing functions to interact with binary_c’s +population ensemble using the binarycpython package</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.BinaryCEncoder"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">BinaryCEncoder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skipkeys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">check_circular</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allow_nan</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">separators</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#BinaryCEncoder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.BinaryCEncoder" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">json.encoder.JSONEncoder</span></code></p> +<p>Encoding class function to attempt to convert things to strings.</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.BinaryCEncoder.default"> +<span class="sig-name descname"><span class="pre">default</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">o</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#BinaryCEncoder.default"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.BinaryCEncoder.default" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Converting function. Well, could be more precise. look at the JSON module</p> +</dd></dl> + +</dd></dl> + +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.binarycDecoder"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">binarycDecoder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_hook</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parse_float</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parse_int</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parse_constant</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_pairs_hook</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#binarycDecoder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.binarycDecoder" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">json.decoder.JSONDecoder</span></code></p> +<p>Custom decoder to transform the numbers that are strings to actual floats</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.binarycDecoder.decode"> +<span class="sig-name descname"><span class="pre">decode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#binarycDecoder.decode"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.binarycDecoder.decode" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Entry point function for decoding</p> +</dd></dl> + +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.binaryc_json_serializer"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">binaryc_json_serializer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#binaryc_json_serializer"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.binaryc_json_serializer" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Custom serialiser for binary_c to use when functions are present in the dictionary +that we want to export.</p> +<p>Function objects will be turned into str representations of themselves</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>obj</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Any</span></code>) – The object that might not be serialisable</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Any</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>Either string representation of object if the object is a function, or the object itself</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.ensemble_compression"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">ensemble_compression</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#ensemble_compression"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.ensemble_compression" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return the compression type of the ensemble file, based on its filename extension.</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.ensemble_file_type"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">ensemble_file_type</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#ensemble_file_type"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.ensemble_file_type" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Returns the file type of an ensemble file.</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.ensemble_setting"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">ensemble_setting</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ensemble</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parameter_name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#ensemble_setting"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.ensemble_setting" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to get the setting of parameter_name in the given ensemble, or return the default value.</p> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.extract_ensemble_json_from_string"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">extract_ensemble_json_from_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">binary_c_output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#extract_ensemble_json_from_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.extract_ensemble_json_from_string" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to extract the ensemble_json information from a raw binary_c output string</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>binary_c_output</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – raw binary_c output string</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>JSON dictionary with the parsed ENSEMBLE_JSON data</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.format_ensemble_results"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">format_ensemble_results</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ensemble_dictionary</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#format_ensemble_results"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.format_ensemble_results" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to handle all the steps of formatting the ensemble output again.</p> +<dl class="simple"> +<dt>Input:</dt><dd><p>ensemble_dictionary: dictionary containing all the ensemble results</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.handle_ensemble_string_to_json"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">handle_ensemble_string_to_json</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">raw_output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#handle_ensemble_string_to_json"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.handle_ensemble_string_to_json" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that deals with the raw output of the ensemble and +creates a working JSON dictionary out of it.</p> +<p>Having this wrapper makes it easy to</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>raw_output</strong> – raw output of the ensemble dump by binary_c</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>json.loads(raw_output, cls=binarycDecoder)</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.load_ensemble"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">load_ensemble</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">convert_float_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">select_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timing</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flush</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#load_ensemble"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.load_ensemble" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to load an ensemeble file, even if it is compressed, +and return its contents to as a Python dictionary.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>convert_float_keys</strong> – if True, converts strings to floats.</p></li> +<li><p><strong>select_keys</strong> – a list of keys to be selected from the ensemble.</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt class="sig sig-object py" id="binarycpython.utils.ensemble.open_ensemble"> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.ensemble.</span></span><span class="sig-name descname"><span class="pre">open_ensemble</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'utf-8'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/ensemble.html#open_ensemble"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.ensemble.open_ensemble" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to open an ensemble at filename for reading and decompression if required.</p> +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="dicts.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="functions.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/example_notebooks.html b/docs/build/html/example_notebooks.html index 1a1f7f05e6d09e852100c4159a48d9d5541ecf73..170193a9f92bc77fa084da73321f8c0a982f346d 100644 --- a/docs/build/html/example_notebooks.html +++ b/docs/build/html/example_notebooks.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example notebooks — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example notebooks — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Tutorial: Running individual systems with binary_c-python" href="examples/notebook_individual_systems.html" /> <link rel="prev" title="useful_funcs module" href="useful_funcs.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -108,68 +63,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Example notebooks</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/example_notebooks.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -194,8 +111,8 @@ text-align: unset; } </style> -<div class="section" id="example-notebooks"> -<h1>Example notebooks<a class="headerlink" href="#example-notebooks" title="Permalink to this headline">¶</a></h1> +<section id="example-notebooks"> +<h1>Example notebooks<a class="headerlink" href="#example-notebooks" title="Permalink to this headline">ïƒ</a></h1> <p>We have a set of notebooks that explain and show the usage of the binarycpython features. The notebooks are also stored in the examples/ directory in the <a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/master/examples">repository</a></p> <p>The order of the notebooks below is more or less the recommended order to read. The last couple of notebooks are example usecases</p> <div class="toctree-wrapper compound"> @@ -277,61 +194,43 @@ <li class="toctree-l1"><a class="reference internal" href="examples/notebook_solar_system.html">Example use case: Solar system using the API functionality</a></li> </ul> </div> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="examples/notebook_individual_systems.html" class="btn btn-neutral float-right" title="Tutorial: Running individual systems with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="useful_funcs.html" class="btn btn-neutral float-left" title="useful_funcs module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="useful_funcs.html" class="btn btn-neutral float-left" title="useful_funcs module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="examples/notebook_individual_systems.html" class="btn btn-neutral float-right" title="Tutorial: Running individual systems with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_BHBH.html b/docs/build/html/examples/notebook_BHBH.html index 03d1ae8acb6c26020135f3c67df14345a2e02220..476f1b3768a933d8d1ec6b9c250d3944c706a87f 100644 --- a/docs/build/html/examples/notebook_BHBH.html +++ b/docs/build/html/examples/notebook_BHBH.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Binary black hole systems — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Binary black hole systems — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Massive star luminosity" href="notebook_massive_remnants.html" /> <link rel="prev" title="Example use case: Common-envelope evolution" href="notebook_common_envelope_evolution.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -110,70 +65,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Binary black hole systems</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_BHBH.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -444,8 +360,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Binary-black-hole-systems"> -<h1>Example use case: Binary black hole systems<a class="headerlink" href="#Example-use-case:-Binary-black-hole-systems" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Binary-black-hole-systems"> +<h1>Example use case: Binary black hole systems<a class="headerlink" href="#Example-use-case:-Binary-black-hole-systems" title="Permalink to this headline">ïƒ</a></h1> <p>TODO: introduce the notebook</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]: @@ -5637,61 +5553,43 @@ system 2 / 100 </pre></div> </div> </div> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_massive_remnants.html" class="btn btn-neutral float-right" title="Example use case: Massive star luminosity" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_common_envelope_evolution.html" class="btn btn-neutral float-left" title="Example use case: Common-envelope evolution" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_common_envelope_evolution.html" class="btn btn-neutral float-left" title="Example use case: Common-envelope evolution" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_massive_remnants.html" class="btn btn-neutral float-right" title="Example use case: Massive star luminosity" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_HRD.html b/docs/build/html/examples/notebook_HRD.html index 4b78eddc4f1f1f2e64a0a2f4d2bbab7f7a0f6ba9..22fa06841b6a7fe3a0ddca7c246251f7d377e909 100644 --- a/docs/build/html/examples/notebook_HRD.html +++ b/docs/build/html/examples/notebook_HRD.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Hertzsprung-Russell diagrams — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Hertzsprung-Russell diagrams — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Common-envelope evolution" href="notebook_common_envelope_evolution.html" /> <link rel="prev" title="Example use case: Zero-age stellar luminosity function in binaries" href="notebook_luminosity_function_binaries.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -117,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Hertzsprung-Russell diagrams</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_HRD.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -451,8 +367,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Hertzsprung-Russell-diagrams"> -<h1>Example use case: Hertzsprung-Russell diagrams<a class="headerlink" href="#Example-use-case:-Hertzsprung-Russell-diagrams" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Hertzsprung-Russell-diagrams"> +<h1>Example use case: Hertzsprung-Russell diagrams<a class="headerlink" href="#Example-use-case:-Hertzsprung-Russell-diagrams" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we compute Hertzsprung-Russell diagrams (HRDs) of single and binary stars.</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]: @@ -471,8 +387,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>First we set up a new population object. Our stars evolve to <span class="math notranslate nohighlight">\(13.7\mathrm{Gyr}\)</span>, the age of the Universe, and we assume the metallicity <span class="math notranslate nohighlight">\(Z=0.02\)</span>. These are rough approximations: a real population was born some finite time ago, so cannot possibly evolve to <span class="math notranslate nohighlight">\(13.7\mathrm{Gyr}\)</span>, and stars are not really born with a metallicity of <span class="math notranslate nohighlight">\(0.02\)</span>. These approximations only affect very low mass stars, so we assume all our stars have mass <span class="math notranslate nohighlight">\(M\geq 1 \mathrm{M}_\odot\)</span>, and metallicity does not change evolution too much except in massive stars through the dependence of their winds on metallicity, so we limit our study to <span class="math notranslate nohighlight">\(M\leq 10 \mathrm{M}_\odot\)</span>.</p> <div class="nbinput nblast docutils container"> @@ -498,9 +414,9 @@ does not change evolution too much except in massive stars through the dependenc </pre></div> </div> </div> -</div> -<div class="section" id="Stellar-Grid"> -<h2>Stellar Grid<a class="headerlink" href="#Stellar-Grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Stellar-Grid"> +<h2>Stellar Grid<a class="headerlink" href="#Stellar-Grid" title="Permalink to this headline">ïƒ</a></h2> <p>We now construct a grid of stars, varying the mass from <span class="math notranslate nohighlight">\(1\)</span> to <span class="math notranslate nohighlight">\(10\mathrm{M}_\odot\)</span> in nine steps (so the masses are integers).</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]: @@ -554,9 +470,9 @@ Added grid variable: { } </pre></div></div> </div> -</div> -<div class="section" id="Setting-logging-and-handling-the-output"> -<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Setting-logging-and-handling-the-output"> +<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>We now construct the HRD output.</p> <p>We choose stars prior to and including the thermally-pulsing asymptotic giant branch (TPAGB) phase that have <span class="math notranslate nohighlight">\(>0.1\mathrm{M}_\odot\)</span> of material in their outer hydrogen envelope (remember the core of an evolved star is made of helium or carbon/oxygen/neon). This prevents us showing the post-AGB phase which is a bit messy and we avoid the white-dwarf cooling track.</p> <div class="nbinput docutils container"> @@ -673,9 +589,9 @@ Foreach_star(star) adding: parse_function=<function parse_function at 0x14bf2250fdc0> to grid_options </pre></div></div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now that we configured all the main parts of the population object, we can actually run the population! Doing this is straightforward: <code class="docutils literal notranslate"><span class="pre">population.evolve()</span></code></p> <p>This will start up the processing of all the systems. We can control how many cores are used by settings <code class="docutils literal notranslate"><span class="pre">num_cores</span></code>. By setting the <code class="docutils literal notranslate"><span class="pre">verbosity</span></code> of the population object to a higher value we can get a lot of verbose information about the run, but for now we will set it to 0.</p> <p>There are many grid_options that can lead to different behaviour of the evolution of the grid. Please do have a look at the [grid options docs] (<a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html">https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html</a>) for more details.</p> @@ -921,9 +837,9 @@ Text(0, 0.5, '$\\log_{10} (L/$L$_{☉})$') </div> </div> <p>We now have an HRD. It took longer to make the plot than to run the stars with <em>binary_c</em>!</p> -</div> -<div class="section" id="Binary-stars"> -<h2>Binary stars<a class="headerlink" href="#Binary-stars" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Binary-stars"> +<h2>Binary stars<a class="headerlink" href="#Binary-stars" title="Permalink to this headline">ïƒ</a></h2> <p>Now we put a secondary star of mass <span class="math notranslate nohighlight">\(0.5\mathrm{M}_\odot\)</span> at a distance of <span class="math notranslate nohighlight">\(10\mathrm{R}_\odot\)</span> to see how this changes things. Then we rerun the population. At such short separations, we expect mass transfer to begin on or shortly after the main sequence.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[9]: @@ -1428,62 +1344,44 @@ very start.</p> </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_common_envelope_evolution.html" class="btn btn-neutral float-right" title="Example use case: Common-envelope evolution" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_luminosity_function_binaries.html" class="btn btn-neutral float-left" title="Example use case: Zero-age stellar luminosity function in binaries" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_luminosity_function_binaries.html" class="btn btn-neutral float-left" title="Example use case: Zero-age stellar luminosity function in binaries" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_common_envelope_evolution.html" class="btn btn-neutral float-right" title="Example use case: Common-envelope evolution" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_api_functionality.html b/docs/build/html/examples/notebook_api_functionality.html index 7c160729a3ab664ef545e1c7459a630eb493a008..283da50db470ccc3ee379eefeed0d48497dc965f 100644 --- a/docs/build/html/examples/notebook_api_functionality.html +++ b/docs/build/html/examples/notebook_api_functionality.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Tutorial: Using the API functionality of binary_c-python — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Tutorial: Using the API functionality of binary_c-python — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Zero-age stellar luminosity function" href="notebook_luminosity_function_single.html" /> <link rel="prev" title="Tutorial: Extra features and functionality of binary_c-python" href="notebook_extra_features.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -117,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Tutorial: Using the API functionality of binary_c-python</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_api_functionality.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -451,8 +367,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Tutorial:-Using-the-API-functionality-of-binary_c-python"> -<h1>Tutorial: Using the API functionality of binary_c-python<a class="headerlink" href="#Tutorial:-Using-the-API-functionality-of-binary_c-python" title="Permalink to this headline">¶</a></h1> +<section id="Tutorial:-Using-the-API-functionality-of-binary_c-python"> +<h1>Tutorial: Using the API functionality of binary_c-python<a class="headerlink" href="#Tutorial:-Using-the-API-functionality-of-binary_c-python" title="Permalink to this headline">ïƒ</a></h1> <p>This notebook shows how to use the API functions that interface with binary_c. It usually is better to use wrapper functions that internally use these API functions, because most of the output here is very raw</p> <p>Binarycpython uses the Python-C extension framework to interface Python with C. The sourcecode for this is contained in <code class="docutils literal notranslate"><span class="pre">src/binary_c_python.c</span></code>, and the functions are available via <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">binarycpython</span> <span class="pre">import</span> <span class="pre">_binary_c_bindings</span></code>.</p> <p>The following functions are available through the API: (run cell below)</p> @@ -583,10 +499,10 @@ FILE </ul> </li> </ul> -<div class="section" id="Example-usage:"> -<h2>Example usage:<a class="headerlink" href="#Example-usage:" title="Permalink to this headline">¶</a></h2> -<div class="section" id="Setting-up,-using-and-freeing-store"> -<h3>Setting up, using and freeing store<a class="headerlink" href="#Setting-up,-using-and-freeing-store" title="Permalink to this headline">¶</a></h3> +<section id="Example-usage:"> +<h2>Example usage:<a class="headerlink" href="#Example-usage:" title="Permalink to this headline">ïƒ</a></h2> +<section id="Setting-up,-using-and-freeing-store"> +<h3>Setting up, using and freeing store<a class="headerlink" href="#Setting-up,-using-and-freeing-store" title="Permalink to this headline">ïƒ</a></h3> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]: </pre></div> @@ -626,9 +542,9 @@ SINGLE_STAR_LIFETIME 10 28.4838 </pre></div></div> </div> -</div> -<div class="section" id="Getting-information-from-binary_c"> -<h3>Getting information from binary_c<a class="headerlink" href="#Getting-information-from-binary_c" title="Permalink to this headline">¶</a></h3> +</section> +<section id="Getting-information-from-binary_c"> +<h3>Getting information from binary_c<a class="headerlink" href="#Getting-information-from-binary_c" title="Permalink to this headline">ïƒ</a></h3> <p>We can get information for a parameter via return_help(parameter_name): This will return an unparsed output</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]: @@ -1352,63 +1268,45 @@ MAXIMUM MASS RATIO 0.0141 </pre></div> </div> </div> -</div> -</div> -</div> +</section> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_luminosity_function_single.html" class="btn btn-neutral float-right" title="Example use case: Zero-age stellar luminosity function" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_extra_features.html" class="btn btn-neutral float-left" title="Tutorial: Extra features and functionality of binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_extra_features.html" class="btn btn-neutral float-left" title="Tutorial: Extra features and functionality of binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_luminosity_function_single.html" class="btn btn-neutral float-right" title="Example use case: Zero-age stellar luminosity function" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_common_envelope_evolution.html b/docs/build/html/examples/notebook_common_envelope_evolution.html index db07aed9370d844d334c15964dc156b3630c6bc0..06ad7e0b23b9fb4155d0a1bbab2645033b0d66a0 100644 --- a/docs/build/html/examples/notebook_common_envelope_evolution.html +++ b/docs/build/html/examples/notebook_common_envelope_evolution.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Common-envelope evolution — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Common-envelope evolution — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Binary black hole systems" href="notebook_BHBH.html" /> <link rel="prev" title="Example use case: Hertzsprung-Russell diagrams" href="notebook_HRD.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -116,70 +71,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Common-envelope evolution</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_common_envelope_evolution.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -450,8 +366,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Common-envelope-evolution"> -<h1>Example use case: Common-envelope evolution<a class="headerlink" href="#Example-use-case:-Common-envelope-evolution" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Common-envelope-evolution"> +<h1>Example use case: Common-envelope evolution<a class="headerlink" href="#Example-use-case:-Common-envelope-evolution" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we look at how common-envelope evolution (CEE) alters binary-star orbits. We construct a population of low- and intermediate-mass binaries and compare their orbital periods before and after CEE. Not all stars evolve into this phase, so we have to run a whole population to find those that do. We then have to construct the pre- and post-CEE distributions and plot them.</p> <p>First, we import a few required Python modules.</p> <div class="nbinput nblast docutils container"> @@ -468,8 +384,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>We set up a new population object. Our stars evolve to <span class="math notranslate nohighlight">\(13.7\text{ }\mathrm{Gyr}\)</span>, the age of the Universe, and we assume the metallicity <span class="math notranslate nohighlight">\(Z=0.02\)</span>. We also set the common-envelope ejection efficiency <span class="math notranslate nohighlight">\(\alpha_\mathrm{CE}=1\)</span> and the envelope structure parameter <span class="math notranslate nohighlight">\(\lambda=0.5\)</span>. More complex options are available in <em>binary_c</em>, such as <span class="math notranslate nohighlight">\(\lambda\)</span> based on stellar mass, but this is just a demonstration example so let’s keep things simple.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]: @@ -505,9 +421,9 @@ adding: alpha_ce=1.0 to BSE_options adding: lambda_ce=0.5 to BSE_options </pre></div></div> </div> -</div> -<div class="section" id="Stellar-Grid"> -<h2>Stellar Grid<a class="headerlink" href="#Stellar-Grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Stellar-Grid"> +<h2>Stellar Grid<a class="headerlink" href="#Stellar-Grid" title="Permalink to this headline">ïƒ</a></h2> <p>We now construct a grid of stars, varying the mass from <span class="math notranslate nohighlight">\(1\)</span> to <span class="math notranslate nohighlight">\(6\text{ }\mathrm{M}_\odot\)</span>. We avoid massive stars for now, and focus on the (more common) low- and intermediate-mass stars. We also limit the period range to <span class="math notranslate nohighlight">\(10^4\text{ }\mathrm{d}\)</span> because systems with longer orbital periods will probably not undergo Roche-lobe overflow and hence common-envelope evolution is impossible.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]: @@ -632,9 +548,9 @@ Added grid variable: { } </pre></div></div> </div> -</div> -<div class="section" id="Logging-and-handling-the-output"> -<h2>Logging and handling the output<a class="headerlink" href="#Logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Logging-and-handling-the-output"> +<h2>Logging and handling the output<a class="headerlink" href="#Logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>We now construct the pre- and post-common envelope evolution data for the first common envelope that forms in each binary. We look at the comenv_count variable, we can see that when it increases from 0 to 1 we have found our object. If this happens, we stop evolution of the system to save CPU time.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]: @@ -773,9 +689,9 @@ if(stardata->model.comenv_count == 1 && adding: parse_function=<function parse_function at 0x149c95c56c10> to grid_options </pre></div></div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now we actually run the population. This may take a little while. You can set num_cores higher if you have a powerful machine.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]: @@ -1193,62 +1109,44 @@ Text(0, 0.5, 'Number of stars') <li><p>… and perhaps increased resolution to obtain smoother curves.</p></li> <li><p>Why do long-period systems not reach common envelope evolution?</p></li> </ul> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_BHBH.html" class="btn btn-neutral float-right" title="Example use case: Binary black hole systems" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_HRD.html" class="btn btn-neutral float-left" title="Example use case: Hertzsprung-Russell diagrams" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_HRD.html" class="btn btn-neutral float-left" title="Example use case: Hertzsprung-Russell diagrams" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_BHBH.html" class="btn btn-neutral float-right" title="Example use case: Binary black hole systems" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_custom_logging.html b/docs/build/html/examples/notebook_custom_logging.html index 1a7c3aec1edf0b655e0c57cc399143d83d0df685..ca9f13c04f79a600d3628bd8c7d850cf8dec4156 100644 --- a/docs/build/html/examples/notebook_custom_logging.html +++ b/docs/build/html/examples/notebook_custom_logging.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Tutorial: Using custom logging routines with binary_c-python — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Tutorial: Using custom logging routines with binary_c-python — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Tutorial: Running populations with binary_c-python" href="notebook_population.html" /> <link rel="prev" title="Tutorial: Running individual systems with binary_c-python" href="notebook_individual_systems.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -122,70 +77,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Tutorial: Using custom logging routines with binary_c-python</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_custom_logging.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -456,8 +372,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Tutorial:-Using-custom-logging-routines-with-binary_c-python"> -<h1>Tutorial: Using custom logging routines with binary_c-python<a class="headerlink" href="#Tutorial:-Using-custom-logging-routines-with-binary_c-python" title="Permalink to this headline">¶</a></h1> +<section id="Tutorial:-Using-custom-logging-routines-with-binary_c-python"> +<h1>Tutorial: Using custom logging routines with binary_c-python<a class="headerlink" href="#Tutorial:-Using-custom-logging-routines-with-binary_c-python" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook you’ll learn how to use the custom logging functionality</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]: @@ -486,8 +402,8 @@ div.rendered_html tbody tr:hover { </ul> <p>The custom logging functionality can be used when running systems via <code class="docutils literal notranslate"><span class="pre">run_system()</span></code>, via <code class="docutils literal notranslate"><span class="pre">Population.evolve()</span></code> and <code class="docutils literal notranslate"><span class="pre">Population.evolve_single()</span></code>, and directly via the API</p> <p>Within the logging statement we can access information from the stardata object, as well as use logical statements to determine when to log information. What we cannot do, however, is access functions that are not <em>publicly available</em>. For very elaborate printing routines it is still advised to actually hardcode the print statement into binary_c itself.</p> -<div class="section" id="Usage"> -<h2>Usage<a class="headerlink" href="#Usage" title="Permalink to this headline">¶</a></h2> +<section id="Usage"> +<h2>Usage<a class="headerlink" href="#Usage" title="Permalink to this headline">ïƒ</a></h2> <p>There are two methods to create the C-code that will be compiled: - Automatically generate the print statement and use the wrapper to generate the full function string, by using <code class="docutils literal notranslate"><span class="pre">autogen_C_logging_code</span></code> - Create your custom print statement and use the wrapper to generate the full function string, by writing out the print statement. Here the logging statement obviously has to be valid C code</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]: @@ -599,8 +515,8 @@ MY_STELLAR_DATA time=1e-06 mass=2 MY_STELLAR_DATA time=2e-06 mass=2 </pre></div></div> </div> -<div class="section" id="Using-custom-logging-with-the-population-object"> -<h3>Using custom logging with the population object<a class="headerlink" href="#Using-custom-logging-with-the-population-object" title="Permalink to this headline">¶</a></h3> +<section id="Using-custom-logging-with-the-population-object"> +<h3>Using custom logging with the population object<a class="headerlink" href="#Using-custom-logging-with-the-population-object" title="Permalink to this headline">ïƒ</a></h3> <p>Custom logging can be used for a whole population by setting the print statement (so not the entire logging script) in <code class="docutils literal notranslate"><span class="pre">C_logging_code</span></code></p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]: @@ -657,9 +573,9 @@ EXAMPLE_POST_MS 1.044654032097e+02 4.99192 4.99192 7.81395 7.51803 2 EXAMPLE_POST_MS 1.045084306856e+02 4.99191 4.99192 9.57443 7.81395 2 2 </pre></div></div> </div> -</div> -<div class="section" id="Using-custom-logging-when-running-directly-from-the-API"> -<h3>Using custom logging when running directly from the API<a class="headerlink" href="#Using-custom-logging-when-running-directly-from-the-API" title="Permalink to this headline">¶</a></h3> +</section> +<section id="Using-custom-logging-when-running-directly-from-the-API"> +<h3>Using custom logging when running directly from the API<a class="headerlink" href="#Using-custom-logging-when-running-directly-from-the-API" title="Permalink to this headline">ïƒ</a></h3> <p>When running a system directly with the API we need to manually load the custom logging into memory (via <code class="docutils literal notranslate"><span class="pre">create_and_load_logging_function</span></code>) and pass the memory address to the binary_c binding via <code class="docutils literal notranslate"><span class="pre">_binary_c_bindings.run_system(argstring,</span> <span class="pre">custom_logging_func_memaddr=custom_logging_memaddr)</span></code></p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]: @@ -718,13 +634,13 @@ MY_STELLAR_DATA 1e-06 15 MY_STELLAR_DATA 2e-06 15 </pre></div></div> </div> -</div> -</div> -<div class="section" id="Examples-of-logging-strings"> -<h2>Examples of logging strings<a class="headerlink" href="#Examples-of-logging-strings" title="Permalink to this headline">¶</a></h2> +</section> +</section> +<section id="Examples-of-logging-strings"> +<h2>Examples of logging strings<a class="headerlink" href="#Examples-of-logging-strings" title="Permalink to this headline">ïƒ</a></h2> <p>Below are some examples of logging strings</p> -<div class="section" id="Compact-object"> -<h3>Compact object<a class="headerlink" href="#Compact-object" title="Permalink to this headline">¶</a></h3> +<section id="Compact-object"> +<h3>Compact object<a class="headerlink" href="#Compact-object" title="Permalink to this headline">ïƒ</a></h3> <p>This logging will print the timestep when the star becomes a compact object. After it does, we change the maximum time to be the current time, effectively terminating the evolution</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]: @@ -775,9 +691,9 @@ SINGLE_STAR_LIFETIME 10 28.4838 EXAMPLE_LOG_CO 2.848380621869e+01 1.33469 9.1865 1.72498e-05 724.338 13 5 </pre></div></div> </div> -</div> -<div class="section" id="Logging-mass-evolution-and-the-supernova"> -<h3>Logging mass evolution and the supernova<a class="headerlink" href="#Logging-mass-evolution-and-the-supernova" title="Permalink to this headline">¶</a></h3> +</section> +<section id="Logging-mass-evolution-and-the-supernova"> +<h3>Logging mass evolution and the supernova<a class="headerlink" href="#Logging-mass-evolution-and-the-supernova" title="Permalink to this headline">ïƒ</a></h3> <p>This logging code prints the mass evolution and the moment the star goes supernova</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[9]: @@ -846,63 +762,45 @@ EXAMPLE_MASSLOSS 1.050651207308e+01 1.59452 9.34213 20 13 1 EXAMPLE_SN 1.050651207308e+01 1.59452 9.34213 20 12 13 5 1 6.55458 4.71662 6.55458 </pre></div></div> </div> -</div> -</div> -</div> +</section> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_population.html" class="btn btn-neutral float-right" title="Tutorial: Running populations with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_individual_systems.html" class="btn btn-neutral float-left" title="Tutorial: Running individual systems with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_individual_systems.html" class="btn btn-neutral float-left" title="Tutorial: Running individual systems with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_population.html" class="btn btn-neutral float-right" title="Tutorial: Running populations with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_extra_features.html b/docs/build/html/examples/notebook_extra_features.html index f5777276f69ba357045130ebe25e105006391a3a..e785bc15800ae35d5621c4ba426563ef60724f9f 100644 --- a/docs/build/html/examples/notebook_extra_features.html +++ b/docs/build/html/examples/notebook_extra_features.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Tutorial: Extra features and functionality of binary_c-python — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Tutorial: Extra features and functionality of binary_c-python — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Tutorial: Using the API functionality of binary_c-python" href="notebook_api_functionality.html" /> <link rel="prev" title="Tutorial: Running populations with binary_c-python" href="notebook_population.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -117,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Tutorial: Extra features and functionality of binary_c-python</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_extra_features.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -451,8 +367,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Tutorial:-Extra-features-and-functionality-of-binary_c-python"> -<h1>Tutorial: Extra features and functionality of binary_c-python<a class="headerlink" href="#Tutorial:-Extra-features-and-functionality-of-binary_c-python" title="Permalink to this headline">¶</a></h1> +<section id="Tutorial:-Extra-features-and-functionality-of-binary_c-python"> +<h1>Tutorial: Extra features and functionality of binary_c-python<a class="headerlink" href="#Tutorial:-Extra-features-and-functionality-of-binary_c-python" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we’ll go over some of the extra features and functionality that was not covered in the other notebooks.</p> <p>Within the module <code class="docutils literal notranslate"><span class="pre">binarycpython.utils.functions</span></code> there are many functions that can be useful when using binarycpython. We can see which functions are in there, again by using the <code class="docutils literal notranslate"><span class="pre">help()</span></code></p> <div class="nbinput nblast docutils container"> @@ -471,8 +387,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="getting-extra-information-about-binary_c-parameters"> -<h2>getting extra information about binary_c parameters<a class="headerlink" href="#getting-extra-information-about-binary_c-parameters" title="Permalink to this headline">¶</a></h2> +<section id="getting-extra-information-about-binary_c-parameters"> +<h2>getting extra information about binary_c parameters<a class="headerlink" href="#getting-extra-information-about-binary_c-parameters" title="Permalink to this headline">ïƒ</a></h2> <p>There are several functions that can be used to get information about the parameters in binary_c:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">get_help(parameter)</span></code>: Function to get information about the specific input parameter. Prints the output on default but returns a dictionary containing the information.</p></li> @@ -543,9 +459,9 @@ default: </pre></div> </div> </div> -</div> -<div class="section" id="Build-information-of-binary_c"> -<h2>Build information of binary_c<a class="headerlink" href="#Build-information-of-binary_c" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Build-information-of-binary_c"> +<h2>Build information of binary_c<a class="headerlink" href="#Build-information-of-binary_c" title="Permalink to this headline">ïƒ</a></h2> <p>Sometimes we want to know with which settings binary_c has been built. We can use the function <code class="docutils literal notranslate"><span class="pre">return_binary_c_version_info</span></code> for this. This function will parse the version info of binary_c and return a dictionary with all the settings.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]: @@ -565,9 +481,9 @@ default: dict_keys(['networks', 'isotopes', 'argpairs', 'ensembles', 'ensemble_filters', 'macros', 'elements', 'dt_limits', 'nucleosynthesis_sources', 'miscellaneous']) </pre></div></div> </div> -</div> -<div class="section" id="Example-parse-function"> -<h2>Example parse function<a class="headerlink" href="#Example-parse-function" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Example-parse-function"> +<h2>Example parse function<a class="headerlink" href="#Example-parse-function" title="Permalink to this headline">ïƒ</a></h2> <p>TODO: In the functions module there is an example parse function that can be used in conjunction with run_system.</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: @@ -578,18 +494,18 @@ dict_keys(['networks', 'isotopes', 'argpairs', 'ense </pre></div> </div> </div> -</div> -<div class="section" id="Dictionary-modification"> -<h2>Dictionary modification<a class="headerlink" href="#Dictionary-modification" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Dictionary-modification"> +<h2>Dictionary modification<a class="headerlink" href="#Dictionary-modification" title="Permalink to this headline">ïƒ</a></h2> <ul class="simple"> <li><p>merge_dicts</p></li> <li><p>update_dicts</p></li> <li><p>multiply_values_dict</p></li> </ul> <p>TODO:</p> -</div> -<div class="section" id="Getting-help"> -<h2>Getting help<a class="headerlink" href="#Getting-help" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Getting-help"> +<h2>Getting help<a class="headerlink" href="#Getting-help" title="Permalink to this headline">ïƒ</a></h2> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: </pre></div> @@ -599,62 +515,44 @@ dict_keys(['networks', 'isotopes', 'argpairs', 'ense </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_api_functionality.html" class="btn btn-neutral float-right" title="Tutorial: Using the API functionality of binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_population.html" class="btn btn-neutral float-left" title="Tutorial: Running populations with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_population.html" class="btn btn-neutral float-left" title="Tutorial: Running populations with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_api_functionality.html" class="btn btn-neutral float-right" title="Tutorial: Using the API functionality of binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_individual_systems.html b/docs/build/html/examples/notebook_individual_systems.html index 2a625cf718883d83f6781defbd434f7d6eeb70f9..aef12e948bc5e109e461d17f30b6c46b03853409 100644 --- a/docs/build/html/examples/notebook_individual_systems.html +++ b/docs/build/html/examples/notebook_individual_systems.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Tutorial: Running individual systems with binary_c-python — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Tutorial: Running individual systems with binary_c-python — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Tutorial: Using custom logging routines with binary_c-python" href="notebook_custom_logging.html" /> <link rel="prev" title="Example notebooks" href="../example_notebooks.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -115,70 +70,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Tutorial: Running individual systems with binary_c-python</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_individual_systems.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -449,12 +365,12 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Tutorial:-Running-individual-systems-with-binary_c-python"> -<h1>Tutorial: Running individual systems with binary_c-python<a class="headerlink" href="#Tutorial:-Running-individual-systems-with-binary_c-python" title="Permalink to this headline">¶</a></h1> +<section id="Tutorial:-Running-individual-systems-with-binary_c-python"> +<h1>Tutorial: Running individual systems with binary_c-python<a class="headerlink" href="#Tutorial:-Running-individual-systems-with-binary_c-python" title="Permalink to this headline">ïƒ</a></h1> <p>This notebook will show you how to run single systems and analyze their results.</p> <p>It can be useful to have some functions to quickly run a single system to, for example, inspect what evolutionary steps a specific system goes through, to plot the mass loss evolution of a single system, etc.</p> -<div class="section" id="Single-system-with-run_system_wrapper"> -<h2>Single system with run_system_wrapper<a class="headerlink" href="#Single-system-with-run_system_wrapper" title="Permalink to this headline">¶</a></h2> +<section id="Single-system-with-run_system_wrapper"> +<h2>Single system with run_system_wrapper<a class="headerlink" href="#Single-system-with-run_system_wrapper" title="Permalink to this headline">ïƒ</a></h2> <p>The simplest method to run a single system is to use the run_system wrapper. This function deals with setting up the argument string, makes sure all the required parameters are included and handles setting and cleaning up the custom logging functionality (see notebook_custom_logging).</p> <p>As arguments to this function we can add any of the parameters that binary_c itself actually knows, as well as:</p> <ul class="simple"> @@ -655,9 +571,9 @@ EXAMPLE_MASSLOSS 2.000000000000e-06 1 1 1 [1349 rows x 4 columns] </pre></div></div> </div> -</div> -<div class="section" id="Single-system-via-population-object"> -<h2>Single system via population object<a class="headerlink" href="#Single-system-via-population-object" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Single-system-via-population-object"> +<h2>Single system via population object<a class="headerlink" href="#Single-system-via-population-object" title="Permalink to this headline">ïƒ</a></h2> <p>When setting up your population object (see notebook_population), and configuring all the parameters, it is possible to run a single system using that same configuration. It will use the parse_function if set, and running a single system is a good method to test if everything works accordingly.</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]: @@ -848,9 +764,9 @@ Removed /tmp/binary_c_python-izzard/custom_logging/libcustom_logging_0639ee205c7 dict_keys(['time', 'mass', 'initial_mass', 'stellar_type']) </pre></div></div> </div> -</div> -<div class="section" id="Single-system-via-API-functionality"> -<h2>Single system via API functionality<a class="headerlink" href="#Single-system-via-API-functionality" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Single-system-via-API-functionality"> +<h2>Single system via API functionality<a class="headerlink" href="#Single-system-via-API-functionality" title="Permalink to this headline">ïƒ</a></h2> <p>It is possible to construct your own functionality to run a single system by directly calling the API function to run a system. Under the hood all the other functions and wrappers actually use this API.</p> <p>There are fewer failsafes for this method, so this make sure the input is correct and binary_c knows all the arguments you pass in.</p> <p>for more details on this API function see <code class="docutils literal notranslate"><span class="pre">notebook_api_functions</span></code></p> @@ -901,62 +817,44 @@ SINGLE_STAR_LIFETIME 15 14.9927 </pre></div></div> </div> <p>As we can see above, the output is rather empty. But if SINGLE_STAR_LIFETIME is printed we know we caught the output correctly. To get actual output we should have timesteps printed in the <code class="docutils literal notranslate"><span class="pre">log_every_timestep.c</span></code> in binary_c, or add some custom_logging (see notebook_custom_logging).</p> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_custom_logging.html" class="btn btn-neutral float-right" title="Tutorial: Using custom logging routines with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="../example_notebooks.html" class="btn btn-neutral float-left" title="Example notebooks" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="../example_notebooks.html" class="btn btn-neutral float-left" title="Example notebooks" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_custom_logging.html" class="btn btn-neutral float-right" title="Tutorial: Using custom logging routines with binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_luminosity_function_binaries.html b/docs/build/html/examples/notebook_luminosity_function_binaries.html index b5057f5d5f3674c73a2f49f6f497979c4dcb8311..53c49985a4918d9cca82bb93a5d86ed417d0f963 100644 --- a/docs/build/html/examples/notebook_luminosity_function_binaries.html +++ b/docs/build/html/examples/notebook_luminosity_function_binaries.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Zero-age stellar luminosity function in binaries — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Zero-age stellar luminosity function in binaries — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Hertzsprung-Russell diagrams" href="notebook_HRD.html" /> <link rel="prev" title="Example use case: Zero-age stellar luminosity function" href="notebook_luminosity_function_single.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -116,70 +71,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Zero-age stellar luminosity function in binaries</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_luminosity_function_binaries.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -450,8 +366,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Zero-age-stellar-luminosity-function-in-binaries"> -<h1>Example use case: Zero-age stellar luminosity function in binaries<a class="headerlink" href="#Example-use-case:-Zero-age-stellar-luminosity-function-in-binaries" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Zero-age-stellar-luminosity-function-in-binaries"> +<h1>Example use case: Zero-age stellar luminosity function in binaries<a class="headerlink" href="#Example-use-case:-Zero-age-stellar-luminosity-function-in-binaries" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we compute the luminosity function of the zero-age main-sequence by running a population of binary stars using binary_c.</p> <p>Before you go through this notebook, you should look at notebook_luminosity_function.ipynb which is for the - conceptually more simple - single stars.</p> <p>We start by loading in some standard Python modules and the binary_c module.</p> @@ -468,8 +384,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>To set up and configure the population object we need to make a new instance of the <code class="docutils literal notranslate"><span class="pre">Population</span></code> object and configure it with the <code class="docutils literal notranslate"><span class="pre">.set()</span></code> function.</p> <p>In our case, we only need to set the maximum evolution time to something short, because we care only about zero-age main sequence stars which have, by definition, age zero.</p> <div class="nbinput docutils container"> @@ -506,9 +422,9 @@ adding: max_evolution_time=0.1 to BSE_options verbosity is 1 </pre></div></div> </div> -</div> -<div class="section" id="Adding-grid-variables"> -<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Adding-grid-variables"> +<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">ïƒ</a></h2> <p>The main purpose of the Population object is to handle the population synthesis side of running a set of stars. The main method to do this with binarycpython, as is the case with Perl binarygrid, is to use grid variables. These are loops over a predefined range of values, where a probability will be assigned to the systems based on the chosen probability distributions.</p> <p>Usually we use either 1 mass grid variable, or a trio of mass, mass ratio and period (other notebooks cover these examples). We can, however, also add grid sampling for e.g. eccentricity, metallicity or other parameters.</p> <p>To add a grid variable to the population object we use <code class="docutils literal notranslate"><span class="pre">population.add_grid_variable</span></code></p> @@ -615,9 +531,9 @@ verbosity is 1 </pre></div> </div> </div> -</div> -<div class="section" id="Setting-logging-and-handling-the-output"> -<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Setting-logging-and-handling-the-output"> +<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>By default, binary_c will not output anything (except for ‘SINGLE STAR LIFETIME’). It is up to us to determine what will be printed. We can either do that by hardcoding the print statements into <code class="docutils literal notranslate"><span class="pre">binary_c</span></code> (see documentation binary_c) or we can use the custom logging functionality of binarycpython (see notebook <code class="docutils literal notranslate"><span class="pre">notebook_custom_logging.ipynb</span></code>), which is faster to set up and requires no recompilation of binary_c, but is somewhat more limited in its functionality. For our current purposes, it works perfectly well.</p> <p>After configuring what will be printed, we need to make a function to parse the output. This can be done by setting the parse_function parameter in the population object (see also notebook <code class="docutils literal notranslate"><span class="pre">notebook_individual_systems.ipynb</span></code>).</p> @@ -743,9 +659,9 @@ works perfectly well.</p> </pre></div> </div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now that we configured all the main parts of the population object, we can actually run the population! Doing this is straightforward: <code class="docutils literal notranslate"><span class="pre">population.evolve()</span></code></p> <p>This will start up the processing of all the systems. We can control how many cores are used by settings <code class="docutils literal notranslate"><span class="pre">num_cores</span></code>. By setting the <code class="docutils literal notranslate"><span class="pre">verbosity</span></code> of the population object to a higher value we can get a lot of verbose information about the run, but for now we will set it to 0.</p> <p>There are many grid_options that can lead to different behaviour of the evolution of the grid. Please do have a look at those: <a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html">grid options docs</a>, and try</p> @@ -1260,62 +1176,44 @@ Done population run! </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_HRD.html" class="btn btn-neutral float-right" title="Example use case: Hertzsprung-Russell diagrams" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_luminosity_function_single.html" class="btn btn-neutral float-left" title="Example use case: Zero-age stellar luminosity function" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_luminosity_function_single.html" class="btn btn-neutral float-left" title="Example use case: Zero-age stellar luminosity function" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_HRD.html" class="btn btn-neutral float-right" title="Example use case: Hertzsprung-Russell diagrams" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_luminosity_function_single.html b/docs/build/html/examples/notebook_luminosity_function_single.html index f673d52dc325a4b712295436b2bc70ff0a3b7a7f..e83c1d5a4f6772e3c039706adb1fb936c359f8cc 100644 --- a/docs/build/html/examples/notebook_luminosity_function_single.html +++ b/docs/build/html/examples/notebook_luminosity_function_single.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Zero-age stellar luminosity function — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Zero-age stellar luminosity function — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Zero-age stellar luminosity function in binaries" href="notebook_luminosity_function_binaries.html" /> <link rel="prev" title="Tutorial: Using the API functionality of binary_c-python" href="notebook_api_functionality.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -118,70 +73,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Zero-age stellar luminosity function</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_luminosity_function_single.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -452,8 +368,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Zero-age-stellar-luminosity-function"> -<h1>Example use case: Zero-age stellar luminosity function<a class="headerlink" href="#Example-use-case:-Zero-age-stellar-luminosity-function" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Zero-age-stellar-luminosity-function"> +<h1>Example use case: Zero-age stellar luminosity function<a class="headerlink" href="#Example-use-case:-Zero-age-stellar-luminosity-function" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we compute the luminosity function of the zero-age main-sequence by running a population of single stars using binary_c.</p> <p>We start by loading in some standard Python modules and the binary_c module.</p> <div class="nbinput nblast docutils container"> @@ -474,8 +390,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>To set up and configure the population object we need to make a new instance of the <code class="docutils literal notranslate"><span class="pre">Population</span></code> object and configure it with the <code class="docutils literal notranslate"><span class="pre">.set()</span></code> function.</p> <p>In our case, we only need to set the maximum evolution time to something short, because we care only about zero-age main sequence stars which have, by definition, age zero.</p> <div class="nbinput docutils container"> @@ -514,9 +430,9 @@ adding: tmp_dir=/tmp/binary_c_python-izzard/notebooks/notebook_luminosity to gri verbosity is 1 </pre></div></div> </div> -</div> -<div class="section" id="Adding-grid-variables"> -<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Adding-grid-variables"> +<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">ïƒ</a></h2> <p>The main purpose of the Population object is to handle the population synthesis side of running a set of stars. The main method to do this with binarycpython, as is the case with Perl binarygrid, is to use grid variables. These are loops over a predefined range of values, where a probability will be assigned to the systems based on the chosen probability distributions.</p> <p>Usually we use either 1 mass grid variable, or a trio of mass, mass ratio and period (other notebooks cover these examples). We can, however, also add grid sampling for e.g. eccentricity, metallicity or other parameters.</p> <p>To add a grid variable to the population object we use <code class="docutils literal notranslate"><span class="pre">population.add_grid_variable</span></code></p> @@ -603,9 +519,9 @@ verbosity is 1 <span class="ansi-red-fg">TypeError</span>: add_grid_variable() got an unexpected keyword argument 'resolution' </pre></div></div> </div> -</div> -<div class="section" id="Setting-logging-and-handling-the-output"> -<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Setting-logging-and-handling-the-output"> +<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>By default, binary_c will not output anything (except for ‘SINGLE STAR LIFETIME’). It is up to us to determine what will be printed. We can either do that by hardcoding the print statements into <code class="docutils literal notranslate"><span class="pre">binary_c</span></code> (see documentation binary_c) or we can use the custom logging functionality of binarycpython (see notebook <code class="docutils literal notranslate"><span class="pre">notebook_custom_logging.ipynb</span></code>), which is faster to set up and requires no recompilation of binary_c, but is somewhat more limited in its functionality. For our current purposes, it works perfectly well.</p> <p>After configuring what will be printed, we need to make a function to parse the output. This can be done by setting the parse_function parameter in the population object (see also notebook <code class="docutils literal notranslate"><span class="pre">notebook_individual_systems.ipynb</span></code>).</p> @@ -691,9 +607,9 @@ works perfectly well.</p> </pre></div> </div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now that we configured all the main parts of the population object, we can actually run the population! Doing this is straightforward: <code class="docutils literal notranslate"><span class="pre">population.evolve()</span></code></p> <p>This will start up the processing of all the systems. We can control how many cores are used by settings <code class="docutils literal notranslate"><span class="pre">num_cores</span></code>. By setting the <code class="docutils literal notranslate"><span class="pre">verbosity</span></code> of the population object to a higher value we can get a lot of verbose information about the run, but for now we will set it to 0.</p> <p>There are many grid_options that can lead to different behaviour of the evolution of the grid. Please do have a look at those: <a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html">grid options docs</a>, and try</p> @@ -764,9 +680,9 @@ works perfectly well.</p> </div> </div> <p>Does this look like a reasonable stellar luminosity function to you? The implication is that the most likely stellar luminosity is 105.8 L☉! Clearly, this is not very realistic… let’s see what went wrong.</p> -</div> -<div class="section" id="ZAMS-Luminosity-distribution-with-the-initial-mass-function"> -<h2>ZAMS Luminosity distribution with the initial mass function<a class="headerlink" href="#ZAMS-Luminosity-distribution-with-the-initial-mass-function" title="Permalink to this headline">¶</a></h2> +</section> +<section id="ZAMS-Luminosity-distribution-with-the-initial-mass-function"> +<h2>ZAMS Luminosity distribution with the initial mass function<a class="headerlink" href="#ZAMS-Luminosity-distribution-with-the-initial-mass-function" title="Permalink to this headline">ïƒ</a></h2> <p>In the previous example, all the stars in our grid had an equal weighting. This is very unlikely to be true in reality: indeed, we know that low mass stars are far more likely than high mass stars. So we now include an initial mass function as a three-part power law based on Kroupa (2001). Kroupa’s distribution is a three-part power law: we have a function that does this for us (it’s very common to use power laws in astrophysics).</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: @@ -821,9 +737,9 @@ works perfectly well.</p> <p>This distribution is peaked at low luminosity, as one expects from observations, but the resolution is clearly not great because it’s not smooth - it’s spiky!</p> <p>If you noticed above, the total probability of the grid was about 0.2. Given that the total probability of a probability distribution function should be 1.0, this shows that our sampling is (very) poor.</p> <p>We could simply increase the resolution to compensate, but this is very CPU intensive and a complete waste of time and resources. Instead, let’s try sampling the masses of the stars in a smarter way.</p> -</div> -<div class="section" id="A-better-sampled-grid"> -<h2>A better-sampled grid<a class="headerlink" href="#A-better-sampled-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="A-better-sampled-grid"> +<h2>A better-sampled grid<a class="headerlink" href="#A-better-sampled-grid" title="Permalink to this headline">ïƒ</a></h2> <p>The IMF has many more low-mass stars than high-mass stars. So, instead of sampling M1 linearly, we can sample it in log space.</p> <p>To do this we first rename the mass grid variable so that it is clear we are working in (natural) logarithmic phase space.</p> <div class="nbinput nblast docutils container"> @@ -917,62 +833,44 @@ works perfectly well.</p> </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_luminosity_function_binaries.html" class="btn btn-neutral float-right" title="Example use case: Zero-age stellar luminosity function in binaries" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_api_functionality.html" class="btn btn-neutral float-left" title="Tutorial: Using the API functionality of binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_api_functionality.html" class="btn btn-neutral float-left" title="Tutorial: Using the API functionality of binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_luminosity_function_binaries.html" class="btn btn-neutral float-right" title="Example use case: Zero-age stellar luminosity function in binaries" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_massive_remnants.html b/docs/build/html/examples/notebook_massive_remnants.html index e0190479479d76aba5c16fb0ecfed4813aba985b..be8de7d8d6aafe43be3a427fafd927dfc6d65824 100644 --- a/docs/build/html/examples/notebook_massive_remnants.html +++ b/docs/build/html/examples/notebook_massive_remnants.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Massive star luminosity — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Massive star luminosity — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example use case: Solar system using the API functionality" href="notebook_solar_system.html" /> <link rel="prev" title="Example use case: Binary black hole systems" href="notebook_BHBH.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -118,70 +73,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Massive star luminosity</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_massive_remnants.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -452,8 +368,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Massive-star-luminosity"> -<h1>Example use case: Massive star luminosity<a class="headerlink" href="#Example-use-case:-Massive-star-luminosity" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Massive-star-luminosity"> +<h1>Example use case: Massive star luminosity<a class="headerlink" href="#Example-use-case:-Massive-star-luminosity" title="Permalink to this headline">ïƒ</a></h1> <p>In this notebook we compute the luminosity function of the zero-age main-sequence by running a population of single stars using binary_c.</p> <p>We start by loading in some standard Python modules and the binary_c module.</p> <div class="nbinput nblast docutils container"> @@ -474,8 +390,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>To set up and configure the population object we need to make a new instance of the <code class="docutils literal notranslate"><span class="pre">Population</span></code> object and configure it with the <code class="docutils literal notranslate"><span class="pre">.set()</span></code> function.</p> <p>In our case, we only need to set the maximum evolution time to something short, because we care only about zero-age main sequence stars which have, by definition, age zero.</p> <div class="nbinput docutils container"> @@ -514,9 +430,9 @@ adding: tmp_dir=/tmp/binary_c_python-izzard/notebooks/notebook_luminosity to gri verbosity is 1 </pre></div></div> </div> -</div> -<div class="section" id="Adding-grid-variables"> -<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Adding-grid-variables"> +<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">ïƒ</a></h2> <p>The main purpose of the Population object is to handle the population synthesis side of running a set of stars. The main method to do this with binarycpython, as is the case with Perl binarygrid, is to use grid variables. These are loops over a predefined range of values, where a probability will be assigned to the systems based on the chosen probability distributions.</p> <p>Usually we use either 1 mass grid variable, or a trio of mass, mass ratio and period (other notebooks cover these examples). We can, however, also add grid sampling for e.g. eccentricity, metallicity or other parameters.</p> <p>To add a grid variable to the population object we use <code class="docutils literal notranslate"><span class="pre">population.add_grid_variable</span></code></p> @@ -586,9 +502,9 @@ verbosity is 1 </pre></div> </div> </div> -</div> -<div class="section" id="Setting-logging-and-handling-the-output"> -<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Setting-logging-and-handling-the-output"> +<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>By default, binary_c will not output anything (except for ‘SINGLE STAR LIFETIME’). It is up to us to determine what will be printed. We can either do that by hardcoding the print statements into <code class="docutils literal notranslate"><span class="pre">binary_c</span></code> (see documentation binary_c) or we can use the custom logging functionality of binarycpython (see notebook <code class="docutils literal notranslate"><span class="pre">notebook_custom_logging.ipynb</span></code>), which is faster to set up and requires no recompilation of binary_c, but is somewhat more limited in its functionality. For our current purposes, it works perfectly well.</p> <p>After configuring what will be printed, we need to make a function to parse the output. This can be done by setting the parse_function parameter in the population object (see also notebook <code class="docutils literal notranslate"><span class="pre">notebook_individual_systems.ipynb</span></code>).</p> @@ -674,9 +590,9 @@ works perfectly well.</p> </pre></div> </div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now that we configured all the main parts of the population object, we can actually run the population! Doing this is straightforward: <code class="docutils literal notranslate"><span class="pre">population.evolve()</span></code></p> <p>This will start up the processing of all the systems. We can control how many cores are used by settings <code class="docutils literal notranslate"><span class="pre">num_cores</span></code>. By setting the <code class="docutils literal notranslate"><span class="pre">verbosity</span></code> of the population object to a higher value we can get a lot of verbose information about the run, but for now we will set it to 0.</p> <p>There are many grid_options that can lead to different behaviour of the evolution of the grid. Please do have a look at those: <a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html">grid options docs</a>, and try</p> @@ -796,9 +712,9 @@ There were no errors found in this run. </div> </div> <p>Does this look like a reasonable stellar luminosity function to you? The implication is that the most likely stellar luminosity is 105.8 L☉! Clearly, this is not very realistic… let’s see what went wrong.</p> -</div> -<div class="section" id="ZAMS-Luminosity-distribution-with-the-initial-mass-function"> -<h2>ZAMS Luminosity distribution with the initial mass function<a class="headerlink" href="#ZAMS-Luminosity-distribution-with-the-initial-mass-function" title="Permalink to this headline">¶</a></h2> +</section> +<section id="ZAMS-Luminosity-distribution-with-the-initial-mass-function"> +<h2>ZAMS Luminosity distribution with the initial mass function<a class="headerlink" href="#ZAMS-Luminosity-distribution-with-the-initial-mass-function" title="Permalink to this headline">ïƒ</a></h2> <p>In the previous example, all the stars in our grid had an equal weighting. This is very unlikely to be true in reality: indeed, we know that low mass stars are far more likely than high mass stars. So we now include an initial mass function as a three-part power law based on Kroupa (2001). Kroupa’s distribution is a three-part power law: we have a function that does this for us (it’s very common to use power laws in astrophysics).</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]: @@ -894,9 +810,9 @@ There were no errors found in this run. <p>This distribution is peaked at low luminosity, as one expects from observations, but the resolution is clearly not great because it’s not smooth - it’s spiky!</p> <p>If you noticed above, the total probability of the grid was about 0.2. Given that the total probability of a probability distribution function should be 1.0, this shows that our sampling is (very) poor.</p> <p>We could simply increase the resolution to compensate, but this is very CPU intensive and a complete waste of time and resources. Instead, let’s try sampling the masses of the stars in a smarter way.</p> -</div> -<div class="section" id="A-better-sampled-grid"> -<h2>A better-sampled grid<a class="headerlink" href="#A-better-sampled-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="A-better-sampled-grid"> +<h2>A better-sampled grid<a class="headerlink" href="#A-better-sampled-grid" title="Permalink to this headline">ïƒ</a></h2> <p>The IMF has many more low-mass stars than high-mass stars. So, instead of sampling M1 linearly, we can sample it in log space.</p> <p>To do this we first rename the mass grid variable so that it is clear we are working in (natural) logarithmic phase space.</p> <div class="nbinput nblast docutils container"> @@ -1022,62 +938,44 @@ There were no errors found in this run. </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_solar_system.html" class="btn btn-neutral float-right" title="Example use case: Solar system using the API functionality" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_BHBH.html" class="btn btn-neutral float-left" title="Example use case: Binary black hole systems" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_BHBH.html" class="btn btn-neutral float-left" title="Example use case: Binary black hole systems" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_solar_system.html" class="btn btn-neutral float-right" title="Example use case: Solar system using the API functionality" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_population.html b/docs/build/html/examples/notebook_population.html index cab0c66b4126a9371c6cc93890cef247cad6e14e..7cb4abd737439490978a93fe502bdbce94649c46 100644 --- a/docs/build/html/examples/notebook_population.html +++ b/docs/build/html/examples/notebook_population.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Tutorial: Running populations with binary_c-python — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Tutorial: Running populations with binary_c-python — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Tutorial: Extra features and functionality of binary_c-python" href="notebook_extra_features.html" /> <link rel="prev" title="Tutorial: Using custom logging routines with binary_c-python" href="notebook_custom_logging.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -118,70 +73,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Tutorial: Running populations with binary_c-python</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_population.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -452,8 +368,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Tutorial:-Running-populations-with-binary_c-python"> -<h1>Tutorial: Running populations with binary_c-python<a class="headerlink" href="#Tutorial:-Running-populations-with-binary_c-python" title="Permalink to this headline">¶</a></h1> +<section id="Tutorial:-Running-populations-with-binary_c-python"> +<h1>Tutorial: Running populations with binary_c-python<a class="headerlink" href="#Tutorial:-Running-populations-with-binary_c-python" title="Permalink to this headline">ïƒ</a></h1> <p>This notebook will show you how to evolve a population of stars</p> <p>Much of the code in the binarycpython package is written to evolve a population of stars through the Population object, rather than running a single system. Let’s go through the functionality of this object step by step and set up some example populations.</p> <p>At the bottom of this notebook there are some complete example scripts</p> @@ -473,8 +389,8 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Setting-up-the-Population-object"> -<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">¶</a></h2> +<section id="Setting-up-the-Population-object"> +<h2>Setting up the Population object<a class="headerlink" href="#Setting-up-the-Population-object" title="Permalink to this headline">ïƒ</a></h2> <p>To set up and configure the population object we need to make an object instance of the <code class="docutils literal notranslate"><span class="pre">Population</span></code> object, and add configuration via the <code class="docutils literal notranslate"><span class="pre">.set()</span></code> function.</p> <p>There are three categories of options that the Population object can set: - BSE options: these options will be used for the binary_c calls, and are recognized by comparing the arguments to a known list of available arguments of binary_c. To see which options are available, see section <code class="docutils literal notranslate"><span class="pre">`binary_c</span> <span class="pre">parameters</span></code> in the documentation <<a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/binary_c_parameters.html">https://ri0005.pages.surrey.ac.uk/binary_c-python/binary_c_parameters.html</a>>`__. You can access these through <code class="docutils literal notranslate"><span class="pre">population.bse_options['<bse</span> <span class="pre">option</span> <span class="pre">name>']</span></code> after you have set them.</p> @@ -576,9 +492,9 @@ Writing settings to /tmp/binary_c_python-izzard/notebooks/notebook_population/ex '/tmp/binary_c_python-izzard/notebooks/notebook_population/example_python_population_result/example_pop_settings.json' </pre></div></div> </div> -</div> -<div class="section" id="Adding-grid-variables"> -<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Adding-grid-variables"> +<h2>Adding grid variables<a class="headerlink" href="#Adding-grid-variables" title="Permalink to this headline">ïƒ</a></h2> <p>The main purpose of the Population object is to handle the population synthesis side of running a set of stars. The main method to do this with binarycpython, as is the case with Perl binarygrid, is to use grid variables. These are loops over a predefined range of values, where a probability will be assigned to the systems based on the chosen probability distributions.</p> <p>Usually we use either 1 mass grid variable, or a trio of mass, mass ratio and period (See below for full examples of all of these). We can, however, also add grid sampling for e.g. eccentricity, metallicity or other parameters.</p> <p>In some cases it could be easier to set up a for loop that sets that parameter and calls the evolve function several times, e.g. when you want to vary a prescription (usually a discrete, unweighted parameter)</p> @@ -778,9 +694,9 @@ Added grid variable: { } </pre></div></div> </div> -</div> -<div class="section" id="Setting-logging-and-handling-the-output"> -<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Setting-logging-and-handling-the-output"> +<h2>Setting logging and handling the output<a class="headerlink" href="#Setting-logging-and-handling-the-output" title="Permalink to this headline">ïƒ</a></h2> <p>On default, binary_c will not output anything (except for ‘SINGLE STAR LIFETIME’). It is up to us to determine what will be printed. We can either do that by hardcoding the print statements into <code class="docutils literal notranslate"><span class="pre">binary_c</span></code> (see documentation binary_c). Or, we can use the custom logging functionality of binarycpython (see notebook <code class="docutils literal notranslate"><span class="pre">notebook_custom_logging.ipynb</span></code>), which is faster to set up and requires no recompilation of binary_c, but is somewhat more limited in its functionality.</p> <p>After configuring what will be printed, we need to make a function to parse the output. This can be done by setting the parse_function parameter in the population object (see also notebook <code class="docutils literal notranslate"><span class="pre">notebook_individual_systems.ipynb</span></code>).</p> <p>In the code below we will set up both the custom logging, and a parse function to handle that output</p> @@ -900,9 +816,9 @@ if(stardata->star[0].stellar_type >= 13) adding: parse_function=<function parse_function at 0x1528ac7290d0> to grid_options </pre></div></div> </div> -</div> -<div class="section" id="Evolving-the-grid"> -<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Evolving-the-grid"> +<h2>Evolving the grid<a class="headerlink" href="#Evolving-the-grid" title="Permalink to this headline">ïƒ</a></h2> <p>Now that we configured all the main parts of the population object, we can actually run the population! Doing this is straightforward: <code class="docutils literal notranslate"><span class="pre">example_pop.evolve()</span></code></p> <p>This will start up the processing of all the systems. We can control how many cores are used by settings <code class="docutils literal notranslate"><span class="pre">num_cores</span></code>. By setting the <code class="docutils literal notranslate"><span class="pre">verbosity</span></code> of the population object to a higher value we can get a lot of verbose information about the run, but for now we will set it to 0.</p> <p>There are many grid_options that can lead to different behaviour of the evolution of the grid. Please do have a look at those: <a class="reference external" href="https://ri0005.pages.surrey.ac.uk/binary_c-python/grid_options_descriptions.html">grid options docs</a>, and try</p> @@ -978,9 +894,9 @@ There were no errors found in this run. {'population_name': '50fb66cc659c46c8bbc29fe0c8651c2f', 'evolution_type': 'grid', 'failed_count': 0, 'failed_prob': 0, 'failed_systems_error_codes': [], 'errors_exceeded': False, 'errors_found': False, 'total_probability': 0.04440288843805411, 'total_count': 20, 'start_timestamp': 1635760967.3245144, 'end_timestamp': 1635760970.6249793, 'total_mass_run': 684.2544031669784, 'total_probability_weighted_mass_run': 0.28134439269236855, 'zero_prob_stars_skipped': 0} </pre></div></div> </div> -</div> -<div class="section" id="Noteworthy-functionality"> -<h2>Noteworthy functionality<a class="headerlink" href="#Noteworthy-functionality" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Noteworthy-functionality"> +<h2>Noteworthy functionality<a class="headerlink" href="#Noteworthy-functionality" title="Permalink to this headline">ïƒ</a></h2> <p>Some extra features that are available from via the population object are: - write_binary_c_calls_to_file: Function to write the calls that would be passed to binary_c to a file</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[11]: @@ -1058,9 +974,9 @@ binary_c M_1 3.430936289925951 eccentricity 0.02 max_evolution_time 15000 orbita binary_c M_1 4.2576084265970895 eccentricity 0.02 max_evolution_time 15000 orbital_period 45000000080 phasevol 0.2158744056768156 probability 0.004698855121516281 </pre></div></div> </div> -</div> -<div class="section" id="Full-examples-of-population-scripts"> -<h2>Full examples of population scripts<a class="headerlink" href="#Full-examples-of-population-scripts" title="Permalink to this headline">¶</a></h2> +</section> +<section id="Full-examples-of-population-scripts"> +<h2>Full examples of population scripts<a class="headerlink" href="#Full-examples-of-population-scripts" title="Permalink to this headline">ïƒ</a></h2> <p>Below is a full setup for a population of single stars</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[13]: @@ -1476,62 +1392,44 @@ time mass_1 zams_mass_1 mass_2 zams_mass_2 stellar_type_1 prev_stellar_type_1 st </pre></div></div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="notebook_extra_features.html" class="btn btn-neutral float-right" title="Tutorial: Extra features and functionality of binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_custom_logging.html" class="btn btn-neutral float-left" title="Tutorial: Using custom logging routines with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_custom_logging.html" class="btn btn-neutral float-left" title="Tutorial: Using custom logging routines with binary_c-python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="notebook_extra_features.html" class="btn btn-neutral float-right" title="Tutorial: Extra features and functionality of binary_c-python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/notebook_solar_system.html b/docs/build/html/examples/notebook_solar_system.html index 3de9e7372440b9b0def60c0ff78a10ec972e95a7..a73751103015621edd6347cc1d463655b0215c1e 100644 --- a/docs/build/html/examples/notebook_solar_system.html +++ b/docs/build/html/examples/notebook_solar_system.html @@ -1,72 +1,37 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Example use case: Solar system using the API functionality — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Example use case: Solar system using the API functionality — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Binary_c parameters" href="../binary_c_parameters.html" /> <link rel="prev" title="Example use case: Massive star luminosity" href="notebook_massive_remnants.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -74,17 +39,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> @@ -110,70 +65,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../index.html">Docs</a> »</li> - + <li><a href="../index.html" class="icon icon-home"></a> »</li> <li><a href="../example_notebooks.html">Example notebooks</a> »</li> - <li>Example use case: Solar system using the API functionality</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../_sources/examples/notebook_solar_system.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -444,8 +360,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Example-use-case:-Solar-system-using-the-API-functionality"> -<h1>Example use case: Solar system using the API functionality<a class="headerlink" href="#Example-use-case:-Solar-system-using-the-API-functionality" title="Permalink to this headline">¶</a></h1> +<section id="Example-use-case:-Solar-system-using-the-API-functionality"> +<h1>Example use case: Solar system using the API functionality<a class="headerlink" href="#Example-use-case:-Solar-system-using-the-API-functionality" title="Permalink to this headline">ïƒ</a></h1> <p>We use the API interface to construct a model of the Solar system.</p> <p>First we must construct the argument string that we pass to binary_c</p> <div class="nbinput nblast docutils container"> @@ -677,61 +593,43 @@ div.rendered_html tbody tr:hover { </div> </div> <p>It gets a little toasty on Earth in the not too distant future!</p> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="../binary_c_parameters.html" class="btn btn-neutral float-right" title="Binary_c parameters" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="notebook_massive_remnants.html" class="btn btn-neutral float-left" title="Example use case: Massive star luminosity" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="notebook_massive_remnants.html" class="btn btn-neutral float-left" title="Example use case: Massive star luminosity" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="../binary_c_parameters.html" class="btn btn-neutral float-right" title="Binary_c parameters" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/old/basic_example.html b/docs/build/html/examples/old/basic_example.html index f040e8f737de1671b1ef2fa782df01fbf883b4b6..63622df570862231a348aecf7ca300d9c5be96bd 100644 --- a/docs/build/html/examples/old/basic_example.html +++ b/docs/build/html/examples/old/basic_example.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title><no title> — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title><no title> — binary_c-python documentation</title> + <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script> <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script> <script src="../../_static/jquery.js"></script> <script src="../../_static/underscore.js"></script> <script src="../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> + <script src="../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../genindex.html" /> <link rel="search" title="Search" href="../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../readme_link.html">Python module for binary_c</a></li> @@ -94,68 +49,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../index.html">Docs</a> »</li> - + <li><a href="../../index.html" class="icon icon-home"></a> »</li> <li><no title></li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../../_sources/examples/old/basic_example.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -518,48 +435,36 @@ div.rendered_html tbody tr:hover { </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/examples/old/workshop_example_notebook.html b/docs/build/html/examples/old/workshop_example_notebook.html index aab2f89ecfe98067848112a13ef2ded1f2ca6294..b7f96087ff73b0b7e7ce5a3c21fb0b5da76371bf 100644 --- a/docs/build/html/examples/old/workshop_example_notebook.html +++ b/docs/build/html/examples/old/workshop_example_notebook.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Binary_c and python example notebook — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Binary_c and python example notebook — binary_c-python documentation</title> + <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../../_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script> <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script> <script src="../../_static/jquery.js"></script> <script src="../../_static/underscore.js"></script> <script src="../../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script> - - <script type="text/javascript" src="../../_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> + <script src="../../_static/js/theme.js"></script> <link rel="index" title="Index" href="../../genindex.html" /> <link rel="search" title="Search" href="../../search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="../../index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../../readme_link.html">Python module for binary_c</a></li> @@ -94,68 +49,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="../../index.html">Docs</a> »</li> - + <li><a href="../../index.html" class="icon icon-home"></a> »</li> <li>Binary_c and python example notebook</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="../../_sources/examples/old/workshop_example_notebook.ipynb.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS for nbsphinx extension */ @@ -426,8 +343,8 @@ div.rendered_html tbody tr:hover { text-align: unset; } </style> -<div class="section" id="Binary_c-and-python-example-notebook"> -<h1>Binary_c and python example notebook<a class="headerlink" href="#Binary_c-and-python-example-notebook" title="Permalink to this headline">¶</a></h1> +<section id="Binary_c-and-python-example-notebook"> +<h1>Binary_c and python example notebook<a class="headerlink" href="#Binary_c-and-python-example-notebook" title="Permalink to this headline">ïƒ</a></h1> <p>The following notebook servers as an example of how the binary_c python wrapper works and how it could be used.</p> <p>By: David Hendriks 30 nov 2019</p> <div class="nbinput nblast docutils container"> @@ -440,10 +357,10 @@ div.rendered_html tbody tr:hover { </pre></div> </div> </div> -<div class="section" id="Core-api-wrapper-functions:"> -<h2>Core api wrapper functions:<a class="headerlink" href="#Core-api-wrapper-functions:" title="Permalink to this headline">¶</a></h2> -<div class="section" id="run_binary()"> -<h3>run_binary()<a class="headerlink" href="#run_binary()" title="Permalink to this headline">¶</a></h3> +<section id="Core-api-wrapper-functions:"> +<h2>Core api wrapper functions:<a class="headerlink" href="#Core-api-wrapper-functions:" title="Permalink to this headline">ïƒ</a></h2> +<section id="run_binary()"> +<h3>run_binary()<a class="headerlink" href="#run_binary()" title="Permalink to this headline">ïƒ</a></h3> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[17]: </pre></div> @@ -496,9 +413,9 @@ example_header_1 time=2e-07 mass_1=15 mass_2=14 st1=1 st2=1 sep=3540.3 ecc=0 example_header_2 2e-07 15 14 1 1 3540.3 0 </pre></div></div> </div> -</div> -<div class="section" id="run_binary_with_log"> -<h3>run_binary_with_log<a class="headerlink" href="#run_binary_with_log" title="Permalink to this headline">¶</a></h3> +</section> +<section id="run_binary_with_log"> +<h3>run_binary_with_log<a class="headerlink" href="#run_binary_with_log" title="Permalink to this headline">ïƒ</a></h3> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[18]: </pre></div> @@ -571,9 +488,9 @@ Probability : 1 </pre></div></div> </div> -</div> -<div class="section" id="run-binary-with-custom-logging-line"> -<h3>run binary with custom logging line<a class="headerlink" href="#run-binary-with-custom-logging-line" title="Permalink to this headline">¶</a></h3> +</section> +<section id="run-binary-with-custom-logging-line"> +<h3>run binary with custom logging line<a class="headerlink" href="#run-binary-with-custom-logging-line" title="Permalink to this headline">ïƒ</a></h3> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[19]: </pre></div> @@ -647,13 +564,13 @@ example_header_2 4e-07 15 14 1 1 3540.3 0 MY_STELLAR_DATA time=4e-07 mass=15 </pre></div></div> </div> -</div> -</div> -<div class="section" id="Using-utils-functions"> -<h2>Using utils functions<a class="headerlink" href="#Using-utils-functions" title="Permalink to this headline">¶</a></h2> +</section> +</section> +<section id="Using-utils-functions"> +<h2>Using utils functions<a class="headerlink" href="#Using-utils-functions" title="Permalink to this headline">ïƒ</a></h2> <p>In the utils.functions there are some functions that make it easier to interact with the core api functions.</p> -<div class="section" id="run_system()"> -<h3>run_system()<a class="headerlink" href="#run_system()" title="Permalink to this headline">¶</a></h3> +<section id="run_system()"> +<h3>run_system()<a class="headerlink" href="#run_system()" title="Permalink to this headline">ïƒ</a></h3> <p>This function serves as an example on the function run_system and parse_output. There is more functionality with this method and several tasks are done behind the scene.</p> <p>Requires pandas, numpy to run.</p> <p>run_system: mostly just makes passing arguments to the function easier. It also loads all the necessary defaults in the background parse_output: Takes the raw output of binary_c and selects those lines that start with the given header. Note, if you dont use the custom_logging functionality binary_c should be configured to have output that starts with that given header</p> @@ -744,9 +661,9 @@ example_header_2 2e-07 10 20 1 1 2.81762e+08 0 [3932 rows x 7 columns] </pre></div></div> </div> -</div> -<div class="section" id="run_system()-and-custom-logging"> -<h3>run_system() and custom logging<a class="headerlink" href="#run_system()-and-custom-logging" title="Permalink to this headline">¶</a></h3> +</section> +<section id="run_system()-and-custom-logging"> +<h3>run_system() and custom logging<a class="headerlink" href="#run_system()-and-custom-logging" title="Permalink to this headline">ïƒ</a></h3> <p>Function that will use a automatically generated piece of logging code. Compile it, load it into memory and run a binary system. See run_system on how several things are done in the background here.</p> <div class="nbinput docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[21]: @@ -816,10 +733,10 @@ example_header_2 2e-07 10 20 1 1 2.81762e+08 0 [3635 rows x 2 columns] </pre></div></div> </div> -</div> -</div> -<div class="section" id="Other-example"> -<h2>Other example<a class="headerlink" href="#Other-example" title="Permalink to this headline">¶</a></h2> +</section> +</section> +<section id="Other-example"> +<h2>Other example<a class="headerlink" href="#Other-example" title="Permalink to this headline">ïƒ</a></h2> <p>Checking how much mass stars lose on the main sequence.</p> <div class="nbinput nblast docutils container"> <div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]: @@ -956,53 +873,41 @@ Took 14.214274644851685s </pre></div> </div> </div> -</div> -</div> +</section> +</section> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/functions.html b/docs/build/html/functions.html index 0f5a7385ae0eb7ac889f5c2ccb778bf0684048ad..97625c708cd0dca987fed1361a50f54e0552f15f 100644 --- a/docs/build/html/functions.html +++ b/docs/build/html/functions.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>functions module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="grid_class module" href="grid.html" /> - <link rel="prev" title="distribution_functions module" href="distribution_functions.html" /> + <link rel="prev" title="functions module" href="ensemble.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>functions module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/functions.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,8 +121,8 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.functions"> -<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.functions" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.functions"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.functions" title="Permalink to this headline">ïƒ</a></h1> <p>Module containing most of the utility functions for the binarycpython package</p> <p>Functions here are mostly functions used in other classes/functions, or useful functions for the user</p> @@ -208,18 +134,18 @@ useful functions for the user</p> </dl> <dl class="py class"> <dt class="sig sig-object py" id="binarycpython.utils.functions.Capturing"> -<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">Capturing</span></span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing" title="Permalink to this definition">¶</a></dt> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">Capturing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">iterable</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">()</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">/</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p> <p>Context manager to capture output and store it</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.functions.Capturing.__enter__"> -<span class="sig-name descname"><span class="pre">__enter__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing.__enter__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing.__enter__" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">__enter__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing.__enter__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing.__enter__" title="Permalink to this definition">ïƒ</a></dt> <dd><p>On entry we capture the stdout output</p> </dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.functions.Capturing.__exit__"> -<span class="sig-name descname"><span class="pre">__exit__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing.__exit__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing.__exit__" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">__exit__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#Capturing.__exit__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.Capturing.__exit__" title="Permalink to this definition">ïƒ</a></dt> <dd><p>On exit we release the capture again</p> </dd></dl> @@ -227,14 +153,14 @@ useful functions for the user</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.bin_data"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">bin_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">binwidth</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#bin_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.bin_data" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">bin_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">binwidth</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#bin_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.bin_data" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that bins the data</p> <p>Uses the absolute value of binwidth</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.call_binary_c_config"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">call_binary_c_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argument</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#call_binary_c_config"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.call_binary_c_config" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">call_binary_c_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argument</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#call_binary_c_config"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.call_binary_c_config" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to interface with the binary_c config file</p> <dl class="simple"> <dt>input:</dt><dd><ul class="simple"> @@ -254,18 +180,18 @@ useful functions for the user</p> <dl class="py class"> <dt class="sig sig-object py" id="binarycpython.utils.functions.catchtime"> -<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">catchtime</span></span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime" title="Permalink to this definition">¶</a></dt> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">catchtime</span></span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> <p>Context manager to calculate time spent</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.functions.catchtime.__enter__"> -<span class="sig-name descname"><span class="pre">__enter__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime.__enter__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime.__enter__" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">__enter__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime.__enter__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime.__enter__" title="Permalink to this definition">ïƒ</a></dt> <dd><p>On entry we start the clock</p> </dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.functions.catchtime.__exit__"> -<span class="sig-name descname"><span class="pre">__exit__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">exc_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_tb</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime.__exit__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime.__exit__" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">__exit__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">exc_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_tb</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#catchtime.__exit__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.catchtime.__exit__" title="Permalink to this definition">ïƒ</a></dt> <dd><p>On exit we stop the clock and measure the time spent</p> </dd></dl> @@ -273,31 +199,31 @@ useful functions for the user</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.check_if_in_shell"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">check_if_in_shell</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#check_if_in_shell"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.check_if_in_shell" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">check_if_in_shell</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#check_if_in_shell"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.check_if_in_shell" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to check whether the script is running from a shell</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.conv_time_units"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">conv_time_units</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">t</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#conv_time_units"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.conv_time_units" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">conv_time_units</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">t</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#conv_time_units"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.conv_time_units" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Converts time (t, in seconds, passing in as the only argument) to seconds, minutes or hours depending on its magnitude. Returns a tuple (t,units).</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.convert_bytes"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">convert_bytes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#convert_bytes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.convert_bytes" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">convert_bytes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#convert_bytes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.convert_bytes" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to return the size + a magnitude string</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.convfloat"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">convfloat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#convfloat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.convfloat" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">convfloat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#convfloat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.convfloat" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Convert scalar x to a float if we can, in which case return the float, otherwise just return x without changing it. Usually, x is a string, but could be anything that float() can handle without failure.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.create_arg_string"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">create_arg_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#create_arg_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.create_arg_string" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">create_arg_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#create_arg_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.create_arg_string" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that creates the arg string for binary_c. Takes a dictionary containing the arguments and writes them to a string This string is missing the ‘binary_c ‘ at the start.</p> @@ -320,7 +246,7 @@ This string is missing the ‘binary_c ‘ at the start.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.create_hdf5"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">create_hdf5</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#create_hdf5"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.create_hdf5" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">create_hdf5</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#create_hdf5"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.create_hdf5" title="Permalink to this definition">ïƒ</a></dt> <dd><dl class="simple"> <dt>Function to create an hdf5 file from the contents of a directory:</dt><dd><ul class="simple"> <li><p>settings file is selected by checking on files ending on settings</p></li> @@ -344,7 +270,7 @@ This string is missing the ‘binary_c ‘ at the start.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.datalinedict"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">datalinedict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">line</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parameters</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#datalinedict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.datalinedict" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">datalinedict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">line</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parameters</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#datalinedict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.datalinedict" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Convert a line of data to a more convenient dictionary. :param line = a line of data as a string: :param parameters = a list of the parameter names:</p> @@ -353,7 +279,7 @@ This string is missing the ‘binary_c ‘ at the start.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.example_parse_output"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">example_parse_output</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">selected_header</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#example_parse_output"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.example_parse_output" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">example_parse_output</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">selected_header</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#example_parse_output"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.example_parse_output" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that parses output of binary_c. This version serves as an example and is quite detailed. Custom functions can be easier:</p> <p>This function works in two cases: @@ -389,7 +315,7 @@ process)</p></li> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.filter_arg_dict"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">filter_arg_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#filter_arg_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.filter_arg_dict" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">filter_arg_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#filter_arg_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.filter_arg_dict" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to filter out keys that contain values included in [‘NULL’, ‘Function’, ‘’]</p> <p>This function is called by get_defaults()</p> <dl class="field-list simple"> @@ -407,19 +333,19 @@ process)</p></li> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.format_number"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">format_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">number</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#format_number"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.format_number" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">format_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">number</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#format_number"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.format_number" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to take a number, express format it in scientific notation, and remove the trailing 0 if the exponent is 0</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_ANSI_colours"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_ANSI_colours</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_ANSI_colours"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_ANSI_colours" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_ANSI_colours</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_ANSI_colours"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_ANSI_colours" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns a dictionary with text-colors in ANSI formatting</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_arg_keys"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_arg_keys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_arg_keys"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_arg_keys" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_arg_keys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_arg_keys"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_arg_keys" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that return the list of possible keys to give in the arg string. This function calls get_defaults()</p> <dl class="field-list simple"> @@ -435,7 +361,7 @@ we call get_defaults())</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_defaults"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_defaults</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filter_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_defaults"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_defaults" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_defaults</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filter_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_defaults"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_defaults" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that calls the binaryc get args function and cast it into a dictionary.</p> <p>All the values are strings</p> <dl class="field-list simple"> @@ -453,7 +379,7 @@ we call get_defaults())</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_help"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">param_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fail_silently</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">param_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fail_silently</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns the help info for a given parameter, by interfacing with binary_c</p> <p>Will check whether it is a valid parameter.</p> <p>Binary_c will output things in the following order; @@ -484,7 +410,7 @@ valid parameter name</p></li> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_help_all"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help_all</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help_all" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help_all</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help_all" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that reads out the output of the return_help_all API call to binary_c. This return_help_all binary_c returns all the information for the parameters, their descriptions and other properties. The output is categorised in sections.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -501,7 +427,7 @@ valid parameter name</p></li> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_help_super"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help_super</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fail_silently</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help_super"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help_super" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_help_super</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">print_help</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fail_silently</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help_super"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_help_super" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that first runs get_help_all, and then per argument also run the help function to get as much information as possible.</p> <dl class="field-list simple"> @@ -522,44 +448,44 @@ the help function to get as much information as possible.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_size"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seen</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_size"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_size" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seen</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_size"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_size" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Recursively finds size of objects</p> <p>From <a class="reference external" href="https://github.com/bosswissam/pysize">https://github.com/bosswissam/pysize</a></p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.get_username"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_username</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_username"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_username" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">get_username</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_username"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.get_username" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to get the username of the user that spawned the current process</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.imports"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">imports</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#imports"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.imports" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">imports</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#imports"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.imports" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Generator that generates the names of all the modules that are loaded in the globals</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.is_capsule"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">is_capsule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">o</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#is_capsule"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.is_capsule" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">is_capsule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">o</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#is_capsule"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.is_capsule" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to tell whether object is a capsule</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.isfloat"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">isfloat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#isfloat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.isfloat" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">isfloat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#isfloat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.isfloat" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Return True if the “number†x, which could be a string, is a float, otherwise return False.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.isint"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">isint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#isint"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.isint" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">isint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#isint"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.isint" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Return True if the “number†x, which could be a string, is an int, otherwise return False.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.load_logfile"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">load_logfile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#load_logfile"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.load_logfile" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">load_logfile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logfile</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#load_logfile"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.load_logfile" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Experimental function that parses the generated log file of binary_c.</p> <p>This function is not finished and shouldn’t be used yet.</p> <dl class="simple"> @@ -583,7 +509,7 @@ the help function to get as much information as possible.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.make_build_text"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">make_build_text</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#make_build_text"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.make_build_text" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">make_build_text</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#make_build_text"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.make_build_text" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to make build text</p> <dl class="field-list simple"> <dt class="field-odd">Return type</dt> @@ -597,13 +523,13 @@ the help function to get as much information as possible.</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.mem_use"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">mem_use</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#mem_use"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.mem_use" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">mem_use</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#mem_use"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.mem_use" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Return current process memory use in MB. (Takes no arguments) Note: this is per-thread only.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.now"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">now</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">now_object</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">style</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">specifier</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#now"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.now" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">now</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">now_object</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">style</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">specifier</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#now"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.now" title="Permalink to this definition">ïƒ</a></dt> <dd><p>convenience function to return a string of the current time, using the format “%m/%d/%Y %H:%M:%Sâ€</p> <dl class="field-list simple"> @@ -619,7 +545,7 @@ using the format “%m/%d/%Y %H:%M:%Sâ€</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.output_lines"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">output_lines</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#output_lines"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.output_lines" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">output_lines</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#output_lines"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.output_lines" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that outputs the lines that were received from the binary_c run, but now as an iterator.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -636,13 +562,13 @@ using the format “%m/%d/%Y %H:%M:%Sâ€</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.pad_output_distribution"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">pad_output_distribution</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dist</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">binwidth</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#pad_output_distribution"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.pad_output_distribution" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">pad_output_distribution</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dist</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">binwidth</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#pad_output_distribution"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.pad_output_distribution" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Given a distribution, dist (a dictionary), which should be binned every binwidth (float), fill the distribution with zeros when there is no data. Note: this changes the data in place.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.remove_file"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">remove_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#remove_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.remove_file" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">remove_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#remove_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.remove_file" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to remove files but with verbosity</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -662,7 +588,7 @@ using the format “%m/%d/%Y %H:%M:%Sâ€</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.temp_dir"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">temp_dir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#temp_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.temp_dir" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">temp_dir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#temp_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.temp_dir" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to create directory within the TMP directory of the file system</p> <p>Makes use of os.makedirs exist_ok which requires python 3.2+</p> <dl class="field-list simple"> @@ -680,20 +606,20 @@ using the format “%m/%d/%Y %H:%M:%Sâ€</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.timedelta"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">timedelta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">delta</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#timedelta"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.timedelta" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">timedelta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">delta</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#timedelta"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.timedelta" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to convert a length of time (float, seconds) to a string for human-readable output.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.trem"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">trem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">count</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dn</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#trem"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.trem" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">trem</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">count</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dn</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#trem"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.trem" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Estimate time remaining (seconds) given a differential time and count (i.e. progress = $count/$n). $dt is the time since the last call, $count is the current progress count, $dn is the number run since the last call, and $n is the total number required.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.verbose_print"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">verbose_print</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">minimal_verbosity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newline</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'\\n'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#verbose_print"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.verbose_print" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">verbose_print</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">minimal_verbosity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newline</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'\\n'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#verbose_print"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.verbose_print" title="Permalink to this definition">ïƒ</a></dt> <dd><blockquote> <div><p>Function that decides whether to print a message based on the current verbosity and its minimum verbosity</p> @@ -717,7 +643,7 @@ newline: newline character (or set of characters), defaults to “</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.functions.write_binary_c_parameter_descriptions_to_rst_file"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">write_binary_c_parameter_descriptions_to_rst_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#write_binary_c_parameter_descriptions_to_rst_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.write_binary_c_parameter_descriptions_to_rst_file" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.functions.</span></span><span class="sig-name descname"><span class="pre">write_binary_c_parameter_descriptions_to_rst_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#write_binary_c_parameter_descriptions_to_rst_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.functions.write_binary_c_parameter_descriptions_to_rst_file" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that calls the get_help_super() to get the help text/descriptions for all the parameters available in that build.</p> <p>Writes the results to a .rst file that can be included in the docs.</p> @@ -732,61 +658,43 @@ of all the binary_c parameters.</p> </dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="grid.html" class="btn btn-neutral float-right" title="grid_class module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="distribution_functions.html" class="btn btn-neutral float-left" title="distribution_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="ensemble.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="grid.html" class="btn btn-neutral float-right" title="grid_class module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 9dc87ab4fc5964f13c2b1a7cb89241fb4bb328b1..0c555920363340faff7b66a958e49b2eab6dfea2 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -1,68 +1,32 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Index — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="#" /> <link rel="search" title="Search" href="search.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -70,17 +34,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -92,66 +46,29 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Index</li> - - <li class="wy-breadcrumbs-aside"> - - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1 id="index">Index</h1> @@ -164,8 +81,10 @@ | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> + | <a href="#H"><strong>H</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#J"><strong>J</strong></a> + | <a href="#K"><strong>K</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#N"><strong>N</strong></a> @@ -174,6 +93,7 @@ | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> + | <a href="#U"><strong>U</strong></a> | <a href="#V"><strong>V</strong></a> | <a href="#W"><strong>W</strong></a> | <a href="#Z"><strong>Z</strong></a> @@ -182,14 +102,14 @@ <h2 id="_">_</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__delitem__">__delitem__() (binarycpython.utils.population_extensions.cache.cache.NullCache method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.Capturing.__enter__">__enter__() (binarycpython.utils.functions.Capturing method)</a> <ul> <li><a href="functions.html#binarycpython.utils.functions.catchtime.__enter__">(binarycpython.utils.functions.catchtime method)</a> </li> </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> <li><a href="functions.html#binarycpython.utils.functions.Capturing.__exit__">__exit__() (binarycpython.utils.functions.Capturing method)</a> <ul> @@ -197,12 +117,38 @@ </li> </ul></li> </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="dicts.html#binarycpython.utils.dicts.AutoVivificationDict.__getitem__">__getitem__() (binarycpython.utils.dicts.AutoVivificationDict method)</a> + + <ul> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__getitem__">(binarycpython.utils.population_extensions.cache.cache.NullCache method)</a> +</li> + </ul></li> + <li><a href="dicts.html#binarycpython.utils.dicts.AutoVivificationDict.__iadd__">__iadd__() (binarycpython.utils.dicts.AutoVivificationDict method)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.__setitem__">__setitem__() (binarycpython.utils.population_extensions.cache.cache.NullCache method)</a> +</li> + </ul></td> </tr></table> <h2 id="A">A</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata.add_ensemble_metadata">add_ensemble_metadata() (binarycpython.utils.population_extensions.metadata.metadata method)</a> +</li> + <li><a href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.add_grid_variable">add_grid_variable() (binarycpython.utils.population_extensions.gridcode.gridcode method)</a> +</li> + <li><a href="population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata.add_system_metadata">add_system_metadata() (binarycpython.utils.population_extensions.metadata.metadata method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics">analytics (class in binarycpython.utils.population_extensions.analytics)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Arenou2010_binary_fraction">Arenou2010_binary_fraction() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.autogen_C_logging_code">autogen_C_logging_code() (in module binarycpython.utils.custom_logging_functions)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.AutoVivificationDict">AutoVivificationDict (class in binarycpython.utils.dicts)</a> </li> </ul></td> </tr></table> @@ -215,12 +161,32 @@ <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.binary_c_log_code">binary_c_log_code() (in module binarycpython.utils.custom_logging_functions)</a> </li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.binary_c_write_log_code">binary_c_write_log_code() (in module binarycpython.utils.custom_logging_functions)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.binaryc_json_serializer">binaryc_json_serializer() (in module binarycpython.utils.ensemble)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.binarycDecoder">binarycDecoder (class in binarycpython.utils.ensemble)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.BinaryCEncoder">BinaryCEncoder (class in binarycpython.utils.ensemble)</a> </li> <li> binarycpython.utils.custom_logging_functions <ul> <li><a href="custom_logging_functions.html#module-binarycpython.utils.custom_logging_functions">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.dicts + + <ul> + <li><a href="dicts.html#module-binarycpython.utils.dicts">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.ensemble + + <ul> + <li><a href="ensemble.html#module-binarycpython.utils.ensemble">module</a> </li> </ul></li> <li> @@ -237,13 +203,97 @@ <li><a href="grid.html#module-binarycpython.utils.grid">module</a> </li> </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> <li> binarycpython.utils.plot_functions <ul> <li><a href="plot_functions.html#module-binarycpython.utils.plot_functions">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.analytics + + <ul> + <li><a href="population_extensions/analytics.html#module-binarycpython.utils.population_extensions.analytics">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.cache + + <ul> + <li><a href="population_extensions/cache.html#module-binarycpython.utils.population_extensions.cache">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.condor + + <ul> + <li><a href="population_extensions/condor.html#module-binarycpython.utils.population_extensions.condor">module</a> +</li> + </ul></li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li> + binarycpython.utils.population_extensions.dataIO + + <ul> + <li><a href="population_extensions/dataIO.html#module-binarycpython.utils.population_extensions.dataIO">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.distribution_functions + + <ul> + <li><a href="population_extensions/distribution_functions.html#module-binarycpython.utils.population_extensions.distribution_functions">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.grid_options_defaults + + <ul> + <li><a href="population_extensions/grid_options_defaults.html#module-binarycpython.utils.population_extensions.grid_options_defaults">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.gridcode + + <ul> + <li><a href="population_extensions/gridcode.html#module-binarycpython.utils.population_extensions.gridcode">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.HPC + + <ul> + <li><a href="population_extensions/HPC.html#module-binarycpython.utils.population_extensions.HPC">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.metadata + + <ul> + <li><a href="population_extensions/metadata.html#module-binarycpython.utils.population_extensions.metadata">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.slurm + + <ul> + <li><a href="population_extensions/slurm.html#module-binarycpython.utils.population_extensions.slurm">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.spacing_functions + + <ul> + <li><a href="population_extensions/spacing_functions.html#module-binarycpython.utils.population_extensions.spacing_functions">module</a> +</li> + </ul></li> + <li> + binarycpython.utils.population_extensions.version_info + + <ul> + <li><a href="population_extensions/version_info.html#module-binarycpython.utils.population_extensions.version_info">module</a> </li> </ul></li> <li> @@ -267,15 +317,29 @@ <li><a href="useful_funcs.html#module-binarycpython.utils.useful_funcs">module</a> </li> </ul></li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.build_q_table">build_q_table() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> </ul></td> </tr></table> <h2 id="C">C</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache">cache (class in binarycpython.utils.population_extensions.cache)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache">cache.NullCache (class in binarycpython.utils.population_extensions.cache)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_e_integral">calc_e_integral() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_P_integral">calc_P_integral() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.calc_period_from_sep">calc_period_from_sep() (in module binarycpython.utils.useful_funcs)</a> </li> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.calc_sep_from_period">calc_sep_from_period() (in module binarycpython.utils.useful_funcs)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_total_probdens">calc_total_probdens() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calculate_constants_three_part_powerlaw">calculate_constants_three_part_powerlaw() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.call_binary_c_config">call_binary_c_config() (in module binarycpython.utils.functions)</a> </li> @@ -287,23 +351,61 @@ </li> <li><a href="grid.html#binarycpython.utils.grid.Population.clean">clean() (binarycpython.utils.grid.Population method)</a> </li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.color_by_index">color_by_index() (in module binarycpython.utils.plot_functions)</a> </li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.compile_shared_lib">compile_shared_lib() (in module binarycpython.utils.custom_logging_functions)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.compression_type">compression_type() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor">condor (class in binarycpython.utils.population_extensions.condor)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_check_requirements">condor_check_requirements() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_dirs">condor_dirs() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_grid">condor_grid() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_outfile">condor_outfile() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_queue_stats">condor_queue_stats() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condor_status_file">condor_status_file() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condorID">condorID() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.condorpath">condorpath() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.const_distribution">const_distribution() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_dt">const_dt() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_int">const_int() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_linear">const_linear() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_ranges">const_ranges() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.conv_time_units">conv_time_units() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.convert_bytes">convert_bytes() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.convfloat">convfloat() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.cosmic_SFH_madau_dickinson2014">cosmic_SFH_madau_dickinson2014() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.count_keys_recursive">count_keys_recursive() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.CPU_time">CPU_time() (binarycpython.utils.population_extensions.analytics.analytics method)</a> </li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.create_and_load_logging_function">create_and_load_logging_function() (in module binarycpython.utils.custom_logging_functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.create_arg_string">create_arg_string() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.create_hdf5">create_hdf5() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.custom_sort_dict">custom_sort_dict() (in module binarycpython.utils.dicts)</a> </li> </ul></td> </tr></table> @@ -311,11 +413,31 @@ <h2 id="D">D</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO">dataIO (class in binarycpython.utils.population_extensions.dataIO)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.datalinedict">datalinedict() (in module binarycpython.utils.functions)</a> </li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.binarycDecoder.decode">decode() (binarycpython.utils.ensemble.binarycDecoder method)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.BinaryCEncoder.default">default() (binarycpython.utils.ensemble.BinaryCEncoder method)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.default_cache_dir">default_cache_dir() (binarycpython.utils.population_extensions.cache.cache method)</a> + + <ul> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.default_cache_dir">(binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> +</li> + </ul></li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.delete_grid_variable">delete_grid_variable() (binarycpython.utils.population_extensions.gridcode.gridcode method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.dir_ok">dir_ok() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions">distribution_functions (class in binarycpython.utils.population_extensions.distribution_functions)</a> +</li> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.dummy">dummy() (in module binarycpython.utils.plot_functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.duquennoy1991">duquennoy1991() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> </ul></td> </tr></table> @@ -323,17 +445,25 @@ <h2 id="E">E</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="grid.html#binarycpython.utils.grid.Population.evolve">evolve() (binarycpython.utils.grid.Population method)</a> + <li><a href="ensemble.html#binarycpython.utils.ensemble.ensemble_compression">ensemble_compression() (in module binarycpython.utils.ensemble)</a> </li> - <li><a href="grid.html#binarycpython.utils.grid.Population.evolve_single">evolve_single() (binarycpython.utils.grid.Population method)</a> + <li><a href="ensemble.html#binarycpython.utils.ensemble.ensemble_file_type">ensemble_file_type() (in module binarycpython.utils.ensemble)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.ensemble_setting">ensemble_setting() (in module binarycpython.utils.ensemble)</a> +</li> + <li><a href="grid.html#binarycpython.utils.grid.Population.evolve">evolve() (binarycpython.utils.grid.Population method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="grid.html#binarycpython.utils.grid.Population.evolve_single">evolve_single() (binarycpython.utils.grid.Population method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.example_parse_output">example_parse_output() (in module binarycpython.utils.functions)</a> </li> <li><a href="grid.html#binarycpython.utils.grid.Population.exit">exit() (binarycpython.utils.grid.Population method)</a> </li> <li><a href="grid.html#binarycpython.utils.grid.Population.export_all_info">export_all_info() (binarycpython.utils.grid.Population method)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.extract_ensemble_json_from_string">extract_ensemble_json_from_string() (in module binarycpython.utils.ensemble)</a> </li> </ul></td> </tr></table> @@ -341,10 +471,22 @@ <h2 id="F">F</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.fill_data">fill_data() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.filter_arg_dict">filter_arg_dict() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.filter_dict">filter_dict() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.filter_dict_through_values">filter_dict_through_values() (in module binarycpython.utils.dicts)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flat">flat() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flatsections">flatsections() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.format_ensemble_results">format_ensemble_results() (in module binarycpython.utils.ensemble)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.format_number">format_number() (in module binarycpython.utils.functions)</a> </li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.from_binary_c_config">from_binary_c_config() (in module binarycpython.utils.custom_logging_functions)</a> @@ -355,11 +497,25 @@ <h2 id="G">G</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian">gaussian() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_func">gaussian_func() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_normalizing_const">gaussian_normalizing_const() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.gaussian_zoom">gaussian_zoom() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.get_ANSI_colours">get_ANSI_colours() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_arg_keys">get_arg_keys() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.get_condor_status">get_condor_status() (binarycpython.utils.population_extensions.condor.condor method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_defaults">get_defaults() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_defaults_dict">get_grid_options_defaults_dict() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_descriptions">get_grid_options_descriptions() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_help">get_help() (in module binarycpython.utils.functions)</a> </li> @@ -368,10 +524,90 @@ <li><a href="functions.html#binarycpython.utils.functions.get_help_all">get_help_all() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_help_super">get_help_super() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_integration_constant_q">get_integration_constant_q() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_max_multiplicity">get_max_multiplicity() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_size">get_size() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.get_slurm_status">get_slurm_status() (binarycpython.utils.population_extensions.slurm.slurm method)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_username">get_username() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults">grid_options_defaults (class in binarycpython.utils.population_extensions.grid_options_defaults)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_description_checker">grid_options_description_checker() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_help">grid_options_help() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> +</li> + <li><a href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode">gridcode (class in binarycpython.utils.population_extensions.gridcode)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="H">H</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="ensemble.html#binarycpython.utils.ensemble.handle_ensemble_string_to_json">handle_ensemble_string_to_json() (in module binarycpython.utils.ensemble)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC">HPC (class in binarycpython.utils.population_extensions.HPC)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_can_join">HPC_can_join() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_check_requirements">HPC_check_requirements() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dir">HPC_dir() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dirs">HPC_dirs() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_dump_status">HPC_dump_status() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_get_status">HPC_get_status() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_grid">HPC_grid() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_filename">HPC_id_filename() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_from_dir">HPC_id_from_dir() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job">HPC_job() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_task">HPC_job_task() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_type">HPC_job_type() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID">HPC_jobID() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID_tuple">HPC_jobID_tuple() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_from_files">HPC_join_from_files() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_previous">HPC_join_previous() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_joinlist">HPC_joinlist() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_load_joinfiles_list">HPC_load_joinfiles_list() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_make_joiningfile">HPC_make_joiningfile() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_njobs">HPC_njobs() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_path">HPC_path() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_queue_stats">HPC_queue_stats() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_restore">HPC_restore() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_set_status">HPC_set_status() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_snapshot_filename">HPC_snapshot_filename() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_status">HPC_status() (binarycpython.utils.population_extensions.HPC.HPC method)</a> +</li> + <li><a href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC.HPC_touch">HPC_touch() (binarycpython.utils.population_extensions.HPC.HPC method)</a> </li> </ul></td> </tr></table> @@ -379,15 +615,29 @@ <h2 id="I">I</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="functions.html#binarycpython.utils.functions.imports">imports() (in module binarycpython.utils.functions)</a> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_chabrier2003">imf_chabrier2003() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> - <li><a href="functions.html#binarycpython.utils.functions.is_capsule">is_capsule() (in module binarycpython.utils.functions)</a> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1986">imf_scalo1986() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1998">imf_scalo1998() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_tinsley1980">imf_tinsley1980() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="functions.html#binarycpython.utils.functions.imports">imports() (in module binarycpython.utils.functions)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="dicts.html#binarycpython.utils.dicts.inspect_dict">inspect_dict() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.interpolate_in_mass_izzard2012">interpolate_in_mass_izzard2012() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="functions.html#binarycpython.utils.functions.is_capsule">is_capsule() (in module binarycpython.utils.functions)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.isfloat">isfloat() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.isint">isint() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Izzard2012_period_distribution">Izzard2012_period_distribution() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> </ul></td> </tr></table> @@ -400,10 +650,38 @@ </ul></td> </tr></table> +<h2 id="K">K</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="dicts.html#binarycpython.utils.dicts.keys_to_floats">keys_to_floats() (in module binarycpython.utils.dicts)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Kroupa2001">Kroupa2001() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.ktg93">ktg93() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + </ul></td> +</tr></table> + <h2 id="L">L</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.linear_extrapolation_q">linear_extrapolation_q() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="ensemble.html#binarycpython.utils.ensemble.load_ensemble">load_ensemble() (in module binarycpython.utils.ensemble)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.load_logfile">load_logfile() (in module binarycpython.utils.functions)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.load_population_object">load_population_object() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.load_snapshot">load_snapshot() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.locked_close">locked_close() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.locked_open_for_write">locked_open_for_write() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> </li> </ul></td> </tr></table> @@ -411,27 +689,73 @@ <h2 id="M">M</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.make_analytics_dict">make_analytics_dict() (binarycpython.utils.population_extensions.analytics.analytics method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.make_build_text">make_build_text() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.make_condor_dirs">make_condor_dirs() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.make_slurm_dirs">make_slurm_dirs() (binarycpython.utils.population_extensions.slurm.slurm method)</a> </li> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.maximum_mass_ratio_for_RLOF">maximum_mass_ratio_for_RLOF() (in module binarycpython.utils.useful_funcs)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.mem_use">mem_use() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.merge_dicts">merge_dicts() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.merge_multiplicities">merge_multiplicities() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations">merge_populations() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations_from_file">merge_populations_from_file() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata">metadata (class in binarycpython.utils.population_extensions.metadata)</a> </li> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.minimum_period_for_RLOF">minimum_period_for_RLOF() (in module binarycpython.utils.useful_funcs)</a> </li> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.minimum_separation_for_RLOF">minimum_separation_for_RLOF() (in module binarycpython.utils.useful_funcs)</a> +</li> + <li><a href="population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.minimum_stellar_mass">minimum_stellar_mass() (binarycpython.utils.population_extensions.version_info.version_info method)</a> </li> <li> module <ul> <li><a href="custom_logging_functions.html#module-binarycpython.utils.custom_logging_functions">binarycpython.utils.custom_logging_functions</a> +</li> + <li><a href="dicts.html#module-binarycpython.utils.dicts">binarycpython.utils.dicts</a> +</li> + <li><a href="ensemble.html#module-binarycpython.utils.ensemble">binarycpython.utils.ensemble</a> </li> <li><a href="functions.html#module-binarycpython.utils.functions">binarycpython.utils.functions</a> </li> <li><a href="grid.html#module-binarycpython.utils.grid">binarycpython.utils.grid</a> </li> <li><a href="plot_functions.html#module-binarycpython.utils.plot_functions">binarycpython.utils.plot_functions</a> +</li> + <li><a href="population_extensions/analytics.html#module-binarycpython.utils.population_extensions.analytics">binarycpython.utils.population_extensions.analytics</a> +</li> + <li><a href="population_extensions/cache.html#module-binarycpython.utils.population_extensions.cache">binarycpython.utils.population_extensions.cache</a> +</li> + <li><a href="population_extensions/condor.html#module-binarycpython.utils.population_extensions.condor">binarycpython.utils.population_extensions.condor</a> +</li> + <li><a href="population_extensions/dataIO.html#module-binarycpython.utils.population_extensions.dataIO">binarycpython.utils.population_extensions.dataIO</a> +</li> + <li><a href="population_extensions/distribution_functions.html#module-binarycpython.utils.population_extensions.distribution_functions">binarycpython.utils.population_extensions.distribution_functions</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#module-binarycpython.utils.population_extensions.grid_options_defaults">binarycpython.utils.population_extensions.grid_options_defaults</a> +</li> + <li><a href="population_extensions/gridcode.html#module-binarycpython.utils.population_extensions.gridcode">binarycpython.utils.population_extensions.gridcode</a> +</li> + <li><a href="population_extensions/HPC.html#module-binarycpython.utils.population_extensions.HPC">binarycpython.utils.population_extensions.HPC</a> +</li> + <li><a href="population_extensions/metadata.html#module-binarycpython.utils.population_extensions.metadata">binarycpython.utils.population_extensions.metadata</a> +</li> + <li><a href="population_extensions/slurm.html#module-binarycpython.utils.population_extensions.slurm">binarycpython.utils.population_extensions.slurm</a> +</li> + <li><a href="population_extensions/spacing_functions.html#module-binarycpython.utils.population_extensions.spacing_functions">binarycpython.utils.population_extensions.spacing_functions</a> +</li> + <li><a href="population_extensions/version_info.html#module-binarycpython.utils.population_extensions.version_info">binarycpython.utils.population_extensions.version_info</a> </li> <li><a href="run_system_wrapper.html#module-binarycpython.utils.run_system_wrapper">binarycpython.utils.run_system_wrapper</a> </li> @@ -441,12 +765,32 @@ </li> </ul></li> </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions">Moe_di_Stefano_2017_multiplicity_fractions() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_pdf">Moe_di_Stefano_2017_pdf() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.multiply_float_values">multiply_float_values() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.multiply_values_dict">multiply_values_dict() (in module binarycpython.utils.dicts)</a> +</li> + </ul></td> </tr></table> <h2 id="N">N</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.NFS_flush_hack">NFS_flush_hack() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.NFSpath">NFSpath() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="dicts.html#binarycpython.utils.dicts.normalize_dict">normalize_dict() (in module binarycpython.utils.dicts)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.now">now() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.number">number() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> </ul></td> </tr></table> @@ -454,6 +798,12 @@ <h2 id="O">O</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.open">open() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="ensemble.html#binarycpython.utils.ensemble.open_ensemble">open_ensemble() (in module binarycpython.utils.ensemble)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.output_lines">output_lines() (in module binarycpython.utils.functions)</a> </li> </ul></td> @@ -463,6 +813,8 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="functions.html#binarycpython.utils.functions.pad_output_distribution">pad_output_distribution() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.parse_binary_c_version_info">parse_binary_c_version_info() (binarycpython.utils.population_extensions.version_info.version_info method)</a> </li> <li><a href="grid.html#binarycpython.utils.grid.Population.parse_cmdline">parse_cmdline() (binarycpython.utils.grid.Population method)</a> </li> @@ -472,17 +824,35 @@ </li> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.parse_function_orbit">parse_function_orbit() (in module binarycpython.utils.plot_functions)</a> </li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.peak_normalized_gaussian_func">peak_normalized_gaussian_func() (binarycpython.utils.population_extensions.spacing_functions.spacing_functions method)</a> +</li> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.plot_HR_diagram">plot_HR_diagram() (in module binarycpython.utils.plot_functions)</a> </li> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.plot_masses">plot_masses() (in module binarycpython.utils.plot_functions)</a> </li> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.plot_orbit">plot_orbit() (in module binarycpython.utils.plot_functions)</a> </li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> <li><a href="plot_functions.html#binarycpython.utils.plot_functions.plot_system">plot_system() (in module binarycpython.utils.plot_functions)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.poisson">poisson() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.NullCache.popitem">popitem() (binarycpython.utils.population_extensions.cache.cache.NullCache method)</a> </li> <li><a href="grid.html#binarycpython.utils.grid.Population">Population (class in binarycpython.utils.grid)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw">powerlaw() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant">powerlaw_constant() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant_nocache">powerlaw_constant_nocache() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_extrapolation_q">powerlaw_extrapolation_q() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.prepare_dict">prepare_dict() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.print_option_descriptions">print_option_descriptions() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> </li> </ul></td> </tr></table> @@ -491,15 +861,25 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="useful_funcs.html#binarycpython.utils.useful_funcs.ragb">ragb() (in module binarycpython.utils.useful_funcs)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.raghavan2010_binary_fraction">raghavan2010_binary_fraction() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.recursive_change_key_to_float">recursive_change_key_to_float() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.recursive_change_key_to_string">recursive_change_key_to_string() (in module binarycpython.utils.dicts)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.remove_file">remove_file() (in module binarycpython.utils.functions)</a> </li> - <li><a href="grid.html#binarycpython.utils.grid.Population.return_all_info">return_all_info() (binarycpython.utils.grid.Population method)</a> + <li><a href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.rename_grid_variable">rename_grid_variable() (binarycpython.utils.population_extensions.gridcode.gridcode method)</a> </li> - <li><a href="grid.html#binarycpython.utils.grid.Population.return_binary_c_defaults">return_binary_c_defaults() (binarycpython.utils.grid.Population method)</a> + <li><a href="grid.html#binarycpython.utils.grid.Population.return_all_info">return_all_info() (binarycpython.utils.grid.Population method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="grid.html#binarycpython.utils.grid.Population.return_binary_c_defaults">return_binary_c_defaults() (binarycpython.utils.grid.Population method)</a> +</li> + <li><a href="population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info.return_binary_c_version_info">return_binary_c_version_info() (binarycpython.utils.population_extensions.version_info.version_info method)</a> +</li> <li><a href="custom_logging_functions.html#binarycpython.utils.custom_logging_functions.return_compilation_dict">return_compilation_dict() (in module binarycpython.utils.custom_logging_functions)</a> </li> <li><a href="grid.html#binarycpython.utils.grid.Population.return_population_settings">return_population_settings() (binarycpython.utils.grid.Population method)</a> @@ -516,7 +896,51 @@ <h2 id="S">S</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.sana12">sana12() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.save_population_object">save_population_object() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.save_snapshot">save_snapshot() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> <li><a href="grid.html#binarycpython.utils.grid.Population.set">set() (binarycpython.utils.grid.Population method)</a> +</li> + <li><a href="population_extensions/condor.html#binarycpython.utils.population_extensions.condor.condor.set_condor_status">set_condor_status() (binarycpython.utils.population_extensions.condor.condor method)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.set_opts">set_opts() (in module binarycpython.utils.dicts)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.set_slurm_status">set_slurm_status() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.set_status">set_status() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.set_time">set_time() (binarycpython.utils.population_extensions.analytics.analytics method)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.setup_function_cache">setup_function_cache() (binarycpython.utils.population_extensions.cache.cache method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm">slurm (class in binarycpython.utils.population_extensions.slurm)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_check_requirements">slurm_check_requirements() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_dirs">slurm_dirs() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_grid">slurm_grid() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_outfile">slurm_outfile() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_queue_stats">slurm_queue_stats() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurm_status_file">slurm_status_file() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurmID">slurmID() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/slurm.html#binarycpython.utils.population_extensions.slurm.slurm.slurmpath">slurmpath() (binarycpython.utils.population_extensions.slurm.slurm method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.snapshot_filename">snapshot_filename() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions">spacing_functions (class in binarycpython.utils.population_extensions.spacing_functions)</a> +</li> + <li><a href="dicts.html#binarycpython.utils.dicts.subtract_dicts">subtract_dicts() (in module binarycpython.utils.dicts)</a> </li> </ul></td> </tr></table> @@ -525,9 +949,15 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="functions.html#binarycpython.utils.functions.temp_dir">temp_dir() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache.test_caches">test_caches() (binarycpython.utils.population_extensions.cache.cache method)</a> +</li> + <li><a href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.three_part_powerlaw">three_part_powerlaw() (binarycpython.utils.population_extensions.distribution_functions.distribution_functions method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics.time_elapsed">time_elapsed() (binarycpython.utils.population_extensions.analytics.analytics method)</a> +</li> <li><a href="functions.html#binarycpython.utils.functions.timedelta">timedelta() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.trem">trem() (in module binarycpython.utils.functions)</a> @@ -535,10 +965,26 @@ </ul></td> </tr></table> +<h2 id="U">U</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="dicts.html#binarycpython.utils.dicts.update_dicts">update_dicts() (in module binarycpython.utils.dicts)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode.update_grid_variable">update_grid_variable() (binarycpython.utils.population_extensions.gridcode.gridcode method)</a> +</li> + </ul></td> +</tr></table> + <h2 id="V">V</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="functions.html#binarycpython.utils.functions.verbose_print">verbose_print() (in module binarycpython.utils.functions)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info">version_info (class in binarycpython.utils.population_extensions.version_info)</a> </li> </ul></td> </tr></table> @@ -546,11 +992,19 @@ <h2 id="W">W</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.wait_for_unlock">wait_for_unlock() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> <li><a href="grid.html#binarycpython.utils.grid.Population.was_killed">was_killed() (binarycpython.utils.grid.Population method)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.write_binary_c_calls_to_file">write_binary_c_calls_to_file() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="functions.html#binarycpython.utils.functions.write_binary_c_parameter_descriptions_to_rst_file">write_binary_c_parameter_descriptions_to_rst_file() (in module binarycpython.utils.functions)</a> +</li> + <li><a href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO.write_ensemble">write_ensemble() (binarycpython.utils.population_extensions.dataIO.dataIO method)</a> +</li> + <li><a href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.write_grid_options_to_rst_file">write_grid_options_to_rst_file() (binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults method)</a> </li> </ul></td> </tr></table> @@ -566,48 +1020,36 @@ </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/grid.html b/docs/build/html/grid.html index 8d61b12acc989415fbdc0b94746471ec6d6143f2..6f59732a4d65c7f2d81064744f09e9c1f7ca3b94 100644 --- a/docs/build/html/grid.html +++ b/docs/build/html/grid.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>grid_class module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>grid_class module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="Grid options and descriptions" href="grid_options_defaults.html" /> + <link rel="next" title="plot_functions module" href="plot_functions.html" /> <link rel="prev" title="functions module" href="functions.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>grid_class module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/grid.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,10 +121,11 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.grid"> -<span id="grid-class-module"></span><h1>grid_class module<a class="headerlink" href="#module-binarycpython.utils.grid" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.grid"> +<span id="grid-class-module"></span><h1>grid_class module<a class="headerlink" href="#module-binarycpython.utils.grid" title="Permalink to this headline">ïƒ</a></h1> <p>Module containing the Population grid class object.</p> <p>Here all the functionality of a Population object is defined.</p> +<p>TODO: the save_snapshots and save_snapshot, are they actually distinct?</p> <dl class="simple"> <dt>Tasks:</dt><dd><ul class="simple"> <li><p>TODO: add functionality to ‘on-init’ set arguments</p></li> @@ -219,13 +146,13 @@ </dl> <dl class="py class"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population"> -<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.grid.</span></span><span class="sig-name descname"><span class="pre">Population</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._analytics.analytics</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._cache.cache</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._dataIO.dataIO</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._distribution_functions.distribution_functions</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._grid_logging.grid_logging</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._grid_options_defaults.grid_options_defaults</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._gridcode.gridcode</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._HPC.HPC</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._metadata.metadata</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._Moe_di_Stefano_2017.Moe_di_Stefano_2017</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._spacing_functions.spacing_functions</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions._version_info.version_info</span></code></p> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.grid.</span></span><span class="sig-name descname"><span class="pre">Population</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <a class="reference internal" href="population_extensions/analytics.html#binarycpython.utils.population_extensions.analytics.analytics" title="binarycpython.utils.population_extensions.analytics.analytics"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.analytics.analytics</span></code></a>, <a class="reference internal" href="population_extensions/cache.html#binarycpython.utils.population_extensions.cache.cache" title="binarycpython.utils.population_extensions.cache.cache"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.cache.cache</span></code></a>, <a class="reference internal" href="population_extensions/dataIO.html#binarycpython.utils.population_extensions.dataIO.dataIO" title="binarycpython.utils.population_extensions.dataIO.dataIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.dataIO.dataIO</span></code></a>, <a class="reference internal" href="population_extensions/distribution_functions.html#binarycpython.utils.population_extensions.distribution_functions.distribution_functions" title="binarycpython.utils.population_extensions.distribution_functions.distribution_functions"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.distribution_functions.distribution_functions</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.grid_logging.grid_logging</span></code>, <a class="reference internal" href="population_extensions/grid_options_defaults.html#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults" title="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults</span></code></a>, <a class="reference internal" href="population_extensions/gridcode.html#binarycpython.utils.population_extensions.gridcode.gridcode" title="binarycpython.utils.population_extensions.gridcode.gridcode"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.gridcode.gridcode</span></code></a>, <a class="reference internal" href="population_extensions/HPC.html#binarycpython.utils.population_extensions.HPC.HPC" title="binarycpython.utils.population_extensions.HPC.HPC"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.HPC.HPC</span></code></a>, <a class="reference internal" href="population_extensions/metadata.html#binarycpython.utils.population_extensions.metadata.metadata" title="binarycpython.utils.population_extensions.metadata.metadata"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.metadata.metadata</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.Moe_di_Stefano_2017.Moe_di_Stefano_2017</span></code>, <a class="reference internal" href="population_extensions/spacing_functions.html#binarycpython.utils.population_extensions.spacing_functions.spacing_functions" title="binarycpython.utils.population_extensions.spacing_functions.spacing_functions"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.spacing_functions.spacing_functions</span></code></a>, <a class="reference internal" href="population_extensions/version_info.html#binarycpython.utils.population_extensions.version_info.version_info" title="binarycpython.utils.population_extensions.version_info.version_info"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.version_info.version_info</span></code></a></p> <p>Population Object. Contains all the necessary functions to set up, run and process a population of systems</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.clean"> -<span class="sig-name descname"><span class="pre">clean</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.clean"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.clean" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">clean</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.clean"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.clean" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Clean the contents of the population object so it can be reused.</p> <p>Calling _pre_run_setup()</p> <p>TODO: decide to deprecate this function</p> @@ -238,7 +165,7 @@ population of systems</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.evolve"> -<span class="sig-name descname"><span class="pre">evolve</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.evolve"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.evolve" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">evolve</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.evolve"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.evolve" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Entry point function of the whole object. From here, based on the settings, we set up a grid and (probably) evolve the population.</p> <p>There are no direct arguments to this function, the grid_options @@ -255,7 +182,7 @@ contain all the relevant settings.</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.evolve_single"> -<span class="sig-name descname"><span class="pre">evolve_single</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">clean_up_custom_logging_files</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.evolve_single"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.evolve_single" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">evolve_single</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">clean_up_custom_logging_files</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.evolve_single"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.evolve_single" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to run a single system, based on the settings in the grid_options</p> <p>The output of the run gets returned, unless a parse function is given to this function.</p> <dl class="field-list simple"> @@ -273,7 +200,7 @@ contain all the relevant settings.</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.exit"> -<span class="sig-name descname"><span class="pre">exit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flush</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stacktrace</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.exit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.exit" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">exit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flush</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stacktrace</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.exit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.exit" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Exit function: use this to exit from a Population object. Really it’s just a wrapper for sys.exit() to return the correct exit code, but also to post a message (if message is True, default is True) @@ -282,7 +209,7 @@ and perhaps a stacktrace (if stacktrace is True, default is False).</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.export_all_info"> -<span class="sig-name descname"><span class="pre">export_all_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">use_datadir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_population_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_version_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_help_all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">4</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.export_all_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.export_all_info" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">export_all_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">use_datadir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_population_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_version_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_help_all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">4</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.export_all_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.export_all_info" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that exports the all_info to a JSON file</p> <dl class="simple"> <dt>Tasks:</dt><dd><ul class="simple"> @@ -325,7 +252,7 @@ simulation_<date+time>_settings.json will be created</p></li> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.jobID"> -<span class="sig-name descname"><span class="pre">jobID</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.jobID"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.jobID" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">jobID</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.jobID"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.jobID" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to return the job ID number of this process</p> <p>Normal processes return their process ID (PID) HPC processes return whatever HPC_jobID() gives.</p> @@ -333,7 +260,7 @@ HPC processes return whatever HPC_jobID() gives.</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.parse_cmdline"> -<span class="sig-name descname"><span class="pre">parse_cmdline</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.parse_cmdline"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.parse_cmdline" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">parse_cmdline</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.parse_cmdline"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.parse_cmdline" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to handle settings values via the command line in the form x=y, w=z, etc.</p> <p>Best to be called after all the .set(..) lines, and just before the .evolve() is called</p> <p>If you input any known parameter (i.e. contained in grid_options, defaults/bse_options @@ -351,7 +278,7 @@ can change to ints.</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.return_all_info"> -<span class="sig-name descname"><span class="pre">return_all_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">include_population_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_version_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_help_all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_all_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_all_info" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">return_all_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">include_population_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_version_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_binary_c_help_all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_all_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_all_info" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns all the information about the population and binary_c</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -376,13 +303,13 @@ the binary_c parameters (see get_help_all)</p></li> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.return_binary_c_defaults"> -<span class="sig-name descname"><span class="pre">return_binary_c_defaults</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_binary_c_defaults"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_binary_c_defaults" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">return_binary_c_defaults</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_binary_c_defaults"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_binary_c_defaults" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns the defaults of the binary_c version that is used.</p> </dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.return_population_settings"> -<span class="sig-name descname"><span class="pre">return_population_settings</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_population_settings"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_population_settings" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">return_population_settings</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.return_population_settings"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.return_population_settings" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns all the options that have been set.</p> <p>Can be combined with JSON to make a nice file.</p> <dl class="field-list simple"> @@ -397,7 +324,7 @@ the binary_c parameters (see get_help_all)</p></li> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.set"> -<span class="sig-name descname"><span class="pre">set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.set"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.set" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.set"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.set" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to set the values of the population. This is the preferred method to set values of functions, as it provides checks on the input.</p> <p>the bse_options will get populated with all the those that have a key that is present @@ -420,67 +347,49 @@ in the self.grid_options</p> <dl class="py method"> <dt class="sig sig-object py" id="binarycpython.utils.grid.Population.was_killed"> -<span class="sig-name descname"><span class="pre">was_killed</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.was_killed"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.was_killed" title="Permalink to this definition">¶</a></dt> +<span class="sig-name descname"><span class="pre">was_killed</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.was_killed"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.was_killed" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to determine if the process was killed. Returns True if so, false otherwise.</p> </dd></dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="grid_options_defaults.html" class="btn btn-neutral float-right" title="Grid options and descriptions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="functions.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="functions.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="plot_functions.html" class="btn btn-neutral float-right" title="plot_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/grid_options_defaults.html b/docs/build/html/grid_options_defaults.html deleted file mode 100644 index 8222e25f416b2dbb001674c605dd4f4b5e91cbb0..0000000000000000000000000000000000000000 --- a/docs/build/html/grid_options_defaults.html +++ /dev/null @@ -1,257 +0,0 @@ - - -<!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> -<head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Grid options and descriptions — binary_c-python documentation</title> - - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> - <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> - <script src="_static/jquery.js"></script> - <script src="_static/underscore.js"></script> - <script src="_static/doctools.js"></script> - <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="hpc_functions module" href="hpc_functions.html" /> - <link rel="prev" title="grid_class module" href="grid.html" /> -</head> - -<body class="wy-body-for-nav"> - - - <div class="wy-grid-for-nav"> - - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> - <div class="wy-side-scroll"> - <div class="wy-side-nav-search" > - - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - - </a> - - - - - - - -<div role="search"> - <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> - <input type="text" name="q" placeholder="Search docs" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - - <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> -<ul class="current"> -<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> -<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> -<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2 current"><a class="current reference internal" href="#">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> -<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> -<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> -<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> -</ul> - - - - </div> - </div> - </nav> - - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - - <i data-toggle="wy-nav-top" class="fa fa-bars"></i> - <a href="index.html">binary_c-python</a> - - </nav> - - - <div class="wy-nav-content"> - - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - - <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - - <li><a href="modules.html">Binarycpython code</a> »</li> - - <li>Grid options and descriptions</li> - - - <li class="wy-breadcrumbs-aside"> - - - <a href="_sources/grid_options_defaults.rst.txt" rel="nofollow"> View page source</a> - - - </li> - - </ul> - - - <hr/> -</div> - <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> - <div itemprop="articleBody"> - - -<style> -/* CSS overrides for sphinx_rtd_theme */ - -/* 24px margin */ -.nbinput.nblast.container, -.nboutput.nblast.container { - margin-bottom: 19px; /* padding has already 5px */ -} - -/* ... except between code cells! */ -.nblast.container + .nbinput.container { - margin-top: -19px; -} - -.admonition > p:before { - margin-right: 4px; /* make room for the exclamation icon */ -} - -/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ -.math { - text-align: unset; -} -</style> -<div class="section" id="grid-options-and-descriptions"> -<h1>Grid options and descriptions<a class="headerlink" href="#grid-options-and-descriptions" title="Permalink to this headline">¶</a></h1> -</div> - - - </div> - - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="hpc_functions.html" class="btn btn-neutral float-right" title="hpc_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="grid.html" class="btn btn-neutral float-left" title="grid_class module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - - </div> - - - <hr/> - - <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> - </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. -<br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. -<br><br> -Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. - - - -</footer> - - </div> - </div> - - </section> - - </div> - - - - <script type="text/javascript"> - jQuery(function () { - SphinxRtdTheme.Navigation.enable(true); - }); - </script> - - - - - - -</body> -</html> \ No newline at end of file diff --git a/docs/build/html/grid_options_descriptions.html b/docs/build/html/grid_options_descriptions.html index 1476a8a626bb0237ba1b724f9f85d2ecb84d71c0..357e1ea8db54d4f4a803b53b8564fb9a95274f81 100644 --- a/docs/build/html/grid_options_descriptions.html +++ b/docs/build/html/grid_options_descriptions.html @@ -1,69 +1,34 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Population grid code options — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Population grid code options — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="prev" title="Binary_c parameters" href="binary_c_parameters.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -71,17 +36,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -98,68 +53,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Population grid code options</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/grid_options_descriptions.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -184,12 +101,12 @@ text-align: unset; } </style> -<div class="section" id="population-grid-code-options"> -<h1>Population grid code options<a class="headerlink" href="#population-grid-code-options" title="Permalink to this headline">¶</a></h1> +<section id="population-grid-code-options"> +<h1>Population grid code options<a class="headerlink" href="#population-grid-code-options" title="Permalink to this headline">ïƒ</a></h1> <p>The following chapter contains all grid code options, along with their descriptions There are 28 options that are not described yet.</p> -<div class="section" id="public-options"> -<h2>Public options<a class="headerlink" href="#public-options" title="Permalink to this headline">¶</a></h2> +<section id="public-options"> +<h2>Public options<a class="headerlink" href="#public-options" title="Permalink to this headline">ïƒ</a></h2> <p>The following options are meant to be changed by the user.</p> <div class="line-block"> <div class="line"><strong>C_auto_logging</strong>: Dictionary containing parameters to be logged by binary_c. The structure of this dictionary is as follows: the key is used as the headline which the user can then catch. The value at that key is a list of binary_c system parameters (like star[0].mass)</div> @@ -521,9 +438,9 @@ There are 28 options that are not described yet.</p> <div class="line-block"> <div class="line"><strong>working_diretory</strong>: No description available yet</div> </div> -</div> -<div class="section" id="moe-di-stefano-sampler-options"> -<h2>Moe & di Stefano sampler options<a class="headerlink" href="#moe-di-stefano-sampler-options" title="Permalink to this headline">¶</a></h2> +</section> +<section id="moe-di-stefano-sampler-options"> +<h2>Moe & di Stefano sampler options<a class="headerlink" href="#moe-di-stefano-sampler-options" title="Permalink to this headline">ïƒ</a></h2> <p>The following options are meant to be changed by the user.</p> <div class="line-block"> <div class="line"><strong>JSON</strong>: No description available yet</div> @@ -608,9 +525,9 @@ q extrapolation (below 0.15) method <div class="line-block"> <div class="line"><strong>samplerfuncs</strong>: No description available yet</div> </div> -</div> -<div class="section" id="private-options"> -<h2>Private options<a class="headerlink" href="#private-options" title="Permalink to this headline">¶</a></h2> +</section> +<section id="private-options"> +<h2>Private options<a class="headerlink" href="#private-options" title="Permalink to this headline">ïƒ</a></h2> <p>The following options are not meant to be changed by the user, as these options are used and set internally by the object itself. The description still is provided, but just for documentation purposes.</p> <div class="line-block"> <div class="line"><strong>_Moe2017_JSON_data</strong>: Location to store the loaded Moe&diStefano2017 dataset</div> @@ -705,60 +622,43 @@ q extrapolation (below 0.15) method <div class="line-block"> <div class="line"><strong>_zero_prob_stars_skipped</strong>: Internal counter to track how many systems are skipped because they have 0 probability</div> </div> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - - <a href="binary_c_parameters.html" class="btn btn-neutral float-left" title="Binary_c parameters" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="binary_c_parameters.html" class="btn btn-neutral float-left" title="Binary_c parameters" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/hpc_functions.html b/docs/build/html/hpc_functions.html deleted file mode 100644 index 47710f618b7405f5f2a97f1d25037f33f91620c4..0000000000000000000000000000000000000000 --- a/docs/build/html/hpc_functions.html +++ /dev/null @@ -1,257 +0,0 @@ - - -<!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> -<head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>hpc_functions module — binary_c-python documentation</title> - - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> - <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> - <script src="_static/jquery.js"></script> - <script src="_static/underscore.js"></script> - <script src="_static/doctools.js"></script> - <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="plot_functions module" href="plot_functions.html" /> - <link rel="prev" title="Grid options and descriptions" href="grid_options_defaults.html" /> -</head> - -<body class="wy-body-for-nav"> - - - <div class="wy-grid-for-nav"> - - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> - <div class="wy-side-scroll"> - <div class="wy-side-nav-search" > - - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - - </a> - - - - - - - -<div role="search"> - <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> - <input type="text" name="q" placeholder="Search docs" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - - <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> -<ul class="current"> -<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> -<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> -<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2 current"><a class="current reference internal" href="#">hpc_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> -<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> -<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> -<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> -</ul> - - - - </div> - </div> - </nav> - - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - - <i data-toggle="wy-nav-top" class="fa fa-bars"></i> - <a href="index.html">binary_c-python</a> - - </nav> - - - <div class="wy-nav-content"> - - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - - <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - - <li><a href="modules.html">Binarycpython code</a> »</li> - - <li>hpc_functions module</li> - - - <li class="wy-breadcrumbs-aside"> - - - <a href="_sources/hpc_functions.rst.txt" rel="nofollow"> View page source</a> - - - </li> - - </ul> - - - <hr/> -</div> - <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> - <div itemprop="articleBody"> - - -<style> -/* CSS overrides for sphinx_rtd_theme */ - -/* 24px margin */ -.nbinput.nblast.container, -.nboutput.nblast.container { - margin-bottom: 19px; /* padding has already 5px */ -} - -/* ... except between code cells! */ -.nblast.container + .nbinput.container { - margin-top: -19px; -} - -.admonition > p:before { - margin-right: 4px; /* make room for the exclamation icon */ -} - -/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ -.math { - text-align: unset; -} -</style> -<div class="section" id="hpc-functions-module"> -<h1>hpc_functions module<a class="headerlink" href="#hpc-functions-module" title="Permalink to this headline">¶</a></h1> -</div> - - - </div> - - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="plot_functions.html" class="btn btn-neutral float-right" title="plot_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="grid_options_defaults.html" class="btn btn-neutral float-left" title="Grid options and descriptions" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - - </div> - - - <hr/> - - <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> - </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. -<br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. -<br><br> -Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. - - - -</footer> - - </div> - </div> - - </section> - - </div> - - - - <script type="text/javascript"> - jQuery(function () { - SphinxRtdTheme.Navigation.enable(true); - }); - </script> - - - - - - -</body> -</html> \ No newline at end of file diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 6f94c41273178f70556d1af6efdf0e4d1bb8b084..2ad1f168b554cfe237b479b99cd244dbc025adca 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -1,69 +1,34 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Welcome to binary_c-python’s documentation! — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Welcome to binary_c-python’s documentation! — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Python module for binary_c" href="readme_link.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="#" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -71,17 +36,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -93,68 +48,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="#">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="#">Docs</a> »</li> - + <li><a href="#" class="icon icon-home"></a> »</li> <li>Welcome to binary_c-python’s documentation!</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/index.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -179,19 +96,19 @@ text-align: unset; } </style> -<div class="section" id="welcome-to-binary-c-python-s-documentation"> -<h1>Welcome to binary_c-python’s documentation!<a class="headerlink" href="#welcome-to-binary-c-python-s-documentation" title="Permalink to this headline">¶</a></h1> -</div> -<div class="section" id="python-module-for-binary-c"> -<h1>Python module for binary_c<a class="headerlink" href="#python-module-for-binary-c" title="Permalink to this headline">¶</a></h1> +<section id="welcome-to-binary-c-python-s-documentation"> +<h1>Welcome to binary_c-python’s documentation!<a class="headerlink" href="#welcome-to-binary-c-python-s-documentation" title="Permalink to this headline">ïƒ</a></h1> +</section> +<section id="python-module-for-binary-c"> +<h1>Python module for binary_c<a class="headerlink" href="#python-module-for-binary-c" title="Permalink to this headline">ïƒ</a></h1> <p>Docstring coverage:</p> <a class="reference external image-reference" href="./badges/docstring_coverage.svg"><img alt="docstring coverage" src="_images/docstring_coverage.svg" /></a> <p>Test coverage:</p> <a class="reference external image-reference" href="./badges/test_coverage.svg"><img alt="test coverage" src="_images/test_coverage.svg" /></a> <p>Binary population synthesis code that interfaces with binary_c. Based on a original work by Jeff Andrews. Updated and extended for Python3 by David Hendriks, Robert Izzard.</p> <p>The current release is version <a class="reference external" href="VERSION">version</a>, make sure to use that version number when installing!</p> -<div class="section" id="requirements"> -<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2> +<section id="requirements"> +<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">ïƒ</a></h2> <p>To run this code you need to at least have installations of:</p> <ul class="simple"> <li><p>Python 3.6 or higher</p></li> @@ -208,9 +125,9 @@ <li><p>matplotlib</p></li> <li><p>py_rinterpolate</p></li> </ul> -</div> -<div class="section" id="environment-variables"> -<h2>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="environment-variables"> +<h2>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">ïƒ</a></h2> <p>Before compilation you need to have certain environment variables:</p> <p>Required:</p> <ul class="simple"> @@ -219,20 +136,20 @@ <li><p><code class="docutils literal notranslate"><span class="pre">LIBRARY_PATH</span></code> should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">GSL_DIR</span></code> should point to the root location where you installed GSL to. This root dir should contain <code class="docutils literal notranslate"><span class="pre">bin/</span></code>, <code class="docutils literal notranslate"><span class="pre">lib/</span></code> etc</p></li> </ul> -</div> -<div class="section" id="build-instructions"> -<h2>Build instructions<a class="headerlink" href="#build-instructions" title="Permalink to this headline">¶</a></h2> +</section> +<section id="build-instructions"> +<h2>Build instructions<a class="headerlink" href="#build-instructions" title="Permalink to this headline">ïƒ</a></h2> <p>First, make sure you have built binary_c (See <code class="docutils literal notranslate"><span class="pre">$BINARY_C/doc/binary_c2.pdf</span></code> section: installation for all the installation instructions for <code class="docutils literal notranslate"><span class="pre">binary_c</span></code>)) and that it functions correctly.</p> -<div class="section" id="installation-via-pip"> -<h3>Installation via PIP:<a class="headerlink" href="#installation-via-pip" title="Permalink to this headline">¶</a></h3> +<section id="installation-via-pip"> +<h3>Installation via PIP:<a class="headerlink" href="#installation-via-pip" title="Permalink to this headline">ïƒ</a></h3> <p>To install this package via pip:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">binarycpython</span> </pre></div> </div> <p>This will install the latest stable installation that is available on pip.</p> -</div> -<div class="section" id="installation-from-source"> -<h3>Installation from source:<a class="headerlink" href="#installation-from-source" title="Permalink to this headline">¶</a></h3> +</section> +<section id="installation-from-source"> +<h3>Installation from source:<a class="headerlink" href="#installation-from-source" title="Permalink to this headline">ïƒ</a></h3> <p>We can also install the package from source, which is useful for development versions and when you want to modify the code. It is recommended that you install this into a virtual environment. From within the root directory, run</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">install</span><span class="o">.</span><span class="n">sh</span> </pre></div> @@ -243,33 +160,33 @@ </pre></div> </div> <p>to reinstall just binarycpython.</p> -<div class="section" id="after-installation"> -<h4>After installation<a class="headerlink" href="#after-installation" title="Permalink to this headline">¶</a></h4> +<section id="after-installation"> +<h4>After installation<a class="headerlink" href="#after-installation" title="Permalink to this headline">ïƒ</a></h4> <p>After installing the code via source it is useful to run the test suite before doing any programming with it. The test suite is stored in <code class="docutils literal notranslate"><span class="pre">binarycpython/tests</span></code> and running <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">main.py</span></code> in there will run all the tests.</p> -</div> -</div> -</div> -<div class="section" id="examples"> -<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +</section> +</section> +</section> +<section id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">ïƒ</a></h2> <p>See the examples/ directory for example scripts and notebooks. The documentation contains example pages as well.</p> -</div> -<div class="section" id="usage-notes"> -<h2>Usage notes<a class="headerlink" href="#usage-notes" title="Permalink to this headline">¶</a></h2> +</section> +<section id="usage-notes"> +<h2>Usage notes<a class="headerlink" href="#usage-notes" title="Permalink to this headline">ïƒ</a></h2> <p>Make sure that with every change/recompilation you make in <code class="docutils literal notranslate"><span class="pre">binary_c</span></code>, you also rebuild this package. Whenever you change the sourcecode of this package, you need to reinstall it into your virtualenvironment as well</p> -</div> -<div class="section" id="documentation"> -<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h2> +</section> +<section id="documentation"> +<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">ïƒ</a></h2> <p>Look in the docs/ directory. Within the build/html/ there is the html version of the documentation. The</p> -</div> -<div class="section" id="development"> -<h2>Development:<a class="headerlink" href="#development" title="Permalink to this headline">¶</a></h2> +</section> +<section id="development"> +<h2>Development:<a class="headerlink" href="#development" title="Permalink to this headline">ïƒ</a></h2> <p>If you want to contribute to the code, then it is recommended that you install the packages in <code class="docutils literal notranslate"><span class="pre">development_requirements.txt</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">development_requirements</span><span class="o">.</span><span class="n">txt</span> </pre></div> </div> -</div> -<div class="section" id="faq-issues"> -<h2>FAQ/Issues:<a class="headerlink" href="#faq-issues" title="Permalink to this headline">¶</a></h2> +</section> +<section id="faq-issues"> +<h2>FAQ/Issues:<a class="headerlink" href="#faq-issues" title="Permalink to this headline">ïƒ</a></h2> <p>Building issues with binary_c itself:</p> <ul class="simple"> <li><p>see the documentation of binary_c (in doc/).</p></li> @@ -303,14 +220,24 @@ </li> <li class="toctree-l1"><a class="reference internal" href="modules.html">Binarycpython code</a><ul> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -351,68 +278,51 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> </div> -</div> -</div> -<div class="section" id="indices-and-tables"> -<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1> +</section> +</section> +<section id="indices-and-tables"> +<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">ïƒ</a></h1> <ul class="simple"> <li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li> <li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li> <li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li> </ul> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="readme_link.html" class="btn btn-neutral float-right" title="Python module for binary_c" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="readme_link.html" class="btn btn-neutral float-right" title="Python module for binary_c" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/modules.html b/docs/build/html/modules.html index 47cb1fa847984b1f5c00f2d24100bc38fc10cde7..558683b2694027feb58a9ebd53fb9a19dd195cce 100644 --- a/docs/build/html/modules.html +++ b/docs/build/html/modules.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Binarycpython code — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Binarycpython code — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="custom_logging_functions module" href="custom_logging_functions.html" /> <link rel="prev" title="Python module for binary_c" href="readme_link.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="current reference internal" href="#">Binarycpython code</a><ul> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,68 +72,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Binarycpython code</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/modules.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -193,79 +120,71 @@ text-align: unset; } </style> -<div class="section" id="binarycpython-code"> -<h1>Binarycpython code<a class="headerlink" href="#binarycpython-code" title="Permalink to this headline">¶</a></h1> +<section id="binarycpython-code"> +<h1>Binarycpython code<a class="headerlink" href="#binarycpython-code" title="Permalink to this headline">ïƒ</a></h1> <p>This chapter contains the (auto)documentation for all the functions and modules in the source code of binarycpython</p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l1"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l1"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l1"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l1"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l1"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l1"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l1"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l1"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l1"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l1"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l1"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> </div> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="custom_logging_functions.html" class="btn btn-neutral float-right" title="custom_logging_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="readme_link.html" class="btn btn-neutral float-left" title="Python module for binary_c" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="readme_link.html" class="btn btn-neutral float-left" title="Python module for binary_c" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="custom_logging_functions.html" class="btn btn-neutral float-right" title="custom_logging_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 763059a345aa5bc24830ebca393c9d3263f13d50..771c26ac8311da27a47c9b6738c155678afc6aa7 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/plot_functions.html b/docs/build/html/plot_functions.html index 171f5b32e9396585c65230096e88a6a408d1fbdc..9c5e72e8b11b890cfd670bd6f5a993b8da7db3ca 100644 --- a/docs/build/html/plot_functions.html +++ b/docs/build/html/plot_functions.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>plot_functions module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>plot_functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="run_system_wrapper module" href="run_system_wrapper.html" /> - <link rel="prev" title="hpc_functions module" href="hpc_functions.html" /> + <link rel="next" title="functions module" href="population_extensions/analytics.html" /> + <link rel="prev" title="grid_class module" href="grid.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>plot_functions module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/plot_functions.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,8 +121,8 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.plot_functions"> -<span id="plot-functions-module"></span><h1>plot_functions module<a class="headerlink" href="#module-binarycpython.utils.plot_functions" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.plot_functions"> +<span id="plot-functions-module"></span><h1>plot_functions module<a class="headerlink" href="#module-binarycpython.utils.plot_functions" title="Permalink to this headline">ïƒ</a></h1> <p>Module that contains functionality to plot some properties of (binary) systems.</p> <p>Different routines are defined here to plot orbits, masses, angular momenta etc.</p> <dl class="simple"> @@ -219,19 +145,19 @@ TODO: Put all the plotting functions in here</p> </dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.color_by_index"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">color_by_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">column</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#color_by_index"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.color_by_index" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">color_by_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">column</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#color_by_index"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.color_by_index" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that returns a color based on row and column information. Used to color the stellar types</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.dummy"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">dummy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#dummy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.dummy" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">dummy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#dummy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.dummy" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Placeholder function</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.parse_function_hr_diagram"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_hr_diagram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_hr_diagram"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_hr_diagram" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_hr_diagram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_hr_diagram"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_hr_diagram" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Parsing function for the HR plotting routine</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -245,7 +171,7 @@ TODO: Put all the plotting functions in here</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.parse_function_masses"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_masses</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_masses"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_masses" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_masses</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_masses"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_masses" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Parsing function for the orbit plotting routine</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -259,7 +185,7 @@ TODO: Put all the plotting functions in here</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.parse_function_orbit"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_orbit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_orbit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_orbit" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">parse_function_orbit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#parse_function_orbit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.parse_function_orbit" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Parsing function for the orbit plotting routine</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -273,7 +199,7 @@ TODO: Put all the plotting functions in here</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.plot_HR_diagram"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_HR_diagram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_astropy_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_HR_diagram"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_HR_diagram" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_HR_diagram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_astropy_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_HR_diagram"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_HR_diagram" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to plot the HR diagram evolution of the system. Assumes its a binary system.</p> <p>For a single star see plot_HR_diagram_single</p> <p>Plot shows Log luminosity on y axis, @@ -318,7 +244,7 @@ log temperature on x axis (reversed)</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.plot_masses"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_masses</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_masses"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_masses" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_masses</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_masses"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_masses" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to plot the masses of the system.</p> <dl class="simple"> <dt>Function requires the following keys:</dt><dd><ul class="simple"> @@ -358,7 +284,7 @@ log temperature on x axis (reversed)</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.plot_orbit"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_orbit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_orbit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_orbit" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_orbit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_stellar_types</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_orbit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_orbit" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to plot the orbital elements of the system</p> <dl class="simple"> <dt>Plots the following quantities:</dt><dd><ul class="simple"> @@ -386,7 +312,7 @@ log temperature on x axis (reversed)</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.plot_functions.plot_system"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_system</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">plot_type</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_system"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_system" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.plot_functions.</span></span><span class="sig-name descname"><span class="pre">plot_system</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">plot_type</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/plot_functions.html#plot_system"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.plot_functions.plot_system" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to plot the different quantities of a system.</p> <dl class="simple"> <dt>This goes (in general) via the following steps:</dt><dd><ul class="simple"> @@ -428,61 +354,43 @@ This is not included in all the plotting routines.</p></li> </dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="run_system_wrapper.html" class="btn btn-neutral float-right" title="run_system_wrapper module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="hpc_functions.html" class="btn btn-neutral float-left" title="hpc_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="grid.html" class="btn btn-neutral float-left" title="grid_class module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="population_extensions/analytics.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/HPC.html b/docs/build/html/population_extensions/HPC.html new file mode 100644 index 0000000000000000000000000000000000000000..95f3adc0222cf88db5a21918d1d8627e5d186612 --- /dev/null +++ b/docs/build/html/population_extensions/HPC.html @@ -0,0 +1,391 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="metadata.html" /> + <link rel="prev" title="functions module" href="grid_options_defaults.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/HPC.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.HPC"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.HPC" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the functions to HPC functionality</p> +<p>These functions form a single API through which you can access HPC resources.</p> +<p>Generally, you should call an HPC function rather than the Slurm or Condor interface +directly. The HPC function then decides which interface to use, so that all the +other modules can use a single API rather than have to choose to use the Slurm or +Condor API.</p> +<p>This class object is an extension to the population grid object</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.HPC.</span></span><span class="sig-name descname"><span class="pre">HPC</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <a class="reference internal" href="condor.html#binarycpython.utils.population_extensions.condor.condor" title="binarycpython.utils.population_extensions.condor.condor"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.condor.condor</span></code></a>, <a class="reference internal" href="slurm.html#binarycpython.utils.population_extensions.slurm.slurm" title="binarycpython.utils.population_extensions.slurm.slurm"><code class="xref py py-class docutils literal notranslate"><span class="pre">binarycpython.utils.population_extensions.slurm.slurm</span></code></a></p> +<p>Extension to the population grid object that contains functionality to handle handle the Moe & distefano distributions</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_can_join"> +<span class="sig-name descname"><span class="pre">HPC_can_join</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">joinfiles</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">joiningfile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vb</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_can_join"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_can_join" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Check the joinfiles to make sure they all exist +and their .saved equivalents also exist</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_check_requirements"> +<span class="sig-name descname"><span class="pre">HPC_check_requirements</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_check_requirements"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_check_requirements" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to check HPC option requirements have been met. Returns a tuple: (True,â€â€) if all is ok, (False,<warning string>) otherwise.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_dir"> +<span class="sig-name descname"><span class="pre">HPC_dir</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_dir" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return an HPC job’s directory.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_dirs"> +<span class="sig-name descname"><span class="pre">HPC_dirs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_dirs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_dirs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return a list of directories required for this HPC job.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_dump_status"> +<span class="sig-name descname"><span class="pre">HPC_dump_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_dump_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_dump_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to print the status of the HPC grid</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_get_status"> +<span class="sig-name descname"><span class="pre">HPC_get_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">job_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">job_index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hpc_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_get_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_get_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Get and return the appropriate HPC job (Condor or Slurm) status string for this job (or, if given, the job at id.index)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>hpc_dir</strong> – optional HPC run directory. If not set, the default (e.g. slurm_dir or condor_dir) +is used.</p></li> +<li><p><strong>job_id</strong> – the id and index of the job to be queried</p></li> +<li><p><strong>job_index</strong> – the id and index of the job to be queried</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_grid"> +<span class="sig-name descname"><span class="pre">HPC_grid</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">makejoiningfile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_grid"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_grid" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to call the appropriate HPC grid function +(e.g. Slurm or Condor) and return what it returns.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>makejoiningfile</strong> – if True, and we’re the first job with self.HPC_task() == 2, we build the joiningfile. (default=True) This option exists in case you don’t want to overwrite an existing joiningfile, or want to build it in another way (e.g. in the HPC scripts).</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_id_filename"> +<span class="sig-name descname"><span class="pre">HPC_id_filename</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_id_filename"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_filename" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>HPC jobs have a filename in their directory which specifies the job id. This function returns the contents of that file as a string, or None on failure.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_id_from_dir"> +<span class="sig-name descname"><span class="pre">HPC_id_from_dir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hpc_dir</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_id_from_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_id_from_dir" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the ID of an HPC run given its (already existing) directory.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_job"> +<span class="sig-name descname"><span class="pre">HPC_job</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_job"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_job" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return True if we’re running an HPC (Slurm or Condor) job, False otherwise.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID"> +<span class="sig-name descname"><span class="pre">HPC_jobID</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_jobID"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return an HPC (Slurm or Condor) job id in the form x.y. Returns None if not an HPC job.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID_tuple"> +<span class="sig-name descname"><span class="pre">HPC_jobID_tuple</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_jobID_tuple"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_jobID_tuple" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return the job ID as a tuple of ints, (x,y), or (None,None) on failure</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_job_task"> +<span class="sig-name descname"><span class="pre">HPC_job_task</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_job_task"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_task" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the HPC task number, which is 1 when setting +up and running the scripts, 2 when joining data.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_job_type"> +<span class="sig-name descname"><span class="pre">HPC_job_type</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_job_type"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_job_type" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return a string telling us the type of an HPC job, i.e. +“slurmâ€, “condor†or “Noneâ€.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_join_from_files"> +<span class="sig-name descname"><span class="pre">HPC_join_from_files</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">newobj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">joinfiles</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_join_from_files"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_from_files" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Merge the results from the list joinfiles into newobj.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_join_previous"> +<span class="sig-name descname"><span class="pre">HPC_join_previous</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_join_previous"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_join_previous" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to join previously generated datasets.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_joinlist"> +<span class="sig-name descname"><span class="pre">HPC_joinlist</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">joinlist</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_joinlist"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_joinlist" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the default HPC joinlist file.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_load_joinfiles_list"> +<span class="sig-name descname"><span class="pre">HPC_load_joinfiles_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">joinlist</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_load_joinfiles_list"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_load_joinfiles_list" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to load in the list of files we should join, and return it.</p> +<p>If grid_options[‘HPC_rebuild_joinlist’] is True, we rebuild it.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_make_joiningfile"> +<span class="sig-name descname"><span class="pre">HPC_make_joiningfile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hpc_jobid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hpc_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">overwrite</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">error_on_overwrite</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_make_joiningfile"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_make_joiningfile" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to make the joiningfile file that contains the filenames of results from each job. When all these exist, we can join.</p> +<p>Note: you normally don’t need to set any of the option arguments.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>hpc_jobid</strong> – the job ID number, or self.HPC_jobID_tuple()[0] if None (default=None).</p></li> +<li><p><strong>hpc_dir</strong> – the HPC directory, or self.HPC_dir() if None (default=None).</p></li> +<li><p><strong>n</strong> – the number of jobs, or self.HPC_njobs() if None (default=None).</p></li> +<li><p><strong>overwrite</strong> – if True, overwrite an existing joiningfile (default=False)</p></li> +<li><p><strong>error_on_overwite</strong> – if True, and we try to overwrite, issue and error and exit (default=False)</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>True if the file is made, False otherwise.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_njobs"> +<span class="sig-name descname"><span class="pre">HPC_njobs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_njobs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_njobs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the number of jobs this HPC jobs will use, as an int.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_path"> +<span class="sig-name descname"><span class="pre">HPC_path</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_path"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_path" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to file the filename of this HPC job’s file at path.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_queue_stats"> +<span class="sig-name descname"><span class="pre">HPC_queue_stats</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_queue_stats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_queue_stats" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the queue stats for the HPC grid +TODO: the slurm_queue_stats doesntt actually return anything</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_restore"> +<span class="sig-name descname"><span class="pre">HPC_restore</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_restore"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_restore" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Set grid_options[‘restore_from_snapshot_file’] so that we restore data from existing +an HPC run if self.grid_options[hpc_job_type+’_restart_dir’], where hpc_job_type is “slurm†or “condorâ€, +is provided, otherwise do nothing. This only works if grid_options[hpc_job_type] == self.HPC_job_task() == 2, which is +the run-grid stage of the process.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_set_status"> +<span class="sig-name descname"><span class="pre">HPC_set_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_set_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_set_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Set the appropriate HPC job (Condor or Slurm) status file to whatever is given in string.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>string</strong> – the new contents of the status file</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>True if the status was set, False otherwise. +(As returned by either the appropriate Condor or Slurm function)</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_snapshot_filename"> +<span class="sig-name descname"><span class="pre">HPC_snapshot_filename</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_snapshot_filename"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_snapshot_filename" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return an HPC job’s snapshot filename.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_status"> +<span class="sig-name descname"><span class="pre">HPC_status</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return a dict of useful information about the current status +of this HPC run.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.HPC.HPC.HPC_touch"> +<span class="sig-name descname"><span class="pre">HPC_touch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">string</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/HPC.html#HPC.HPC_touch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.HPC.HPC.HPC_touch" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to touch the file at filename, put into it the job number +and (if given) the string passed in.</p> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="grid_options_defaults.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="metadata.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/analytics.html b/docs/build/html/population_extensions/analytics.html new file mode 100644 index 0000000000000000000000000000000000000000..5334d70be0e5a2a070c49ef6f3d0f8cbbadb99ff --- /dev/null +++ b/docs/build/html/population_extensions/analytics.html @@ -0,0 +1,200 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="cache.html" /> + <link rel="prev" title="plot_functions module" href="../plot_functions.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/analytics.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.analytics"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.analytics" title="Permalink to this headline">ïƒ</a></h1> +<p>The class extension for the population object that contains analytics functionality</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.analytics.analytics"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.analytics.</span></span><span class="sig-name descname"><span class="pre">analytics</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/analytics.html#analytics"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.analytics.analytics" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension for the Population class containing the functions for analytics</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.analytics.analytics.CPU_time"> +<span class="sig-name descname"><span class="pre">CPU_time</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/analytics.html#analytics.CPU_time"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.analytics.analytics.CPU_time" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return how much CPU time we’ve used</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.analytics.analytics.make_analytics_dict"> +<span class="sig-name descname"><span class="pre">make_analytics_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/analytics.html#analytics.make_analytics_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.analytics.analytics.make_analytics_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to create the analytics dictionary</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.analytics.analytics.set_time"> +<span class="sig-name descname"><span class="pre">set_time</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">when</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/analytics.html#analytics.set_time"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.analytics.analytics.set_time" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to set the timestamp at when, where when is ‘start’ or ‘end’.</p> +<p>If when == end, we also calculate the time elapsed.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.analytics.analytics.time_elapsed"> +<span class="sig-name descname"><span class="pre">time_elapsed</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">force</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/analytics.html#analytics.time_elapsed"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.analytics.analytics.time_elapsed" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return how long a population object has been running.</p> +<p>We return the cached value if it’s available, and calculate +the time elapsed if otherwise or if force is True</p> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="../plot_functions.html" class="btn btn-neutral float-left" title="plot_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="cache.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/cache.html b/docs/build/html/population_extensions/cache.html new file mode 100644 index 0000000000000000000000000000000000000000..fc045b77f9264d15a188e5958cc8e0c8181e41d0 --- /dev/null +++ b/docs/build/html/population_extensions/cache.html @@ -0,0 +1,234 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="condor.html" /> + <link rel="prev" title="functions module" href="analytics.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/cache.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.cache"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.cache" title="Permalink to this headline">ïƒ</a></h1> +<p>File containing the class extension for the population object that contains cache functionality</p> +<p>Module containing (e.g. LRU) cache functionality for binary_c-python.</p> +<p>We use cachetools when possible because this allows us to set up the +cache of the appropriate size for the task in the grid_options dict. +Please see the LRU_* options in there.</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.cache.</span></span><span class="sig-name descname"><span class="pre">cache</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Class extension for the population object that contains cache functionality</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.NullCache"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">NullCache</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.NullCache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.NullCache" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cachetools.Cache</span></code></p> +<p>A cachetools cache object that does as little as possible and never matches.</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.NullCache.__delitem__"> +<span class="sig-name descname"><span class="pre">__delitem__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.NullCache.__delitem__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.NullCache.__delitem__" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>deleter function placeholder</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.NullCache.__getitem__"> +<span class="sig-name descname"><span class="pre">__getitem__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.NullCache.__getitem__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.NullCache.__getitem__" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>getter function placeholder</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.NullCache.__setitem__"> +<span class="sig-name descname"><span class="pre">__setitem__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.NullCache.__setitem__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.NullCache.__setitem__" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Setter function placeholder</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.NullCache.popitem"> +<span class="sig-name descname"><span class="pre">popitem</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.NullCache.popitem"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.NullCache.popitem" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>pop function placeholder</p> +</dd></dl> + +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.default_cache_dir"> +<span class="sig-name descname"><span class="pre">default_cache_dir</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.default_cache_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.default_cache_dir" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return a default cache directory path for binary_c-python, or None if we cannot find one. This is used in grid_options_defaults.py</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.setup_function_cache"> +<span class="sig-name descname"><span class="pre">setup_function_cache</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vb</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cachetype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.setup_function_cache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.setup_function_cache" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to wrap binary_c-python’s functions in function cache.</p> +<p>The functions listed in self.grid_options[‘function_cache_functions’] are +given caches of size self.grid_options[‘function_cache_size’][func]</p> +<p>Args: None</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.cache.cache.test_caches"> +<span class="sig-name descname"><span class="pre">test_caches</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dt</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5.0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/cache.html#cache.test_caches"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.cache.cache.test_caches" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to test cache speeds of the functions that binary_c-python automatically caches.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>dt</strong> (<em>default 5</em>) – </p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="analytics.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="condor.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/condor.html b/docs/build/html/population_extensions/condor.html new file mode 100644 index 0000000000000000000000000000000000000000..f128bf681ad951a6c96790d1c77ce72b7feb2732 --- /dev/null +++ b/docs/build/html/population_extensions/condor.html @@ -0,0 +1,251 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="dataIO.html" /> + <link rel="prev" title="functions module" href="cache.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/condor.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.condor"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.condor" title="Permalink to this headline">ïƒ</a></h1> +<p>The class extension for the population object that contains the Condor functionality</p> +<p>TODO: there are many uses of $<variable name> in this file but this is not perl and we should replace them by actual format placeholders</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.condor.</span></span><span class="sig-name descname"><span class="pre">condor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension for the Population class containing the code for Condor grid runs</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condorID"> +<span class="sig-name descname"><span class="pre">condorID</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ClusterID</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Process</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condorID"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condorID" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return a Condor job ID. The ClusterID and Process passed in are used if given, otherwise we default to the condor_ClusterID and condor_Process in grid_options.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_check_requirements"> +<span class="sig-name descname"><span class="pre">condor_check_requirements</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_check_requirements"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_check_requirements" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to check whether the condor parameters in grid_options have been set appropriately.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_dirs"> +<span class="sig-name descname"><span class="pre">condor_dirs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_dirs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_dirs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Directories associated specifically with this condor job.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_grid"> +<span class="sig-name descname"><span class="pre">condor_grid</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_grid"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_grid" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>function to be called when running grids when grid_options[‘condor’]>=1</p> +<p>if grid_options[‘condor’]==1, we set up the condor script and launch the jobs, then return True to exit. +if grid_options[‘condor’]==2, we run the stars, which means we return False to continue. +if grid_options[‘condor’]==3, we are being called from the jobs to run the grids, return False to continue.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_outfile"> +<span class="sig-name descname"><span class="pre">condor_outfile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_outfile"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_outfile" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>return a standard filename for the condor chunk files</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_queue_stats"> +<span class="sig-name descname"><span class="pre">condor_queue_stats</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_queue_stats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_queue_stats" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return condor queue statistics for this job</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condor_status_file"> +<span class="sig-name descname"><span class="pre">condor_status_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ClusterID</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Process</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condor_status_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condor_status_file" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return the condor status file corresponding to the ClusterID and Process, which default to grid_options condor_ClusterID and condor_Process, respectively.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.condorpath"> +<span class="sig-name descname"><span class="pre">condorpath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.condorpath"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.condorpath" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the full condor directory path.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.get_condor_status"> +<span class="sig-name descname"><span class="pre">get_condor_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ClusterID</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Process</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.get_condor_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.get_condor_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Get and return the condor status corresponing to the self object, or ClusterID.Process if they are passed in. If no status is found, returns an empty string..</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.make_condor_dirs"> +<span class="sig-name descname"><span class="pre">make_condor_dirs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.make_condor_dirs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.make_condor_dirs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to make the condor directories</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.condor.condor.set_condor_status"> +<span class="sig-name descname"><span class="pre">set_condor_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">condor_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/condor.html#condor.set_condor_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.condor.condor.set_condor_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Set the condor status corresponing to the self object, which should have condor_ClusterID and condor_Process set.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>string</strong> – the status string to be set</p></li> +<li><p><strong>dir</strong> – the directory in which the status directory is held. If not set, this defaults to the HPC directory (e.g. slurm_dir or condor_dir).</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="cache.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="dataIO.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/dataIO.html b/docs/build/html/population_extensions/dataIO.html new file mode 100644 index 0000000000000000000000000000000000000000..eae9da7ee94f89e3aef445ec69838b12bf622df7 --- /dev/null +++ b/docs/build/html/population_extensions/dataIO.html @@ -0,0 +1,412 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="distribution_functions.html" /> + <link rel="prev" title="functions module" href="condor.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/dataIO.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.dataIO"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.dataIO" title="Permalink to this headline">ïƒ</a></h1> +<p>File containing the class extension for the population object that contains data input-output (IO) functions</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.dataIO.</span></span><span class="sig-name descname"><span class="pre">dataIO</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Class extension for the population object that contains data input-output (IO) functions</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.NFS_flush_hack"> +<span class="sig-name descname"><span class="pre">NFS_flush_hack</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.NFS_flush_hack"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.NFS_flush_hack" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Use opendir()/closedir() to flush NFS access to a file. +NOTE: this may or may not work!</p> +<p>TODO: This function leads to a complaint about unclosed scandir operators. Check if that can be resolved.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.NFSpath"> +<span class="sig-name descname"><span class="pre">NFSpath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.NFSpath"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.NFSpath" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Test path to see if it’s on an NFS mount.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>path</strong> – the path to be tested</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>if on an NFS mount point. +False : if not. +None : if the path does not exist.</p> +</dd> +<dt class="field-odd">Return type</dt> +<dd class="field-odd"><p>True</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.compression_type"> +<span class="sig-name descname"><span class="pre">compression_type</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.compression_type"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.compression_type" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return the compression type of the ensemble file, based on its filename extension.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.dir_ok"> +<span class="sig-name descname"><span class="pre">dir_ok</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">directory</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.dir_ok"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.dir_ok" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to test if we can read and write to a directory that must exist. Return True if all is ok, False otherwise.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.load_population_object"> +<span class="sig-name descname"><span class="pre">load_population_object</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.load_population_object"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.load_population_object" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>returns the Population object loaded from filename</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.load_snapshot"> +<span class="sig-name descname"><span class="pre">load_snapshot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.load_snapshot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.load_snapshot" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Load a snapshot from file and set it in the preloaded_population placeholder.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.locked_close"> +<span class="sig-name descname"><span class="pre">locked_close</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.locked_close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.locked_close" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Partner function to locked_open_for_write()</p> +<p>Closes and unlocks the file</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.locked_open_for_write"> +<span class="sig-name descname"><span class="pre">locked_open_for_write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'utf-8'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_suffix</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'.lock'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_lifetime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">60</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exists_ok</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fatal_open_errors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vb</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.locked_open_for_write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.locked_open_for_write" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Wrapper for Python’s open(filename) which opens a file at +filename for writing (mode “wâ€) and locks it.</p> +<p>We check whether the file’s lockfile already exists, in which +case just return (None,None), and if we cannot obtain a +lock on the file we also return (None,None).</p> +<p>If the file does not exist, we keep trying to lock until it does.</p> +<p>To do the locking, we use flufl.lock which is NFS safe.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>lock_lifetime</strong> – (passed to flufl.lock.Lock()) default 60 seconds. +It should take less than this time to write the file.</p></li> +<li><p><strong>lock_timeout</strong> – (passed to flufl.lock.Lock()) default 5 seconds. +This should be non-zero.</p></li> +<li><p><strong>fatal_open_errors</strong> – if open() fails and fatal_open_errors is True, exit.</p></li> +<li><p><strong>exists_ok</strong> – if False and the file at filename exists, return (None,None) (default False)</p></li> +<li><p><strong>vb</strong> – verbose logging if True, defaults to False</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>(file_object, lock_object) tuple. +If the file was not opened, returns (None,None).</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations"> +<span class="sig-name descname"><span class="pre">merge_populations</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">refpop</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newpop</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.merge_populations"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>merge newpop’s results data into refpop’s results data</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>refpop</strong> – the original “reference†Population object to be added to</p></li> +<li><p><strong>newpop</strong> – Population object containing the new data</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>nothing</p> +</dd> +</dl> +<div class="admonition note"> +<p class="admonition-title">Note</p> +<p>The file should be saved using save_population_object()</p> +</div> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations_from_file"> +<span class="sig-name descname"><span class="pre">merge_populations_from_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">refpop</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.merge_populations_from_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.merge_populations_from_file" title="Permalink to this definition">ïƒ</a></dt> +<dd><blockquote> +<div><p>Wrapper for merge_populations so it can be done directly +from a file.</p> +</div></blockquote> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>refpop</strong> – the original “reference†Population object to be added to</p></li> +<li><p><strong>filename</strong> – file containing the Population object containing the new data</p></li> +</ul> +</dd> +</dl> +<div class="admonition note"> +<p class="admonition-title">Note</p> +<p>The file should be saved using save_population_object()</p> +</div> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.open"> +<span class="sig-name descname"><span class="pre">open</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'r'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buffering</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">errors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newline</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">closefd</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opener</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compresslevel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vb</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.open"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.open" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Wrapper for open() with automatic compression based on the file extension.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.save_population_object"> +<span class="sig-name descname"><span class="pre">save_population_object</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">population_object</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">confirmation</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'gzip'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.save_population_object"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.save_population_object" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Save pickled Population object to file at filename or, if filename is None, whatever is set at self.grid_options[‘save_population_object’]</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>population_object</strong> – the object to be saved to the file. If population_object is None, use self.</p></li> +<li><p><strong>filename</strong> – the name of the file to be saved. If not set, use self.grid_options[‘save_population_object’]</p></li> +<li><p><strong>confirmation</strong> – if True, a file “filename.saved†is touched just after the dump, so we know it is finished. TODO: fix this</p></li> +<li><p><strong>compression</strong> (<em>optional</em><em>, </em><em>default = "gzip"</em>) – TODO: fix this</p></li> +</ul> +</dd> +</dl> +<p>Compression is performed according to the filename, as stated in the +compress_pickle documentation at +<a class="reference external" href="https://lucianopaz.github.io/compress_pickle/html/">https://lucianopaz.github.io/compress_pickle/html/</a></p> +<p>Shared memory, stored in the population_object.shared_memory dict, is not saved.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.save_snapshot"> +<span class="sig-name descname"><span class="pre">save_snapshot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.save_snapshot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.save_snapshot" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Save the population object to a snapshot file, automatically choosing the filename if none is given.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.set_status"> +<span class="sig-name descname"><span class="pre">set_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">format_statment</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'process_{}.txt'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ID</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.set_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.set_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to set the status string in its appropriate file</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.snapshot_filename"> +<span class="sig-name descname"><span class="pre">snapshot_filename</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.snapshot_filename"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.snapshot_filename" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Automatically choose the snapshot filename.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.wait_for_unlock"> +<span class="sig-name descname"><span class="pre">wait_for_unlock</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_suffix</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'.lock'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.wait_for_unlock"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.wait_for_unlock" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Companion to locked_open_for_write that waits for a filename +to a) exist and b) be unlocked.</p> +<p>This should work because the lock file is created before the file +is created.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.write_binary_c_calls_to_file"> +<span class="sig-name descname"><span class="pre">write_binary_c_calls_to_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'utf-8'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.write_binary_c_calls_to_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.write_binary_c_calls_to_file" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that loops over the grid code and writes the generated parameters to a file. +In the form of a command line call</p> +<p>Only useful when you have a variable grid as system_generator. MC wouldn’t be that useful</p> +<p>Also, make sure that in this export there are the basic parameters +like m1,m2,sep, orb-per, ecc, probability etc.</p> +<p>On default this will write to the datadir, if it exists</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>output_dir</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – (optional, default = None) directory where to write the file to. If custom_options[‘data_dir’] is present, then that one will be used first, and then the output_dir</p></li> +<li><p><strong>output_filename</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – (optional, default = None) filename of the output. If not set it will be called “binary_c_calls.txtâ€</p></li> +<li><p><strong>include_defaults</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – (optional, default = None) whether to include the defaults of binary_c in the lines that are written. Beware that this will result in very long lines, and it might be better to just export the binary_c defaults and keep them in a separate file.</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>filename that was used to write the calls to</p> +</dd> +<dt class="field-odd">Return type</dt> +<dd class="field-odd"><p>filename</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.dataIO.dataIO.write_ensemble"> +<span class="sig-name descname"><span class="pre">write_ensemble</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">4</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'utf-8'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/dataIO.html#dataIO.write_ensemble"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.dataIO.dataIO.write_ensemble" title="Permalink to this definition">ïƒ</a></dt> +<dd><blockquote> +<div><p>write_ensemble : Write ensemble results to a file.</p> +</div></blockquote> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>output_file</strong> – <p>the output filename.</p> +<p>If the filename has an extension that we recognise, +e.g. .gz or .bz2, we compress the output appropriately.</p> +<p>The filename should contain .json or .msgpack, the two +currently-supported formats.</p> +<p>Usually you’ll want to output to JSON, but we can +also output to msgpack.</p> +</p></li> +<li><p><strong>data</strong> – the data dictionary to be converted and written to the file. +If not set, this defaults to self.grid_ensemble_results.</p></li> +<li><p><strong>sort_keys</strong> – if True, and output is to JSON, the keys will be sorted. +(default: True, passed to json.dumps)</p></li> +<li><p><strong>indent</strong> – number of space characters used in the JSON indent. (Default: 4, +passed to json.dumps)</p></li> +<li><p><strong>encoding</strong> – file encoding method, usually defaults to ‘utf-8’</p></li> +<li><p><strong>ensure_ascii</strong> – the ensure_ascii flag passed to json.dump and/or json.dumps +(Default: False)</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="condor.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="distribution_functions.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/distribution_functions.html b/docs/build/html/population_extensions/distribution_functions.html new file mode 100644 index 0000000000000000000000000000000000000000..d5f38b42a4016dba9c4f39f55256354f6c32db79 --- /dev/null +++ b/docs/build/html/population_extensions/distribution_functions.html @@ -0,0 +1,852 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="gridcode.html" /> + <link rel="prev" title="functions module" href="dataIO.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/distribution_functions.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.distribution_functions"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.distribution_functions" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the predefined distribution functions</p> +<p>The user can use any of these distribution functions to +generate probability distributions for sampling populations</p> +<p>To add custom functions you can take any function and add it to the class instance before running the code. +See <a class="reference external" href="https://stackoverflow.com/a/28060251">https://stackoverflow.com/a/28060251</a> for some tips on how to do that</p> +<dl class="simple"> +<dt>There are distributions for the following parameters:</dt><dd><ul class="simple"> +<li><p>mass</p></li> +<li><p>period</p></li> +<li><p>mass ratio</p></li> +<li><p>binary fraction</p></li> +</ul> +</dd> +<dt>Tasks:</dt><dd><ul class="simple"> +<li><dl class="simple"> +<dt>TODO: make some things globally present? rob does this in his module..i guess it saves</dt><dd><p>calculations but not sure if I’m gonna do that now</p> +</dd> +</dl> +</li> +<li><p>TODO: add eccentricity distribution: thermal, Mathieu eccentricity</p></li> +<li><p>TODO: Add SFH distributions depending on redshift</p></li> +<li><p>TODO: Add metallicity distributions depending on redshift</p></li> +<li><p>TODO: Add initial rotational velocity distributions</p></li> +<li><p>TODO: make an n-part power law that’s general enough to fix the three part and the 4 part</p></li> +</ul> +</dd> +</dl> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.distribution_functions.</span></span><span class="sig-name descname"><span class="pre">distribution_functions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension for the Population grid object that contains the distribution functions</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Arenou2010_binary_fraction"> +<span class="sig-name descname"><span class="pre">Arenou2010_binary_fraction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.Arenou2010_binary_fraction"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Arenou2010_binary_fraction" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Arenou 2010 function for the binary fraction as f(M1)</p> +<p>GAIA-C2-SP-OPM-FA-054 +www.rssd.esa.int/doc_fetch.php?id=2969346</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>binary fraction at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Izzard2012_period_distribution"> +<span class="sig-name descname"><span class="pre">Izzard2012_period_distribution</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">P</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log10Pmin</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1.0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.Izzard2012_period_distribution"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Izzard2012_period_distribution" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>period distribution which interpolates between +Duquennoy and Mayor 1991 at low mass (G/K spectral type <~1.15Msun) +and Sana et al 2012 at high mass (O spectral type >~16.3Msun)</p> +<p>This gives dN/dlogP, i.e. DM/Raghavan’s Gaussian in log10P at low mass +and Sana’s power law (as a function of logP) at high mass</p> +<p>TODO: fix this function</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>P</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – period</p></li> +<li><p><strong>M1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – Primary star mass</p></li> +<li><p><strong>log10Pmin</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – minimum period in base log10 (optional)</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of interpolated distribution function at P and M1</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Kroupa2001"> +<span class="sig-name descname"><span class="pre">Kroupa2001</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newopts</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.Kroupa2001"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Kroupa2001" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Probability distribution function for Kroupa 2001 IMF, +where the default values to the three_part_powerlaw are: +default = {</p> +<blockquote> +<div><p>“m0â€: 0.1, +“m1â€: 0.5, +“m2â€: 1, +“mmaxâ€: 100, +“p1â€: -1.3, +“p2â€: -2.3, +“p3â€: -2.3</p> +</div></blockquote> +<p>}</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p></li> +<li><p><strong>newopts</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>]) – optional dict to override the default values.</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions"> +<span class="sig-name descname"><span class="pre">Moe_di_Stefano_2017_multiplicity_fractions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that creates a list of probability fractions and +normalises and merges them according to the users choice.</p> +<p>TODO: make an extrapolation functionality in this. log10(1.6e1) +is quite low.</p> +<p>The default result that is returned when sampling the mass outside +of the mass range is now the last known value</p> +<p>Returns a list of multiplicity fractions for a given input of mass</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_pdf"> +<span class="sig-name descname"><span class="pre">Moe_di_Stefano_2017_pdf</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.Moe_di_Stefano_2017_pdf"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.Moe_di_Stefano_2017_pdf" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Moe & diStefano function to calculate the probability density.</p> +<p>takes a dictionary as input (in options) with options:</p> +<p>M1, M2, M3, M4 => masses (Msun) [M1 required, rest optional] +P, P2, P3 => periods (days) [number: none=binary, 2=triple, 3=quadruple] +ecc, ecc2, ecc3 => eccentricities [numbering as for P above]</p> +<p>mmin => minimum allowed stellar mass (default 0.07) +mmax => maximum allowed stellar mass (default 80.0)</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.build_q_table"> +<span class="sig-name descname"><span class="pre">build_q_table</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.build_q_table"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.build_q_table" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Build an interpolation table for q, given a mass and +orbital period.</p> +<p>m and p are labels which determine which system(s) +to look up from Moe’s data:</p> +<p>m can be M1, M2, M3, M4, or if set M1+M2 etc. +p can be P, P2, P3</p> +<p>The actual values are in $opts:</p> +<p>mass is in $opts->{m} +period is $opts->{p}</p> +<p>Since the information from the table for Moe and di Stefano 2017 is independent of any choice we make, +we need to take into account that for example our choice of minimum mass leads to +a minimum q_min that is not the same as in the table +We should ignore those parts of the table and renormalise. +If we are below the lowest value of qmin in the table we need to extrapolate the data</p> +<p>Anyway, the goal of this function is to provide some extrapolated values for q when we should sample outside of the boundaries +TODO: fix description to be correct for python</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_P_integral"> +<span class="sig-name descname"><span class="pre">calc_P_integral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">min_logP</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_logP</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">integrals_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interpolator_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mass_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.calc_P_integral"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_P_integral" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to calculate the P integral</p> +<p>We need to renormalise this because min_per > 0, and not all periods should be included</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_e_integral"> +<span class="sig-name descname"><span class="pre">calc_e_integral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">integrals_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interpolator_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mass_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">period_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.calc_e_integral"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_e_integral" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to calculate the e integral</p> +<p>We need to renormalise this because min_per > 0, and not all periods should be included</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_total_probdens"> +<span class="sig-name descname"><span class="pre">calc_total_probdens</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prob_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.calc_total_probdens"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calc_total_probdens" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to calculate the total probability density</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calculate_constants_three_part_powerlaw"> +<span class="sig-name descname"><span class="pre">calculate_constants_three_part_powerlaw</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m_max</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p3</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.calculate_constants_three_part_powerlaw"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.calculate_constants_three_part_powerlaw" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to calculate the constants for a three-part power law</p> +<p>TODO: use the power law_constant function to calculate all these values</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>m0</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound mass</p></li> +<li><p><strong>m1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – second boundary, between the first slope and the second slope</p></li> +<li><p><strong>m2</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – third boundary, between the second slope and the third slope</p></li> +<li><p><strong>m_max</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound mass</p></li> +<li><p><strong>p1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – first slope</p></li> +<li><p><strong>p2</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – second slope</p></li> +<li><p><strong>p3</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – third slope</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>array of normalisation constants</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.const_distribution"> +<span class="sig-name descname"><span class="pre">const_distribution</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">val</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.const_distribution"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.const_distribution" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>a constant distribution function between min=min_bound and max=max_bound.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the range</p></li> +<li><p><strong>max_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the range</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>returns 0</p> +</dd> +<dt class="field-odd">Return type</dt> +<dd class="field-odd"><p>returns the value of 1/(max_bound-min_bound) If val is provided, it will check whether min_bound < val <= max_bound. if not</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.cosmic_SFH_madau_dickinson2014"> +<span class="sig-name descname"><span class="pre">cosmic_SFH_madau_dickinson2014</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.cosmic_SFH_madau_dickinson2014"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.cosmic_SFH_madau_dickinson2014" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Cosmic star formation history distribution from Madau & Dickonson 2014 (<a class="reference external" href="https://arxiv.org/pdf/1403.0007.pdf">https://arxiv.org/pdf/1403.0007.pdf</a>)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>z</strong> – redshift</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Cosmic star formation rate in Solar mass year^-1 mega parsec^-3</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.duquennoy1991"> +<span class="sig-name descname"><span class="pre">duquennoy1991</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">logper</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.duquennoy1991"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.duquennoy1991" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Period distribution from Duquennoy + Mayor 1991. Evaluated the function self.gaussian(logper, 4.8, 2.3, -2, 12)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>logper</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – logarithm of period to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ at self.gaussian(logper, 4.8, 2.3, -2, 12)</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.fill_data"> +<span class="sig-name descname"><span class="pre">fill_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sample_values</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.fill_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.fill_data" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the normalised array of values for given logmass and logperiod +used for the e and q values</p> +<p>TODO: make sure we do the correct thing with the dstep</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flat"> +<span class="sig-name descname"><span class="pre">flat</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.flat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flat" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Dummy distribution function that returns 1</p> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>1</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p>a flat uniform distribution</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flatsections"> +<span class="sig-name descname"><span class="pre">flatsections</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.flatsections"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.flatsections" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to generate flat distributions, possibly in multiple sections</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>x</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>) – mass ratio value</p></li> +<li><p><strong>opts</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – list containing the flat sections. Which are themselves dictionaries, with keys “maxâ€: upper bound, “minâ€: lower bound and “heightâ€: value</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>probability of that mass ratio.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian"> +<span class="sig-name descname"><span class="pre">gaussian</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sigma</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gmin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gmax</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.gaussian"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Gaussian distribution function. used for e.g. Duquennoy + Mayor 1991</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>x</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – location at which to evaluate the distribution</p></li> +<li><p><strong>mean</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mean of the Gaussian</p></li> +<li><p><strong>sigma</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – standard deviation of the Gaussian</p></li> +<li><p><strong>gmin</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the range to calculate the probabilities in</p></li> +<li><p><strong>gmax</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the range to calculate the probabilities in</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of the Gaussian distribution between the boundaries, evaluated at x</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_func"> +<span class="sig-name descname"><span class="pre">gaussian_func</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sigma</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.gaussian_func"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_func" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to evaluate a Gaussian at a given point, but this time without any boundaries.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>x</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – location at which to evaluate the distribution</p></li> +<li><p><strong>mean</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mean of the Gaussian</p></li> +<li><p><strong>sigma</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – standard deviation of the Gaussian</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>value of the Gaussian at x</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_normalizing_const"> +<span class="sig-name descname"><span class="pre">gaussian_normalizing_const</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sigma</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gmin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gmax</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.gaussian_normalizing_const"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.gaussian_normalizing_const" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to calculate the normalisation constant for the Gaussian</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>mean</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mean of the Gaussian</p></li> +<li><p><strong>sigma</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – standard deviation of the Gaussian</p></li> +<li><p><strong>gmin</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the range to calculate the probabilities in</p></li> +<li><p><strong>gmax</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the range to calculate the probabilities in</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>normalisation constant for the Gaussian distribution(mean, sigma) between gmin and gmax</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_integration_constant_q"> +<span class="sig-name descname"><span class="pre">get_integration_constant_q</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">q_interpolator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tmp_table</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qdata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.get_integration_constant_q"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_integration_constant_q" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to integrate the q interpolator and return the integration constant</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_max_multiplicity"> +<span class="sig-name descname"><span class="pre">get_max_multiplicity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">multiplicity_array</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.get_max_multiplicity"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.get_max_multiplicity" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to get the maximum multiplicity</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_chabrier2003"> +<span class="sig-name descname"><span class="pre">imf_chabrier2003</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.imf_chabrier2003"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_chabrier2003" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Probability distribution function for IMF of Chabrier 2003 PASP 115:763-795</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1986"> +<span class="sig-name descname"><span class="pre">imf_scalo1986</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.imf_scalo1986"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1986" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Probability distribution function for Scalo 1986 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 1.0, 2.0, 80.0, -2.35, -2.35, -2.70)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1998"> +<span class="sig-name descname"><span class="pre">imf_scalo1998</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.imf_scalo1998"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_scalo1998" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>From Scalo 1998</p> +<p>Probability distribution function for Scalo 1998 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 1.0, 10.0, 80.0, -1.2, -2.7, -2.3)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_tinsley1980"> +<span class="sig-name descname"><span class="pre">imf_tinsley1980</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.imf_tinsley1980"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.imf_tinsley1980" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Probability distribution function for Tinsley 1980 IMF (defined up until 80Msol): self.three_part_powerlaw(m, 0.1, 2.0, 10.0, 80.0, -2.0, -2.3, -3.3)</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.interpolate_in_mass_izzard2012"> +<span class="sig-name descname"><span class="pre">interpolate_in_mass_izzard2012</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">high</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">low</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.interpolate_in_mass_izzard2012"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.interpolate_in_mass_izzard2012" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to interpolate in mass</p> +<p>TODO: fix this function. +TODO: describe the args +high: at M=16.3 +low: at 1.15</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>M</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass</p></li> +<li><p><strong>high</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – </p></li> +<li><p><strong>low</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – </p></li> +</ul> +</dd> +</dl> +<p>Returns:</p> +<dl class="field-list simple"> +<dt class="field-odd">Return type</dt> +<dd class="field-odd"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.ktg93"> +<span class="sig-name descname"><span class="pre">ktg93</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newopts</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.ktg93"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.ktg93" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Probability distribution function for KTG93 IMF, where the default values to the three_part_powerlaw are: default = {“m0â€: 0.1, “m1â€: 0.5, “m2â€: 1, “mmaxâ€: 80, “p1â€: -1.3, “p2â€: -2.2,â€p3â€: -2.7}</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p></li> +<li><p><strong>newopts</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>]) – optional dict to override the default values.</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of distribution function evaluated at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.linear_extrapolation_q"> +<span class="sig-name descname"><span class="pre">linear_extrapolation_q</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qlimit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qdata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end_index</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.linear_extrapolation_q"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.linear_extrapolation_q" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to do the linear extrapolation for q.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.merge_multiplicities"> +<span class="sig-name descname"><span class="pre">merge_multiplicities</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">result_array</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_multiplicity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbosity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.merge_multiplicities"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.merge_multiplicities" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to fold the multiplicities higher than the max_multiplicity onto the max_multiplicity</p> +<dl class="simple"> +<dt>if max_multiplicity == 1:</dt><dd><p>All the multiplicities are folded onto multiplicity == 1. This will always total to 1</p> +</dd> +<dt>if max_multiplicity == 2:</dt><dd><p>The multiplicity fractions of the triple and quadruples are folded onto that of the binary multiplicity fraction</p> +</dd> +<dt>if max_multiplicity == 3:</dt><dd><p>The multiplicity fractions of the quadruples are folded onto that of the triples</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.number"> +<span class="sig-name descname"><span class="pre">number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.number"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.number" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Dummy distribution function that returns the input</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>value</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – the value that will be returned by this function.</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>the value that was provided</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.poisson"> +<span class="sig-name descname"><span class="pre">poisson</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lambda_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nmax</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.poisson"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.poisson" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that calculates the Poisson value and normalises +TODO: improve the description</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw"> +<span class="sig-name descname"><span class="pre">powerlaw</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.powerlaw"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Single power law with index k at x from min to max</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the power law</p></li> +<li><p><strong>max_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the power law</p></li> +<li><p><strong>k</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – slope of the power law</p></li> +<li><p><strong>x</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – position at which we want to evaluate</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p><cite>probability</cite> at the given position(x)</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant"> +<span class="sig-name descname"><span class="pre">powerlaw_constant</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.powerlaw_constant"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the constant to normalise a power law</p> +<p>TODO: what if k is -1?</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the range</p></li> +<li><p><strong>max_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the range</p></li> +<li><p><strong>k</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – power law slope</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>constant to normalise the given power law between the min_val and max_val range</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant_nocache"> +<span class="sig-name descname"><span class="pre">powerlaw_constant_nocache</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.powerlaw_constant_nocache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_constant_nocache" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the constant to normalise a power law</p> +<p>TODO: what if k is -1?</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of the range</p></li> +<li><p><strong>max_val</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of the range</p></li> +<li><p><strong>k</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – power law slope</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>constant to normalise the given power law between the min_val and max_val range</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_extrapolation_q"> +<span class="sig-name descname"><span class="pre">powerlaw_extrapolation_q</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qdata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.powerlaw_extrapolation_q"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.powerlaw_extrapolation_q" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to do the power-law extrapolation at the lower end of the q range</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.raghavan2010_binary_fraction"> +<span class="sig-name descname"><span class="pre">raghavan2010_binary_fraction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.raghavan2010_binary_fraction"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.raghavan2010_binary_fraction" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Fit to the Raghavan 2010 binary fraction as a function of +spectral type (Fig 12). Valid for local stars (Z=Zsolar).</p> +<p>The spectral type is converted mass by use of the ZAMS +effective temperatures from binary_c/BSE (at Z=0.02) +and the new “long_spectral_type†function of binary_c +(based on Jaschek+Jaschek’s Teff-spectral type table).</p> +<p>Rob then fitted the result</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass to evaluate the distribution at</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>binary fraction at m</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.sana12"> +<span class="sig-name descname"><span class="pre">sana12</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">P</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">amin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">amax</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.sana12"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.sana12" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>distribution of initial orbital periods as found by Sana et al. (2012) +which is a flat distribution in ln(a) and ln(P) respectively for stars +* less massive than 15Msun (no O-stars) +* mass ratio q=M2/M1<0.1 +* log(P)<0.15=x0 and log(P)>3.5=x1 +and is be given by dp/dlogP ~ (logP)^p for all other binary configurations (default p=-0.55)</p> +<p>arguments are M1, M2, a, Period P, amin, amax, x0=log P0, x1=log P1, p</p> +<p>example args: 10, 5, sep(M1, M2, P), sep, ?, -2, 12, -0.55</p> +<p># TODO: Fix this function! Half of the input here can be taken out and calculated within the function itself.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>M1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – Mass of primary</p></li> +<li><p><strong>M2</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – Mass of secondary</p></li> +<li><p><strong>a</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – separation of binary</p></li> +<li><p><strong>P</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – period of binary</p></li> +<li><p><strong>amin</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – minimum separation of the distribution (lower bound of the range)</p></li> +<li><p><strong>amax</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – maximum separation of the distribution (upper bound of the range)</p></li> +<li><p><strong>x0</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – log of minimum period of the distribution (lower bound of the range)</p></li> +<li><p><strong>x1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – log of maximum period of the distribution (upper bound of the range)</p></li> +<li><p><strong>p</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – slope of the distribution</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ of orbital period P given the other parameters</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.distribution_functions.distribution_functions.three_part_powerlaw"> +<span class="sig-name descname"><span class="pre">three_part_powerlaw</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m_max</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p3</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/distribution_functions.html#distribution_functions.three_part_powerlaw"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.distribution_functions.distribution_functions.three_part_powerlaw" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Generalised three-part power law, usually used for mass distributions</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>m</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mass at which we want to evaluate the distribution.</p></li> +<li><p><strong>m0</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound mass</p></li> +<li><p><strong>m1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – second boundary, between the first slope and the second slope</p></li> +<li><p><strong>m2</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – third boundary, between the second slope and the third slope</p></li> +<li><p><strong>m_max</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound mass</p></li> +<li><p><strong>p1</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – first slope</p></li> +<li><p><strong>p2</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – second slope</p></li> +<li><p><strong>p3</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – third slope</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>‘probability’ at given mass m</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="dataIO.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="gridcode.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/grid_options_defaults.html b/docs/build/html/population_extensions/grid_options_defaults.html new file mode 100644 index 0000000000000000000000000000000000000000..3e0b2c87eba637884311cd0995513d762043d4dc --- /dev/null +++ b/docs/build/html/population_extensions/grid_options_defaults.html @@ -0,0 +1,261 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="HPC.html" /> + <link rel="prev" title="functions module" href="gridcode.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/grid_options_defaults.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.grid_options_defaults"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.grid_options_defaults" title="Permalink to this headline">ïƒ</a></h1> +<dl class="simple"> +<dt>Module that contains the default options for the population grid code along with the description for these options, in the form of dictionaries:</dt><dd><ul class="simple"> +<li><p>grid_options_defaults_dict: dictionary containing the default values for all the options</p></li> +<li><p>grid_options_descriptions: dictionary containing the description for these options.</p></li> +</ul> +</dd> +<dt>There are several other functions in this module, mostly to generate help texts or documents:</dt><dd><ul class="simple"> +<li><p>grid_options_help: interactive function for the user to get descriptions for options</p></li> +<li><p>grid_options_description_checker: function that checks that checks which options have a description.</p></li> +<li><p>write_grid_options_to_rst_file: function to generate the .rst document for the docs</p></li> +</ul> +</dd> +</dl> +<p>With this its also possible to automatically generate a document containing all the setting names + descriptions.</p> +<p>All the options starting with _ should not be changed by the user except when you really know what you’re doing (which is probably hacking the code :P)</p> +<p>TODO: reconsider having this all as class methods. It seems unnecessary to have all these functions as class methods.</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.grid_options_defaults.</span></span><span class="sig-name descname"><span class="pre">grid_options_defaults</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Class extension to Population grid containing all the functionality for the options and defaults</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.default_cache_dir"> +<span class="sig-name descname"><span class="pre">default_cache_dir</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.default_cache_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.default_cache_dir" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return a default cache directory path, or None if we cannot find one.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_defaults_dict"> +<span class="sig-name descname"><span class="pre">get_grid_options_defaults_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.get_grid_options_defaults_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_defaults_dict" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the default values for the grid options</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_descriptions"> +<span class="sig-name descname"><span class="pre">get_grid_options_descriptions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.get_grid_options_descriptions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.get_grid_options_descriptions" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the descriptions for all the grid options</p> +<p>TODO: consider putting input types for all of them</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_description_checker"> +<span class="sig-name descname"><span class="pre">grid_options_description_checker</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">print_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.grid_options_description_checker"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_description_checker" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that checks which descriptions are missing</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>print_info</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – whether to print out information about which options contain proper descriptions and which do not</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>the number of undescribed keys</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_help"> +<span class="sig-name descname"><span class="pre">grid_options_help</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">option</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.grid_options_help"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.grid_options_help" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that prints out the description of a grid option. Useful function for the user.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>option</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – which option you want to have the description of</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>dict containing the option, the description if its there, otherwise empty string. And if the key doesnt exist, the dict is empty</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.print_option_descriptions"> +<span class="sig-name descname"><span class="pre">print_option_descriptions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filehandle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">descriptions</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">title</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extra_text</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.print_option_descriptions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.print_option_descriptions" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to print the description of an option</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.write_grid_options_to_rst_file"> +<span class="sig-name descname"><span class="pre">write_grid_options_to_rst_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/grid_options_defaults.html#grid_options_defaults.write_grid_options_to_rst_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults.write_grid_options_to_rst_file" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that writes the descriptions of the grid options to an rst file</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>output_file</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – target file where the grid options descriptions are written to</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="gridcode.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="HPC.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/gridcode.html b/docs/build/html/population_extensions/gridcode.html new file mode 100644 index 0000000000000000000000000000000000000000..661a674338f75f3b4ebb9f245cfe3e5497cf2acf --- /dev/null +++ b/docs/build/html/population_extensions/gridcode.html @@ -0,0 +1,301 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="grid_options_defaults.html" /> + <link rel="prev" title="functions module" href="distribution_functions.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/gridcode.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.gridcode"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.gridcode" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the gridcode generation functions for the binarycpython package.</p> +<p>This class object is an extension to the population grid object</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.gridcode.gridcode"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.gridcode.</span></span><span class="sig-name descname"><span class="pre">gridcode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/gridcode.html#gridcode"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.gridcode.gridcode" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension to the population grid object that contains functionality to handle the metadata that will be put in the ensemble</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.gridcode.gridcode.add_grid_variable"> +<span class="sig-name descname"><span class="pre">add_grid_variable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parameter_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">longname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">valuerange</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">samplerfunc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">probdist</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dphasevol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gridtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'centred'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">branchpoint</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">branchcode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">postcode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">topcode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bottomcode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">condition</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dry_parallel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/gridcode.html#gridcode.add_grid_variable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.gridcode.gridcode.add_grid_variable" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to add grid variables to the grid_options.</p> +<p>The execution of the grid generation will be through a nested for loop. +Each of the grid variables will get create a deeper for loop.</p> +<p>The real function that generates the numbers will get written to a new file in the TMP_DIR, +and then loaded imported and evaluated. +beware that if you insert some destructive piece of code, it will be executed anyway. +Use at own risk.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – <p>name of parameter used in the grid Python code. +This is evaluated as a parameter and you can use it throughout +the rest of the function</p> +<p class="rubric">Examples</p> +<p>name = ‘lnM_1’</p> +</p></li> +<li><p><strong>parameter_name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – <p>name of the parameter in binary_c</p> +<p>This name must correspond to a Python variable of the same name, +which is automatic if parameter_name == name.</p> +<dl class="simple"> +<dt>Note: if parameter_name != name, you must set a</dt><dd><p>variable in “precode†or “postcode†to define a Python variable +called parameter_name</p> +</dd> +</dl> +</p></li> +<li><p><strong>longname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – <p>Long name of parameter</p> +<p class="rubric">Examples</p> +<p>longname = ‘Primary mass’</p> +</p></li> +<li><p><strong>range</strong> – <p>Range of values to take. Does not get used really, the samplerfunc is used to +get the values from</p> +<p class="rubric">Examples</p> +<p>range = [math.log(m_min), math.log(m_max)]</p> +</p></li> +<li><p><strong>samplerfunc</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – <p>Function returning a list or numpy array of samples spaced appropriately. +You can either use a real function, or a string representation of a function call.</p> +<p class="rubric">Examples</p> +<p>samplerfunc = “self.const_linear(math.log(m_min), math.log(m_max), {})â€.format(resolution[‘M_1’])</p> +</p></li> +<li><p><strong>precode</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – <p>Extra room for some code. This code will be evaluated within the loop of the +sampling function (i.e. a value for lnM_1 is chosen already)</p> +<p class="rubric">Examples</p> +<p>precode = ‘M_1=math.exp(lnM_1);’</p> +</p></li> +<li><p><strong>postcode</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – Code executed after the probability is calculated.</p></li> +<li><p><strong>probdist</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – <p>Function determining the probability that gets assigned to the sampled parameter</p> +<p class="rubric">Examples</p> +<p>probdist = ‘Kroupa2001(M_1)*M_1’</p> +</p></li> +<li><p><strong>dphasevol</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>]) – <p>part of the parameter space that the total probability is calculated with. Put to -1 +if you want to ignore any dphasevol calculations and set the value to 1 +.. rubric:: Examples</p> +<p>dphasevol = ‘dlnM_1’</p> +</p></li> +<li><p><strong>condition</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – <p>condition that has to be met in order for the grid generation to continue +.. rubric:: Examples</p> +<p>condition = ‘self.grid_options[‘binary’]==1’</p> +</p></li> +<li><p><strong>gridtype</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – Method on how the value range is sampled. Can be either ‘edge’ (steps starting at +the lower edge of the value range) or ‘centred’ +(steps starting at lower edge + 0.5 * stepsize).</p></li> +<li><p><strong>dry_parallel</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>]) – If True, try to parallelize this variable in dry runs.</p></li> +<li><p><strong>topcode</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – Code added at the very top of the block.</p></li> +<li><p><strong>bottomcode</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – Code added at the very bottom of the block.</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.gridcode.gridcode.delete_grid_variable"> +<span class="sig-name descname"><span class="pre">delete_grid_variable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/gridcode.html#gridcode.delete_grid_variable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.gridcode.gridcode.delete_grid_variable" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to delete a grid variable with the given name.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – name of the grid variable to be deleted.</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.gridcode.gridcode.rename_grid_variable"> +<span class="sig-name descname"><span class="pre">rename_grid_variable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newname</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/gridcode.html#gridcode.rename_grid_variable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.gridcode.gridcode.rename_grid_variable" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to rename a grid variable.</p> +<p>note: this does NOT alter the order +of the self.grid_options[“_grid_variablesâ€] dictionary.</p> +<p>The order in which the grid variables are loaded into the grid is based on their +<cite>grid_variable_number</cite> property</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>oldname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – old name of the grid variable</p></li> +<li><p><strong>newname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – new name of the grid variable</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.gridcode.gridcode.update_grid_variable"> +<span class="sig-name descname"><span class="pre">update_grid_variable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/gridcode.html#gridcode.update_grid_variable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.gridcode.gridcode.update_grid_variable" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to update the values of a grid variable.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – name of the grid variable to be changed.</p></li> +<li><p><strong>**kwargs</strong> – key-value pairs to override the existing grid variable data. See add_grid_variable for these names.</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="distribution_functions.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="grid_options_defaults.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/metadata.html b/docs/build/html/population_extensions/metadata.html new file mode 100644 index 0000000000000000000000000000000000000000..60328370db861f935eb087b67dae2af91d6b2abd --- /dev/null +++ b/docs/build/html/population_extensions/metadata.html @@ -0,0 +1,186 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="slurm.html" /> + <link rel="prev" title="functions module" href="HPC.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/metadata.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.metadata"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.metadata" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the metadata functions for the binarycpython package.</p> +<p>This class object is an extension to the population grid object</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.metadata.metadata"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.metadata.</span></span><span class="sig-name descname"><span class="pre">metadata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/metadata.html#metadata"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.metadata.metadata" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension to the population grid object that contains functionality to handle the metadata that will be put in the ensemble</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.metadata.metadata.add_ensemble_metadata"> +<span class="sig-name descname"><span class="pre">add_ensemble_metadata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">combined_output_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/metadata.html#metadata.add_ensemble_metadata"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.metadata.metadata.add_ensemble_metadata" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to add metadata to the grid_ensemble_results and grid_options</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.metadata.metadata.add_system_metadata"> +<span class="sig-name descname"><span class="pre">add_system_metadata</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/metadata.html#metadata.add_system_metadata"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.metadata.metadata.add_system_metadata" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Add system’s metadata to the grid_ensemble_results, and add some system information to metadata.</p> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="HPC.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="slurm.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/slurm.html b/docs/build/html/population_extensions/slurm.html new file mode 100644 index 0000000000000000000000000000000000000000..5f66d24a802cf64d2309c2441dc47ca5ef0152eb --- /dev/null +++ b/docs/build/html/population_extensions/slurm.html @@ -0,0 +1,252 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="spacing_functions.html" /> + <link rel="prev" title="functions module" href="metadata.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/slurm.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.slurm"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.slurm" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the Slurm functions for the binarycpython package.</p> +<p>This class object is an extension to the population grid object</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.slurm.</span></span><span class="sig-name descname"><span class="pre">slurm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension for the Population class containing the code for Slurm grid simulations</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.get_slurm_status"> +<span class="sig-name descname"><span class="pre">get_slurm_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jobid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobarrayindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.get_slurm_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.get_slurm_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Get and return the slurm status string corresponing to the self object, or jobid.jobarrayindex if they are passed in. If no status is found, returns an empty string.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.make_slurm_dirs"> +<span class="sig-name descname"><span class="pre">make_slurm_dirs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.make_slurm_dirs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.make_slurm_dirs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to create the necessary slurm directories</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.set_slurm_status"> +<span class="sig-name descname"><span class="pre">set_slurm_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.set_slurm_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.set_slurm_status" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Set the slurm status corresponing to the self object, which should have slurm_jobid and slurm_jobarrayindex set.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>string</strong> – the status string to be set</p></li> +<li><p><strong>slurm_dir</strong> – the directory in which the status directory is held. If not set, this defaults to the HPC directory (e.g. slurm_dir or condor_dir).</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurmID"> +<span class="sig-name descname"><span class="pre">slurmID</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jobid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobarrayindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurmID"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurmID" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return a Slurm job ID. The jobid and jobarrayindex passed in are used if given, otherwise we default to the jobid and jobarrayindex in grid_options.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_check_requirements"> +<span class="sig-name descname"><span class="pre">slurm_check_requirements</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_check_requirements"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_check_requirements" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to check whether the slurm parameters in grid_options have been set appropriately.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_dirs"> +<span class="sig-name descname"><span class="pre">slurm_dirs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_dirs"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_dirs" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Directories associated specifically with this slurm job.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_grid"> +<span class="sig-name descname"><span class="pre">slurm_grid</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_grid"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_grid" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>function to be called when running grids when grid_options[‘slurm’]>=1</p> +<p>if grid_options[‘slurm’]==1, we set up the slurm script and launch the jobs, then return True to exit. +if grid_options[‘slurm’]==2, we run the stars, which means we return False to continue. +if grid_options[‘slurm’]==3, we are being called from the jobs to run the grids, return False to continue.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_outfile"> +<span class="sig-name descname"><span class="pre">slurm_outfile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_outfile"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_outfile" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>return a standard filename for the slurm chunk files</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_queue_stats"> +<span class="sig-name descname"><span class="pre">slurm_queue_stats</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_queue_stats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_queue_stats" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to XXX</p> +<p>TODO: is this function finished?</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurm_status_file"> +<span class="sig-name descname"><span class="pre">slurm_status_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jobid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobarrayindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurm_status_file"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurm_status_file" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Return the slurm status file corresponding to the jobid and jobarrayindex, which default to grid_options slurm_jobid and slurm_jobarrayindex, respectively.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.slurm.slurm.slurmpath"> +<span class="sig-name descname"><span class="pre">slurmpath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">slurm_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/slurm.html#slurm.slurmpath"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.slurm.slurm.slurmpath" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the full slurm directory path.</p> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="metadata.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="spacing_functions.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/spacing_functions.html b/docs/build/html/population_extensions/spacing_functions.html new file mode 100644 index 0000000000000000000000000000000000000000..0f5c9bbfbeacdb0543d43809c45c3f1665835542 --- /dev/null +++ b/docs/build/html/population_extensions/spacing_functions.html @@ -0,0 +1,339 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="functions module" href="version_info.html" /> + <link rel="prev" title="functions module" href="slurm.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="version_info.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/spacing_functions.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.spacing_functions"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.spacing_functions" title="Permalink to this headline">ïƒ</a></h1> +<p>Module containing the spacing functions for the binarycpython package. Very under-populated at the moment, but more are likely to come soon</p> +<p>This class object is an extension to the population grid object</p> +<dl class="simple"> +<dt>Tasks:</dt><dd><p>TODO: add more spacing functions to this module.</p> +</dd> +</dl> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.spacing_functions.</span></span><span class="sig-name descname"><span class="pre">spacing_functions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Extension for the Population class containing the code for spacing functions</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_dt"> +<span class="sig-name descname"><span class="pre">const_dt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cachedir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">usecache</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.const_dt"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_dt" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>const_dt returns a list of masses spaced at a constant age difference</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>dt</strong> – the time difference between the masses (1000.0 Myr, used when logspacing==False)</p></li> +<li><p><strong>dlogt</strong> – the delta log10(time) difference between masses (0.1 dex, used when logspacing==True)</p></li> +<li><p><strong>mmin</strong> – the minimum mass to be considered in the stellar lifetime interpolation table (0.07 Msun)</p></li> +<li><p><strong>mmax</strong> – the maximum mass to be considered in the stellar lifetime interpolation table (100.0 Msun)</p></li> +<li><p><strong>nres</strong> – the resolution of the stellar lifetime interpolation table (100)</p></li> +<li><p><strong>logspacing</strong> – whether to use log-spaced time, in which case dt is actually d(log10(t))</p></li> +<li><p><strong>tmin</strong> – the minimum time to consider (Myr, default 3.0 Myr)</p></li> +<li><p><strong>tmax</strong> – the maximum time to consider (Myr, default None which means we use the grid option ‘max_evolution_time’)</p></li> +<li><p><strong>max_evolution_time</strong> – overrides bse_options[‘max_evolution_time’] if set</p></li> +<li><p><strong>mindm</strong> – a tuple of tuples containing a mass range and minimum mass spacing in that range. The default is ((0.07,1.0,0.1),(1.0,300.0,1.0)) allocated a minimum dm of 0.1Msun in the mass range 0.07 to 1.0 Msun and 1.0Msun in the range 1.0 to 300.0 Msun. Anything you set overrides this. Note, if you use only one tuple, you must set it with a trailing comma, thus, e.g. ((0.07,1.0,0.1),). (default None)</p></li> +<li><p><strong>maxdm</strong> – a list of tuples similar to mindm but specifying a maximum mass spacing. In the case of maxdm, if the third option in each tuple is negative it is treated as a log step (its absolute value is used as the step). (default None)</p></li> +<li><p><strong>fsample</strong> – a global sampling (Shannon-like) factor (<1) to improve resolution (default 1.0, set to smaller to improve resolution)</p></li> +<li><p><strong>factor</strong> – all masses generated are multiplied by this after generation</p></li> +<li><p><strong>showtable</strong> – if True, the mass list and times are shown to stdout after generation</p></li> +<li><p><strong>showlist</strong> – if True, show the mass list once generated</p></li> +<li><p><strong>logmasses</strong> – if True, the masses are logged with math.log()</p></li> +<li><p><strong>log10masses</strong> – if True, the masses are logged with math.log10()</p></li> +<li><p><strong>usecache</strong> – if True (the default) uses cached results if they are saved (in cachedir) and cachedir is not None</p></li> +<li><p><strong>cachedir</strong> – where the cache is stored. if None, defaults to grid_options[‘cache_dir’]+’/const_dt_cache’</p></li> +<li><p><strong>vb</strong> – verbose logging flag (default False)</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Array of masses.</p> +</dd> +</dl> +<p>Example: +# these are lines set as options to Population.add_grid_value(…)</p> +<p># linear time bins of 1Gyr +samplerfunc=â€self.const_dt(self,dt=1000,nres=100,mmin=0.07,mmax=2.0,showtable=True)â€</p> +<p># logarithmic spacing in time, generally suitable for Galactic +# chemical evolution yield grids. +samplerfunc=â€self.const_dt(self,dlogt=0.1,nres=100,mmin=0.07,mmax=80.0,maxdm=((0.07,1.0,0.1),(1.0,10.0,1.0),(10.0,80.0,2.0)),showtable=True,logspacing=True,fsample=1.0/4.0)â€</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_int"> +<span class="sig-name descname"><span class="pre">const_int</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">steps</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.const_int"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_int" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Samples an integer range linearly. Returns a list of ints.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of range, must be an integer (is converted to int)</p></li> +<li><p><strong>max_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of range, must be an integer (is converted to int)</p></li> +<li><p><strong>steps</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – number of segments between min_bound and max_bound</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p><p>range(min_bound,max_bound,step)</p> +<p>where step is int((int(max_bound)-int(min_bound))/steps)</p> +</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_linear"> +<span class="sig-name descname"><span class="pre">const_linear</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">steps</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.const_linear"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_linear" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Samples a range linearly. Uses numpy linspace, and returns an array of floats. Do NOT use this for integers.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of range</p></li> +<li><p><strong>max_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of range</p></li> +<li><p><strong>steps</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – number of segments between min_bound and max_bound</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>np.linspace(min_bound, max_bound, steps)</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_ranges"> +<span class="sig-name descname"><span class="pre">const_ranges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ranges</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.const_ranges"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.const_ranges" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Samples a series of ranges linearly.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>ranges</strong> – a tuple of tuples passed to the self.const_linear() spacing function.</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>numpy array of masses</p> +</dd> +</dl> +<p class="rubric">Example</p> +<p>The following allocates 10 stars between 0.1 and 0.65, 20 stars between 0.65 +and 0.85, and 10 stars between 0.85 and 10.0 Msun.</p> +<dl class="simple"> +<dt>samplerfunc=â€const_ranges((({},{},{}),({},{},{}),({},{},{})))â€.format(</dt><dd><p>0.1,0.65,10, +0.65,0.85,20, +0.85,10.0,10</p> +</dd> +</dl> +<p>),</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.gaussian_zoom"> +<span class="sig-name descname"><span class="pre">gaussian_zoom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_bound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zoom_mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zoom_dispersion</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zoom_magnitude</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">steps</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.gaussian_zoom"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.gaussian_zoom" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Samples such that a region is zoomed in according to a 1-Gaussian function</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>min_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – lower bound of range</p></li> +<li><p><strong>max_bound</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – upper bound of range</p></li> +<li><p><strong>zoom_mean</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mean of the Gaussian zoom location</p></li> +<li><p><strong>zoom_dispersion</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – dispersion of the Gaussian</p></li> +<li><p><strong>zoom_magnitude</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – depth of the Gaussian (should be 0<= zoom_magntiude <1)</p></li> +<li><p><strong>steps</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – number of segments between min_bound and max_bound assuming a linear step +this is what you’d normally call “resolutionâ€</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>Numpy array of sample values</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.spacing_functions.spacing_functions.peak_normalized_gaussian_func"> +<span class="sig-name descname"><span class="pre">peak_normalized_gaussian_func</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sigma</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/spacing_functions.html#spacing_functions.peak_normalized_gaussian_func"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.spacing_functions.spacing_functions.peak_normalized_gaussian_func" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to evaluate a Gaussian at a given point, note +that the normalization is such that the peak is always 1.0, +not that the integral is 1.0</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>x</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – location at which to evaluate the distribution</p></li> +<li><p><strong>mean</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – mean of the Gaussian</p></li> +<li><p><strong>sigma</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]) – standard deviation of the Gaussian</p></li> +</ul> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>value of the Gaussian at x</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="slurm.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="version_info.html" class="btn btn-neutral float-right" title="functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/population_extensions/version_info.html b/docs/build/html/population_extensions/version_info.html new file mode 100644 index 0000000000000000000000000000000000000000..0c89a3de80f98422ffeac0451113cab9bf2ac07a --- /dev/null +++ b/docs/build/html/population_extensions/version_info.html @@ -0,0 +1,218 @@ +<!DOCTYPE html> +<html class="writer-html5" lang="en" > +<head> + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>functions module — binary_c-python documentation</title> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="../_static/js/html5shiv.min.js"></script> + <![endif]--> + + <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> + <script src="../_static/jquery.js"></script> + <script src="../_static/underscore.js"></script> + <script src="../_static/doctools.js"></script> + <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> + <script src="../_static/js/theme.js"></script> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="run_system_wrapper module" href="../run_system_wrapper.html" /> + <link rel="prev" title="functions module" href="spacing_functions.html" /> +</head> + +<body class="wy-body-for-nav"> + <div class="wy-grid-for-nav"> + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + <a href="../index.html" class="icon icon-home"> binary_c-python + </a> +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> + <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> +<ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../readme_link.html">Python module for binary_c</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="../modules.html">Binarycpython code</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="../custom_logging_functions.html">custom_logging_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../ensemble.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../grid.html">grid_class module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">functions module</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../run_system_wrapper.html">run_system_wrapper module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../stellar_types.html">stellar_types module</a></li> +<li class="toctree-l2"><a class="reference internal" href="../useful_funcs.html">useful_funcs module</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../example_notebooks.html">Example notebooks</a></li> +<li class="toctree-l1"><a class="reference internal" href="../binary_c_parameters.html">Binary_c parameters</a></li> +<li class="toctree-l1"><a class="reference internal" href="../grid_options_descriptions.html">Population grid code options</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> +<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> +</ul> + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">binary_c-python</a> + </nav> + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="Page navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html" class="icon icon-home"></a> »</li> + <li><a href="../modules.html">Binarycpython code</a> »</li> + <li>functions module</li> + <li class="wy-breadcrumbs-aside"> + <a href="../_sources/population_extensions/version_info.rst.txt" rel="nofollow"> View page source</a> + </li> + </ul> + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + +<style> +/* CSS overrides for sphinx_rtd_theme */ + +/* 24px margin */ +.nbinput.nblast.container, +.nboutput.nblast.container { + margin-bottom: 19px; /* padding has already 5px */ +} + +/* ... except between code cells! */ +.nblast.container + .nbinput.container { + margin-top: -19px; +} + +.admonition > p:before { + margin-right: 4px; /* make room for the exclamation icon */ +} + +/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ +.math { + text-align: unset; +} +</style> +<section id="module-binarycpython.utils.population_extensions.version_info"> +<span id="functions-module"></span><h1>functions module<a class="headerlink" href="#module-binarycpython.utils.population_extensions.version_info" title="Permalink to this headline">ïƒ</a></h1> +<p>File containing the class object containing the functions to handle binary_c version info.</p> +<p>This class will be used to extend the population object</p> +<p>NOTE: could these functions not just be normal functions rather than class methods? I see hardly any use of the self</p> +<dl class="py class"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.version_info.version_info"> +<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">binarycpython.utils.population_extensions.version_info.</span></span><span class="sig-name descname"><span class="pre">version_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/version_info.html#version_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.version_info.version_info" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Class object containing the functions to handle binary_c version info.</p> +<p>This class will be used to extend the population object</p> +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.version_info.version_info.minimum_stellar_mass"> +<span class="sig-name descname"><span class="pre">minimum_stellar_mass</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/version_info.html#version_info.minimum_stellar_mass"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.version_info.version_info.minimum_stellar_mass" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function to return the minimum stellar mass (in Msun) from binary_c.</p> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.version_info.version_info.parse_binary_c_version_info"> +<span class="sig-name descname"><span class="pre">parse_binary_c_version_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">version_info_string</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/version_info.html#version_info.parse_binary_c_version_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.version_info.version_info.parse_binary_c_version_info" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that parses the binary_c version info. Long function with a lot of branches</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>version_info_string</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – raw output of version_info call to binary_c</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>‘isotopes’ for isotope info, ‘argpairs’ for argument pair info (TODO: explain), ‘ensembles’ for ensemble settings/info, ‘macros’ for macros, ‘elements’ for atomic element info, ‘DTlimit’ for (TODO: explain), ‘nucleosynthesis_sources’ for nucleosynthesis sources, and ‘miscellaneous’ for all those that were not caught by the previous groups. ‘git_branch’, ‘git_build’, ‘revision’ and ‘email’ are also keys, but its clear what those contain.</p> +</dd> +<dt class="field-odd">Return type</dt> +<dd class="field-odd"><p>Parsed version of the version info, which is a dictionary containing the keys</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt class="sig sig-object py" id="binarycpython.utils.population_extensions.version_info.version_info.return_binary_c_version_info"> +<span class="sig-name descname"><span class="pre">return_binary_c_version_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parsed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/binarycpython/utils/population_extensions/version_info.html#version_info.return_binary_c_version_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.population_extensions.version_info.version_info.return_binary_c_version_info" title="Permalink to this definition">ïƒ</a></dt> +<dd><p>Function that returns the version information of binary_c. This function calls the function +_binary_c_bindings.return_version_info()</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>parsed</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – Boolean flag whether to parse the version_info output of binary_c. default = False</p> +</dd> +<dt class="field-even">Return type</dt> +<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>]</p> +</dd> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>Either the raw string of binary_c or a parsed version of this in the form of a nested +dictionary</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</section> + + + </div> + </div> + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="spacing_functions.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="../run_system_wrapper.html" class="btn btn-neutral float-right" title="run_system_wrapper module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> + </div> + + <hr/> + + <div role="contentinfo"> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> + </div> + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + +<br><br> +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. + + + +</footer> + </div> + </div> + </section> + </div> + <script> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/build/html/py-modindex.html b/docs/build/html/py-modindex.html index 73dca9e0d818ac3b92c2701785244bea638b11c4..9ad4576e774b64a22c87557ce25ad780bffb42aa 100644 --- a/docs/build/html/py-modindex.html +++ b/docs/build/html/py-modindex.html @@ -1,41 +1,21 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Python Module Index — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> @@ -43,29 +23,13 @@ </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -73,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -95,64 +49,29 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Python Module Index</li> - - <li class="wy-breadcrumbs-aside"> - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <h1>Python Module Index</h1> @@ -175,6 +94,16 @@ <td>    <a href="custom_logging_functions.html#module-binarycpython.utils.custom_logging_functions"><code class="xref">binarycpython.utils.custom_logging_functions</code></a></td><td> <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="dicts.html#module-binarycpython.utils.dicts"><code class="xref">binarycpython.utils.dicts</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="ensemble.html#module-binarycpython.utils.ensemble"><code class="xref">binarycpython.utils.ensemble</code></a></td><td> + <em></em></td></tr> <tr class="cg-1"> <td></td> <td>    @@ -190,6 +119,66 @@ <td>    <a href="plot_functions.html#module-binarycpython.utils.plot_functions"><code class="xref">binarycpython.utils.plot_functions</code></a></td><td> <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/analytics.html#module-binarycpython.utils.population_extensions.analytics"><code class="xref">binarycpython.utils.population_extensions.analytics</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/cache.html#module-binarycpython.utils.population_extensions.cache"><code class="xref">binarycpython.utils.population_extensions.cache</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/condor.html#module-binarycpython.utils.population_extensions.condor"><code class="xref">binarycpython.utils.population_extensions.condor</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/dataIO.html#module-binarycpython.utils.population_extensions.dataIO"><code class="xref">binarycpython.utils.population_extensions.dataIO</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/distribution_functions.html#module-binarycpython.utils.population_extensions.distribution_functions"><code class="xref">binarycpython.utils.population_extensions.distribution_functions</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/grid_options_defaults.html#module-binarycpython.utils.population_extensions.grid_options_defaults"><code class="xref">binarycpython.utils.population_extensions.grid_options_defaults</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/gridcode.html#module-binarycpython.utils.population_extensions.gridcode"><code class="xref">binarycpython.utils.population_extensions.gridcode</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/HPC.html#module-binarycpython.utils.population_extensions.HPC"><code class="xref">binarycpython.utils.population_extensions.HPC</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/metadata.html#module-binarycpython.utils.population_extensions.metadata"><code class="xref">binarycpython.utils.population_extensions.metadata</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/slurm.html#module-binarycpython.utils.population_extensions.slurm"><code class="xref">binarycpython.utils.population_extensions.slurm</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/spacing_functions.html#module-binarycpython.utils.population_extensions.spacing_functions"><code class="xref">binarycpython.utils.population_extensions.spacing_functions</code></a></td><td> + <em></em></td></tr> + <tr class="cg-1"> + <td></td> + <td>    + <a href="population_extensions/version_info.html#module-binarycpython.utils.population_extensions.version_info"><code class="xref">binarycpython.utils.population_extensions.version_info</code></a></td><td> + <em></em></td></tr> <tr class="cg-1"> <td></td> <td>    @@ -209,48 +198,36 @@ </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/readme_link.html b/docs/build/html/readme_link.html index 8e543dd16e9faa84b3e7fe13bddbb92334f47946..6266111fa0d936010c3074fb75944c6107044647 100644 --- a/docs/build/html/readme_link.html +++ b/docs/build/html/readme_link.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>Python module for binary_c — binary_c-python documentation</title> - - - - - - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Python module for binary_c — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Binarycpython code" href="modules.html" /> <link rel="prev" title="Welcome to binary_c-python’s documentation!" href="index.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1 current"><a class="current reference internal" href="#">Python module for binary_c</a><ul> @@ -111,68 +66,30 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Python module for binary_c</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/readme_link.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -197,16 +114,16 @@ text-align: unset; } </style> -<div class="section" id="python-module-for-binary-c"> -<h1>Python module for binary_c<a class="headerlink" href="#python-module-for-binary-c" title="Permalink to this headline">¶</a></h1> +<section id="python-module-for-binary-c"> +<h1>Python module for binary_c<a class="headerlink" href="#python-module-for-binary-c" title="Permalink to this headline">ïƒ</a></h1> <p>Docstring coverage:</p> <a class="reference external image-reference" href="./badges/docstring_coverage.svg"><img alt="docstring coverage" src="_images/docstring_coverage.svg" /></a> <p>Test coverage:</p> <a class="reference external image-reference" href="./badges/test_coverage.svg"><img alt="test coverage" src="_images/test_coverage.svg" /></a> <p>Binary population synthesis code that interfaces with binary_c. Based on a original work by Jeff Andrews. Updated and extended for Python3 by David Hendriks, Robert Izzard.</p> <p>The current release is version <a class="reference external" href="VERSION">version</a>, make sure to use that version number when installing!</p> -<div class="section" id="requirements"> -<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2> +<section id="requirements"> +<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">ïƒ</a></h2> <p>To run this code you need to at least have installations of:</p> <ul class="simple"> <li><p>Python 3.6 or higher</p></li> @@ -223,9 +140,9 @@ <li><p>matplotlib</p></li> <li><p>py_rinterpolate</p></li> </ul> -</div> -<div class="section" id="environment-variables"> -<h2>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">¶</a></h2> +</section> +<section id="environment-variables"> +<h2>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">ïƒ</a></h2> <p>Before compilation you need to have certain environment variables:</p> <p>Required:</p> <ul class="simple"> @@ -234,20 +151,20 @@ <li><p><code class="docutils literal notranslate"><span class="pre">LIBRARY_PATH</span></code> should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">GSL_DIR</span></code> should point to the root location where you installed GSL to. This root dir should contain <code class="docutils literal notranslate"><span class="pre">bin/</span></code>, <code class="docutils literal notranslate"><span class="pre">lib/</span></code> etc</p></li> </ul> -</div> -<div class="section" id="build-instructions"> -<h2>Build instructions<a class="headerlink" href="#build-instructions" title="Permalink to this headline">¶</a></h2> +</section> +<section id="build-instructions"> +<h2>Build instructions<a class="headerlink" href="#build-instructions" title="Permalink to this headline">ïƒ</a></h2> <p>First, make sure you have built binary_c (See <code class="docutils literal notranslate"><span class="pre">$BINARY_C/doc/binary_c2.pdf</span></code> section: installation for all the installation instructions for <code class="docutils literal notranslate"><span class="pre">binary_c</span></code>)) and that it functions correctly.</p> -<div class="section" id="installation-via-pip"> -<h3>Installation via PIP:<a class="headerlink" href="#installation-via-pip" title="Permalink to this headline">¶</a></h3> +<section id="installation-via-pip"> +<h3>Installation via PIP:<a class="headerlink" href="#installation-via-pip" title="Permalink to this headline">ïƒ</a></h3> <p>To install this package via pip:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">binarycpython</span> </pre></div> </div> <p>This will install the latest stable installation that is available on pip.</p> -</div> -<div class="section" id="installation-from-source"> -<h3>Installation from source:<a class="headerlink" href="#installation-from-source" title="Permalink to this headline">¶</a></h3> +</section> +<section id="installation-from-source"> +<h3>Installation from source:<a class="headerlink" href="#installation-from-source" title="Permalink to this headline">ïƒ</a></h3> <p>We can also install the package from source, which is useful for development versions and when you want to modify the code. It is recommended that you install this into a virtual environment. From within the root directory, run</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">install</span><span class="o">.</span><span class="n">sh</span> </pre></div> @@ -258,33 +175,33 @@ </pre></div> </div> <p>to reinstall just binarycpython.</p> -<div class="section" id="after-installation"> -<h4>After installation<a class="headerlink" href="#after-installation" title="Permalink to this headline">¶</a></h4> +<section id="after-installation"> +<h4>After installation<a class="headerlink" href="#after-installation" title="Permalink to this headline">ïƒ</a></h4> <p>After installing the code via source it is useful to run the test suite before doing any programming with it. The test suite is stored in <code class="docutils literal notranslate"><span class="pre">binarycpython/tests</span></code> and running <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">main.py</span></code> in there will run all the tests.</p> -</div> -</div> -</div> -<div class="section" id="examples"> -<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +</section> +</section> +</section> +<section id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">ïƒ</a></h2> <p>See the examples/ directory for example scripts and notebooks. The documentation contains example pages as well.</p> -</div> -<div class="section" id="usage-notes"> -<h2>Usage notes<a class="headerlink" href="#usage-notes" title="Permalink to this headline">¶</a></h2> +</section> +<section id="usage-notes"> +<h2>Usage notes<a class="headerlink" href="#usage-notes" title="Permalink to this headline">ïƒ</a></h2> <p>Make sure that with every change/recompilation you make in <code class="docutils literal notranslate"><span class="pre">binary_c</span></code>, you also rebuild this package. Whenever you change the sourcecode of this package, you need to reinstall it into your virtualenvironment as well</p> -</div> -<div class="section" id="documentation"> -<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h2> +</section> +<section id="documentation"> +<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">ïƒ</a></h2> <p>Look in the docs/ directory. Within the build/html/ there is the html version of the documentation. The</p> -</div> -<div class="section" id="development"> -<h2>Development:<a class="headerlink" href="#development" title="Permalink to this headline">¶</a></h2> +</section> +<section id="development"> +<h2>Development:<a class="headerlink" href="#development" title="Permalink to this headline">ïƒ</a></h2> <p>If you want to contribute to the code, then it is recommended that you install the packages in <code class="docutils literal notranslate"><span class="pre">development_requirements.txt</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">development_requirements</span><span class="o">.</span><span class="n">txt</span> </pre></div> </div> -</div> -<div class="section" id="faq-issues"> -<h2>FAQ/Issues:<a class="headerlink" href="#faq-issues" title="Permalink to this headline">¶</a></h2> +</section> +<section id="faq-issues"> +<h2>FAQ/Issues:<a class="headerlink" href="#faq-issues" title="Permalink to this headline">ïƒ</a></h2> <p>Building issues with binary_c itself:</p> <ul class="simple"> <li><p>see the documentation of binary_c (in doc/).</p></li> @@ -302,62 +219,44 @@ <li><p>When running jupyter notebooks, make sure you are running the jupyter installation from the same virtual environment.</p></li> <li><p>When the output of binary_c seems to be different than expected, you might need to rebuild this python package. Everytime binary_c is compiled, this package needs to be rebuilt too.</p></li> </ul> -</div> -</div> +</section> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="modules.html" class="btn btn-neutral float-right" title="Binarycpython code" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="index.html" class="btn btn-neutral float-left" title="Welcome to binary_c-python’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="index.html" class="btn btn-neutral float-left" title="Welcome to binary_c-python’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="modules.html" class="btn btn-neutral float-right" title="Binarycpython code" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/run_system_wrapper.html b/docs/build/html/run_system_wrapper.html index 02b1ce33438ed1579ddfae0115163a113c40ff9e..ee46e61091ac48ed2753aa9bab45046daea320dd 100644 --- a/docs/build/html/run_system_wrapper.html +++ b/docs/build/html/run_system_wrapper.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>run_system_wrapper module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>run_system_wrapper module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="spacing_functions module" href="spacing_functions.html" /> - <link rel="prev" title="plot_functions module" href="plot_functions.html" /> + <link rel="next" title="stellar_types module" href="stellar_types.html" /> + <link rel="prev" title="functions module" href="population_extensions/version_info.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>run_system_wrapper module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/run_system_wrapper.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,13 +121,13 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.run_system_wrapper"> -<span id="run-system-wrapper-module"></span><h1>run_system_wrapper module<a class="headerlink" href="#module-binarycpython.utils.run_system_wrapper" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.run_system_wrapper"> +<span id="run-system-wrapper-module"></span><h1>run_system_wrapper module<a class="headerlink" href="#module-binarycpython.utils.run_system_wrapper" title="Permalink to this headline">ïƒ</a></h1> <p>Module containing the utility function run_system, which handles a lot of things by analysing the passed kwargs</p> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.run_system_wrapper.run_system"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.run_system_wrapper.</span></span><span class="sig-name descname"><span class="pre">run_system</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/run_system_wrapper.html#run_system"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.run_system_wrapper.run_system" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.run_system_wrapper.</span></span><span class="sig-name descname"><span class="pre">run_system</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/run_system_wrapper.html#run_system"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.run_system_wrapper.run_system" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function that runs a system. Mostly as a useful utility function that handles all the setup of argument lists etc.</p> <p class="rubric">Examples</p> @@ -244,61 +170,43 @@ and returns what the parse_function returns</p> </dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="spacing_functions.html" class="btn btn-neutral float-right" title="spacing_functions module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="plot_functions.html" class="btn btn-neutral float-left" title="plot_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="population_extensions/version_info.html" class="btn btn-neutral float-left" title="functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="stellar_types.html" class="btn btn-neutral float-right" title="stellar_types module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/search.html b/docs/build/html/search.html index 41bba4ef85f63d8f3446164a65efe614cb53b089..8d4d39e21c2910540c94faab9e221b511a896418 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -1,69 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Search — binary_c-python documentation</title> - - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> + <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - <script src="_static/searchtools.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> + <script src="_static/searchtools.js"></script> + <script src="_static/language_data.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="#" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="#" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -71,17 +37,7 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> @@ -93,71 +49,33 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li>Search</li> - - <li class="wy-breadcrumbs-aside"> - - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <noscript> <div id="fallback" class="admonition warning"> <p class="last"> - Please activate JavaScript to enable the search - functionality. + Please activate JavaScript to enable the search functionality. </p> </div> </noscript> @@ -168,53 +86,41 @@ </div> </div> - </div> <footer> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> - - - - - - <script type="text/javascript"> + <script> jQuery(function() { Search.loadIndex("searchindex.js"); }); </script> - <script type="text/javascript" id="searchindexloader"></script> + <script id="searchindexloader"></script> diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index b7de8314ae9eaf4c2cfa527e95c5b2575e392c6b..880d787585ed437f1fde299ec367cafdef1181fe 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["binary_c_parameters","custom_logging_functions","distribution_functions","example_notebooks","examples/notebook_BHBH","examples/notebook_HRD","examples/notebook_api_functionality","examples/notebook_common_envelope_evolution","examples/notebook_custom_logging","examples/notebook_extra_features","examples/notebook_individual_systems","examples/notebook_luminosity_function_binaries","examples/notebook_luminosity_function_single","examples/notebook_massive_remnants","examples/notebook_population","examples/notebook_solar_system","examples/old/basic_example","examples/old/workshop_example_notebook","functions","grid","grid_options_defaults","grid_options_descriptions","hpc_functions","index","modules","plot_functions","readme_link","run_system_wrapper","spacing_functions","stellar_types","useful_funcs"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,nbsphinx:3,sphinx:56},filenames:["binary_c_parameters.rst","custom_logging_functions.rst","distribution_functions.rst","example_notebooks.rst","examples/notebook_BHBH.ipynb","examples/notebook_HRD.ipynb","examples/notebook_api_functionality.ipynb","examples/notebook_common_envelope_evolution.ipynb","examples/notebook_custom_logging.ipynb","examples/notebook_extra_features.ipynb","examples/notebook_individual_systems.ipynb","examples/notebook_luminosity_function_binaries.ipynb","examples/notebook_luminosity_function_single.ipynb","examples/notebook_massive_remnants.ipynb","examples/notebook_population.ipynb","examples/notebook_solar_system.ipynb","examples/old/basic_example.ipynb","examples/old/workshop_example_notebook.ipynb","functions.rst","grid.rst","grid_options_defaults.rst","grid_options_descriptions.rst","hpc_functions.rst","index.rst","modules.rst","plot_functions.rst","readme_link.rst","run_system_wrapper.rst","spacing_functions.rst","stellar_types.rst","useful_funcs.rst"],objects:{"binarycpython.utils":{custom_logging_functions:[1,0,0,"-"],functions:[18,0,0,"-"],grid:[19,0,0,"-"],plot_functions:[25,0,0,"-"],run_system_wrapper:[27,0,0,"-"],stellar_types:[29,0,0,"-"],useful_funcs:[30,0,0,"-"]},"binarycpython.utils.custom_logging_functions":{autogen_C_logging_code:[1,1,1,""],binary_c_log_code:[1,1,1,""],binary_c_write_log_code:[1,1,1,""],compile_shared_lib:[1,1,1,""],create_and_load_logging_function:[1,1,1,""],from_binary_c_config:[1,1,1,""],return_compilation_dict:[1,1,1,""]},"binarycpython.utils.functions":{Capturing:[18,2,1,""],bin_data:[18,1,1,""],call_binary_c_config:[18,1,1,""],catchtime:[18,2,1,""],check_if_in_shell:[18,1,1,""],conv_time_units:[18,1,1,""],convert_bytes:[18,1,1,""],convfloat:[18,1,1,""],create_arg_string:[18,1,1,""],create_hdf5:[18,1,1,""],datalinedict:[18,1,1,""],example_parse_output:[18,1,1,""],filter_arg_dict:[18,1,1,""],format_number:[18,1,1,""],get_ANSI_colours:[18,1,1,""],get_arg_keys:[18,1,1,""],get_defaults:[18,1,1,""],get_help:[18,1,1,""],get_help_all:[18,1,1,""],get_help_super:[18,1,1,""],get_size:[18,1,1,""],get_username:[18,1,1,""],imports:[18,1,1,""],is_capsule:[18,1,1,""],isfloat:[18,1,1,""],isint:[18,1,1,""],load_logfile:[18,1,1,""],make_build_text:[18,1,1,""],mem_use:[18,1,1,""],now:[18,1,1,""],output_lines:[18,1,1,""],pad_output_distribution:[18,1,1,""],remove_file:[18,1,1,""],temp_dir:[18,1,1,""],timedelta:[18,1,1,""],trem:[18,1,1,""],verbose_print:[18,1,1,""],write_binary_c_parameter_descriptions_to_rst_file:[18,1,1,""]},"binarycpython.utils.functions.Capturing":{__enter__:[18,3,1,""],__exit__:[18,3,1,""]},"binarycpython.utils.functions.catchtime":{__enter__:[18,3,1,""],__exit__:[18,3,1,""]},"binarycpython.utils.grid":{Population:[19,2,1,""]},"binarycpython.utils.grid.Population":{clean:[19,3,1,""],evolve:[19,3,1,""],evolve_single:[19,3,1,""],exit:[19,3,1,""],export_all_info:[19,3,1,""],jobID:[19,3,1,""],parse_cmdline:[19,3,1,""],return_all_info:[19,3,1,""],return_binary_c_defaults:[19,3,1,""],return_population_settings:[19,3,1,""],set:[19,3,1,""],was_killed:[19,3,1,""]},"binarycpython.utils.plot_functions":{color_by_index:[25,1,1,""],dummy:[25,1,1,""],parse_function_hr_diagram:[25,1,1,""],parse_function_masses:[25,1,1,""],parse_function_orbit:[25,1,1,""],plot_HR_diagram:[25,1,1,""],plot_masses:[25,1,1,""],plot_orbit:[25,1,1,""],plot_system:[25,1,1,""]},"binarycpython.utils.run_system_wrapper":{run_system:[27,1,1,""]},"binarycpython.utils.useful_funcs":{calc_period_from_sep:[30,1,1,""],calc_sep_from_period:[30,1,1,""],maximum_mass_ratio_for_RLOF:[30,1,1,""],minimum_period_for_RLOF:[30,1,1,""],minimum_separation_for_RLOF:[30,1,1,""],ragb:[30,1,1,""],roche_lobe:[30,1,1,""],rzams:[30,1,1,""],zams_collision:[30,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"0":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,21,30],"00":[4,10,11,14,17],"000":[4,10,17],"0000":[4,10,17],"00000":17,"000000":17,"000000000000e":10,"000000e":17,"000001":10,"000002":10,"000003":10,"0001":[4,6,30],"000122339":14,"000161974":14,"000214449":14,"000220016":14,"000283924":14,"000287968":14,"000375908":14,"000497691":14,"000498487":14,"00065893":14,"000872405":14,"001":[0,4,6],"00115504":14,"0013":4,"00152924":14,"00182":4,"002":[4,16,17],"00202467":14,"0021272":4,"00215604":4,"00235329":4,"00237669":4,"00239838":4,"00242158":4,"00247821":4,"00247864":4,"00248439":4,"00254115":4,"00254512":4,"00256681":4,"00261516":4,"00268237":4,"00280816":4,"00283345":4,"00286793":4,"00288661":4,"00294":4,"00296406":4,"003":4,"00300971":4,"00303761":4,"00311757":4,"00317508":4,"00319483":4,"0034":4,"004":4,"004698855121516281":14,"005":4,"00518983":4,"0055":4,"00585495":4,"006":4,"0062211552141636295":14,"00632092":6,"00666382":4,"007":[4,15],"00707417":4,"00712":4,"00730797":4,"0074":4,"008":4,"0081514":4,"00823663875514986":14,"00832":4,"0087":4,"009":[4,15],"00984861":4,"00e":11,"01":[0,4,5,6,7,8,11,14,17],"010":4,"0102":4,"010905083645619543":14,"011":4,"0118":4,"012":4,"0122109":4,"012246630357e":14,"0128":4,"013":4,"0131145":4,"014":4,"0141":6,"0143651":4,"0143896":7,"014832":4,"015":4,"0152545":4,"0153961":4,"0155":4,"0156":4,"01561":4,"0156945":4,"0159":4,"016":4,"0162":4,"016309":7,"0163656":7,"0164":4,"0165":4,"0166":4,"0168":4,"0169":4,"017":[4,15],"0171":4,"0175264":7,"0176575":5,"01791":4,"018":4,"0182":4,"0184":4,"0187":4,"019":4,"0192009":4,"019715467199999996":7,"01e":11,"01t09":[5,7,11],"01t10":11,"02":[0,4,5,6,7,8,10,11,14,15,17,30],"020":4,"0208":4,"021":4,"0214":4,"0214824":4,"021960493499e":14,"022":4,"023":4,"0232618":4,"02379":4,"024":4,"0241634":4,"0245":4,"024684":4,"02473":4,"0248684":14,"025":4,"0250231":4,"0251003":4,"0259932":4,"026":4,"0261496":4,"027":4,"0276":4,"02786":4,"0278672":4,"028":4,"02823":4,"0283541":4,"029":4,"0290733":4,"0295":4,"0298011":4,"0298364":4,"02e":[7,11],"03":[0,1,4,6,7,11],"030":4,"0303129":4,"030499912298e":14,"031":4,"0316266":4,"0319":4,"032":4,"03221":4,"033":4,"0335":4,"0335017":4,"034":4,"03493":4,"03499999999999":13,"035":4,"03502960360000004":7,"03507":4,"036":4,"0367878":4,"037":4,"0385396":4,"039":4,"0393944":4,"0394":4,"0399":4,"03996e":4,"03e":11,"04":[0,4,6,11,17],"040":4,"041":4,"0411":4,"0414":4,"04198":4,"042":4,"0425":4,"043":4,"0434":14,"044":4,"0440989":4,"044142002936e":8,"04440288843805411":14,"0444029":14,"044572277695e":8,"044654032097e":8,"0448877":4,"0449442":4,"045":4,"045084306856e":8,"0459174":4,"046":4,"0461":4,"0469097":4,"047":[4,14,15],"0474164":4,"0474572":4,"048":[4,15,17],"049":4,"04924":4,"04e":11,"05":[0,4,6,7,8,11,14],"0501":4,"050651207308e":8,"051":[4,5],"0511173":4,"0512":4,"052":4,"0523":4,"0528412":4,"053":4,"0531294":4,"0533803":4,"0535":4,"0536749":4,"054":4,"0547419":4,"055":4,"055188":4,"056":[4,15],"0563088":4,"057":4,"0570946":17,"0572914":4,"057949":4,"058":4,"0583837":4,"0585":4,"059":4,"05e":11,"05e51ba114934b37bab48f1db40b7333":14,"06":[0,4,7,8,10,11],"0608":4,"061":4,"061141":4,"0613":4,"062":4,"0621119":4,"0625403":4,"06257":4,"0626266":4,"063":4,"064":4,"0641":4,"06459059967730083":7,"0645906":7,"0649":4,"065":4,"06527":4,"066":4,"06696":4,"067":4,"0670735":4,"068":4,"0683196":4,"069":4,"06987":4,"06e":11,"07":[4,11,12,13,17],"070":[4,14],"0701913":4,"071":4,"07108":4,"0714679":4,"0717":4,"0719":4,"072":4,"0722":4,"0727126":4,"0727584":4,"074":4,"0744186":4,"0745":4,"07484":4,"075":4,"075416":4,"0755737":4,"076":4,"077":4,"0770302":4,"0772021":4,"0772781":4,"078":4,"0784":4,"0784722":4,"0787729":4,"0789786":4,"079":[4,5],"0791":4,"07e":11,"08":[0,4,7,11,17],"080763":10,"0808":4,"081":[4,5],"081024":5,"082":4,"0820":[0,6],"0823499":4,"0831":4,"0834973":17,"0837":4,"084":4,"0849409":4,"085":4,"086":4,"086004":4,"0868":4,"087":4,"0877":4,"0877243":4,"0878":4,"088":4,"089":4,"0890815":4,"0896":4,"08e":11,"08msun":[0,6],"09":[4,5,7,11],"090":4,"0900":17,"0902":[0,6],"0907":4,"0907537":4,"091":4,"0910814":4,"0913095":4,"09164":4,"092":4,"09295167374":11,"093":[5,15],"0931922":4,"094":[4,7],"094409257247e":14,"095":4,"0958704":4,"096":4,"09665":4,"0967":14,"097":4,"09706e":4,"09786":4,"098":[4,5],"0987206":4,"099":4,"0991059":4,"0993":4,"099417":7,"0995":4,"0m":11,"0mb":[7,11],"0x146f912dbc60":6,"0x149c2e81ec10":10,"0x149c95c56c10":7,"0x14bf2250fdc0":5,"0x1528ac7290d0":14,"1":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,21,23,25,26,27,30],"10":[0,4,5,6,7,8,10,11,12,13,14,15,16,17,21,27],"100":[0,4,5,6,7,11,12,13],"1000":[0,6,7,21],"100000000000":[16,17],"1001":11,"1005":4,"101":4,"101038":4,"1012":4,"101323":4,"101955":4,"102":4,"1021":4,"1024mb":21,"1025":11,"102750e":17,"103":4,"1035":4,"103702":4,"103789":4,"104":[4,7],"1043":4,"104427":4,"104997":4,"105":[4,12,13],"105082":4,"10522":4,"105704":4,"106":4,"1062":4,"106368":4,"106545":4,"10689":4,"107":4,"107187":4,"1075":4,"10782":4,"108":[4,14],"1082":4,"1085":10,"108571":4,"10877":4,"1088":4,"109":[4,7],"10941":4,"109679":4,"1098":4,"1099":4,"10e":11,"11":[0,4,5,7,8,10,11,13,14,15,17],"110":4,"11003":10,"1104":4,"1108":4,"111":4,"111023":4,"111583":4,"11182":4,"112":4,"11239":4,"1124":4,"113":4,"1130":4,"11346":4,"113492":17,"1135":4,"11376":4,"114":4,"114678":4,"11491":4,"115":4,"11506":4,"115297":4,"11558":4,"115722":4,"11582":10,"116":4,"11686":4,"11695":4,"117":4,"11707":4,"1173":4,"1178":4,"118":4,"11802":4,"118229":4,"11854":4,"119":4,"1193":4,"1199":4,"11e":11,"12":[0,4,5,8,10,11,13,14,15,17,18],"120":4,"120000":[0,6],"120066":4,"1204":[4,17],"121":4,"121263":4,"12136":4,"1219":4,"122":4,"1222":4,"123":4,"123048":4,"12325":10,"123635":4,"1237":4,"123794969278e":14,"1239555":7,"124":4,"1241251901":15,"124379":17,"124496":4,"12457":10,"12460":10,"12461":10,"124931":4,"12495":4,"125":[0,4,6],"12500":0,"12522":4,"1254":4,"12548":4,"125553":4,"125886":4,"125968":4,"126":4,"126532":4,"127":4,"12741":4,"127442":4,"127957":4,"128":4,"12806":4,"129":4,"12974":4,"129879":4,"12e":[1,5,8,10,11,12,13,14],"13":[0,4,5,6,7,8,10,11,13,14,15,17],"130":4,"1301":10,"1302":10,"1306":4,"130725":4,"131":4,"13108":17,"1314":4,"131680e":17,"132":4,"132057":4,"1326":4,"13267":4,"1327":4,"13298":4,"133":4,"1334":4,"134":[4,14],"13416":4,"1345":10,"1346":10,"13461":10,"1347":10,"1348":10,"1349":10,"135":4,"135101":4,"135164":4,"1354":11,"1355":11,"13567":8,"136":4,"1360":4,"13607":4,"13626":14,"137":4,"13700":[5,7],"137502":4,"1379":4,"13796e":4,"138":4,"1380":17,"139":4,"139044":4,"1392":4,"139293101586e":14,"139732":4,"1398":4,"13e3":[0,6],"14":[0,4,5,6,8,10,11,13,14,15,17],"140":4,"141":4,"14112":4,"141361":4,"1415":4,"142":4,"14212":4,"143":4,"144":4,"144141":4,"14439":4,"14461":10,"1449":[4,11],"145":4,"145296":4,"145632":4,"146":4,"1468":4,"146844":4,"147":4,"1471":4,"1473":4,"14764":4,"1478":4,"148":[4,17],"1485":4,"148721":4,"149":4,"1492":4,"1494":11,"1498":4,"14e":11,"15":[0,4,6,7,8,10,11,13,14,15,17,21],"150":[4,7,11,12,13,14],"15000":[0,4,6,8,10,14,15,17],"1502":4,"150217":4,"15042":4,"150681":4,"151":4,"1514":4,"151616":4,"1517":4,"15186":4,"152":4,"1521":4,"1527":4,"153":4,"153329":4,"153852":4,"1539":11,"154":4,"155":4,"1551":4,"1553":4,"155342":4,"155662":11,"155678":7,"15594":4,"156":[4,7,17],"1560":4,"1567":4,"1569":4,"157":4,"1571":4,"1575":4,"158":4,"1585":11,"1586":4,"158640":7,"15884":4,"159":[4,7],"15907":4,"1599":4,"15e":11,"16":[0,4,7,11,13,14,15,17],"160":4,"1606":4,"160675":11,"161":4,"1610":4,"1612":4,"1618":4,"162":4,"162006":4,"162038":4,"1622":4,"1624":[4,11],"162454":11,"16265":4,"1627":10,"162734":10,"162941":4,"163":[4,7],"1631":4,"1633":4,"163481":7,"1635760192":5,"1635760194":5,"1635760256":7,"1635760377":7,"1635760613":11,"1635760806":13,"1635760813":13,"1635760967":14,"1635760970":14,"1635761189":11,"1637":4,"164":4,"164714":4,"165":4,"16539":4,"16564":4,"166":[4,7],"1663":4,"166559":4,"167":[4,11],"1670":4,"16729":4,"16733":4,"1674":[4,11],"1678":4,"168":[4,7],"16833":4,"16837":4,"168379":7,"168558":4,"168972":4,"169":4,"1691":4,"1695":4,"169775":11,"17":[4,5,7,11,13,14,15,17],"170":4,"1703":11,"1708":4,"171":4,"171096":4,"1713":4,"1715":4,"172":4,"172014":4,"1722":4,"1729":4,"173":4,"1736":4,"174":4,"174169":4,"1747":4,"1749":11,"175":4,"175004":4,"1753":4,"17588":4,"176":4,"176751":11,"177":[4,7],"177444":4,"1775":4,"177551":4,"177727":4,"178":4,"1780":11,"1781":4,"1783":4,"1784":4,"1786":4,"179":4,"179142":4,"1792":4,"17932":4,"1796":4,"18":[4,11,13,15,17],"180":4,"1804":4,"180453":4,"1806":4,"1807":4,"1808":4,"1809":4,"181":4,"1810":4,"18108":4,"1811":4,"1812":4,"181244":4,"1813":4,"18139":4,"1814":[4,11],"18148":4,"1815":4,"1816":4,"1817":4,"181795":4,"1818":4,"1819":4,"181971798545e":14,"182":4,"1821":4,"1822":4,"1823":4,"1824":4,"1825":4,"1826":4,"1827":4,"1828":4,"1829":4,"183":4,"1830":4,"183048":4,"1831":4,"1833":4,"1834":4,"1835":4,"1838":4,"1839":4,"183974":4,"184":4,"1841":4,"1843":4,"1844":4,"184464":4,"1845":4,"1846":4,"1847":4,"184829":4,"185":4,"1851":[4,11],"1854":4,"1858":4,"186":[4,11],"1865":8,"187":4,"1876":4,"187694":4,"1877":4,"1879":11,"187993":4,"188":4,"1882":4,"189":4,"189239":4,"19":[4,7,11,14,17],"190":[0,4,17],"19097":4,"191":4,"1910":11,"1915":4,"191543":4,"192":4,"1920":4,"1923":4,"193":4,"193528":4,"19366":4,"19393":4,"194":4,"1947":11,"195":4,"1951":[0,6],"19521":4,"196":4,"196046":4,"196177":4,"19622":4,"196311":4,"1967":4,"1968":11,"197":4,"1972":[0,6],"1973":4,"1975":[0,6],"1977":4,"197729":4,"197x":[0,6],"198":4,"1983":30,"1986":[0,6],"1987":4,"1989":[0,6,11],"199":4,"19907":4,"1992":[0,6],"1993":[0,6],"1996":30,"1998":[0,4,6],"1999":[0,6],"19e":11,"1aearth":15,"1ajupit":15,"1amar":15,"1amercuri":15,"1aneptun":15,"1apluto":15,"1asaturn":15,"1auranu":15,"1avenu":15,"1ckzg0p9":[23,26],"1dex":[11,12,13],"1e":[0,6,7,8,10,11,17],"1e2":[0,6],"1e9":[0,6],"1m":11,"1mb":[7,11],"1mearth":15,"1mjupit":15,"1mmar":15,"1mmercuri":15,"1mneptun":15,"1mpluto":15,"1msaturn":15,"1muranu":15,"1mvenu":15,"1s":[7,11],"1y":[0,6],"2":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,17,18,21,23,25,26],"20":[0,4,5,7,8,11,12,13,14,15,17],"200":[0,4,6],"2000":[0,4,6],"2001":[12,13],"2002":[0,6],"2003":[0,6],"2004":[0,4,6],"2005":[0,4,6],"2008":4,"2009":[0,6],"201":4,"2010":[0,6,21],"2012":[0,6],"2013":[0,6],"2014":[0,4,6],"2015":[0,4,6],"2016":[0,6],"2017":[0,6,11,14,21],"2018":[0,1,4,6],"2019":[0,4,6,17],"202":4,"2020":[0,6],"2021":[0,4,5,7,11],"20211216":0,"202196":4,"202339":4,"202569":4,"20265":4,"202750e":17,"2029":4,"203":4,"2033":4,"204":4,"2044":4,"20447":4,"204663":4,"2048":11,"205":4,"2053":4,"205353":4,"205527":4,"205537":4,"2057":4,"206":[4,15],"2063":4,"20677":4,"207":4,"2071":11,"2075":4,"208":4,"2081":4,"208169":4,"208453":4,"20887":4,"208923":4,"209":4,"2091":11,"209274":4,"20938":4,"20980":4,"20e":[7,11],"21":[0,1,4,5,11,17],"210":[4,17],"21043":4,"211":[4,13],"2112":4,"2118":17,"212":4,"212034":4,"2122":11,"2127":4,"213":4,"2132":4,"21333":4,"213396":4,"2135":4,"213854":4,"214":4,"214274644851685":17,"2143":11,"2147":4,"215":4,"215504":4,"2156":4,"215638":4,"2157":4,"21587440567681537":14,"21587440567681548":14,"2158744056768156":14,"216":4,"21603":4,"216067":4,"2164":11,"216496":4,"216951":4,"217":4,"21764":4,"218":4,"2182":4,"218222":13,"21824":4,"2183":11,"21844":4,"219":4,"219029061236e":14,"219058":4,"2191":4,"21927":4,"21948":4,"21e":11,"22":[4,11,17],"220":4,"22036":4,"2206":11,"22098":4,"221":4,"2210":4,"2214":4,"2216":4,"221832":4,"222":4,"2221":4,"2224":4,"22281":4,"223":4,"2232":11,"2234":4,"224":4,"2245":11,"224923":4,"225":4,"225135":4,"22518":4,"22543":4,"2258":11,"226":4,"2261":4,"22611318083528548":7,"226424":4,"2266":4,"2268":4,"2269":11,"227":4,"227249":4,"2275":4,"22787":4,"227955577093495":14,"228":4,"2282":11,"228555":4,"229":4,"2291":4,"22936":4,"2295":4,"229591":4,"22e":7,"23":[4,11,14],"230":4,"2300":11,"230102":4,"2305":4,"230955":4,"231":4,"231680e":17,"231704":4,"232":4,"2329":11,"233":4,"2332":4,"2333":4,"2338":4,"234":[4,7],"2348":11,"235":[4,5],"23513":4,"2352":4,"235464":4,"235689312423":7,"236":[4,17],"2365":[11,17],"237":4,"2371":4,"237203":4,"237951":4,"238":4,"2383":11,"238584":4,"23894":4,"239":4,"239197":4,"239704":4,"24":[4,7,11],"240":4,"2400":11,"2403e":14,"2406":4,"24098":4,"241":4,"2413":4,"24165":4,"242":4,"2421":4,"242151":4,"2423":11,"242309":4,"2424":10,"243":[4,5],"243214":4,"243583":4,"2437":4,"2438":11,"2439":4,"244":[4,15],"2444":15,"244645":4,"245":4,"245209":4,"245223":4,"2454":11,"246":4,"2466":11,"246604":4,"246625":4,"246671":5,"247":4,"2472":4,"2477":[4,11],"248":[4,7],"248871":4,"249":4,"249106":4,"2492":11,"2493":4,"249848":4,"24e":11,"25":[0,4,7,11,17],"250":4,"25014bc73b334765a1c09a4e4a97ed66":11,"251":[4,7],"2514":4,"2516":11,"25164":4,"252":4,"2528":4,"252877":4,"2529":4,"253":4,"2537":11,"253705":4,"254":4,"2544031669784":14,"255":[0,4,6],"2551":4,"2552":4,"2554":11,"2556":4,"256":[4,5,21],"256488":4,"256783":4,"25694":4,"257":[4,30],"2570":11,"2572":14,"257278":4,"257437":4,"2576084265970895":14,"258":[4,7],"2583":4,"259":4,"2590":11,"25msun":[0,6],"26":[4,11],"260":4,"26051":4,"260676":4,"261":4,"2613":4,"261343":4,"26171201413c43f5b91552a374879940":5,"2618":4,"262":4,"2622":[4,11],"2626":4,"2629":4,"263":4,"263079":4,"2632":4,"263235":4,"2636":11,"264":4,"26416":4,"26441":4,"26456":4,"2646":17,"265":4,"2652":11,"266":4,"2663":4,"26637":4,"2664":4,"266485":4,"2666":11,"267":[4,7],"2670":4,"2671":4,"2672":4,"2673":4,"2674":4,"2676":4,"2677":4,"2678":4,"2679":4,"268":4,"2680":4,"2681":4,"2682":4,"2683":4,"2684":4,"2685":4,"2686":4,"2687":4,"2688":4,"2689":4,"269":4,"2690":4,"2691":[4,11],"2692":4,"2693":4,"2694":4,"2695":4,"2696":4,"2697":4,"2698":4,"2699":4,"27":[4,7,11,14],"270":4,"2700":4,"2701":4,"2702":4,"27025":4,"2703":4,"2704":4,"2705":4,"2706":4,"2707":4,"2708":4,"2709":4,"271":4,"2710":4,"2711":4,"2712":4,"2713":4,"2714":4,"27143e":14,"2715":4,"2716":4,"2717":4,"2718":4,"2719":4,"272":4,"2720":4,"2721":4,"2722":4,"2723":4,"2724":4,"2725":4,"2726":4,"2727":4,"2728":4,"2729":4,"272943":4,"273":4,"2730":4,"2731":4,"2732":4,"2733":[4,11],"2734":4,"274":4,"274206":4,"274445":4,"2746":11,"274854":4,"275":4,"2754":4,"27569e":4,"2757":11,"276":4,"2767":4,"277":4,"2773":4,"27734":4,"2775":11,"27767":4,"278":4,"27829":4,"279":4,"2791":4,"2795":11,"28":[4,6,7,8,10,11,21],"280":4,"2800":4,"2801":4,"2802":4,"280723":4,"280749":4,"281":[4,30],"281309":4,"28134439269236855":14,"2816":4,"2819":4,"282":4,"282234":4,"2823":4,"282623":4,"283":4,"2831":11,"2834":4,"2835":4,"2836":4,"28369":4,"283972":4,"284":4,"2845":11,"2846":4,"285":4,"286":4,"2861":11,"287":4,"2871":4,"2873":4,"2875":11,"2878":4,"288":4,"2881":4,"288353":4,"28867":4,"289":4,"2891":11,"2898":4,"28984":4,"28e":7,"29":[4,7,11,14],"290":4,"290684":4,"291":4,"29136":4,"2914":4,"292":4,"2921":4,"2924":4,"292641":4,"2927":4,"293":4,"2930":11,"2934e":17,"293512":4,"294":[4,5],"29427":14,"29448":14,"29457":14,"2947":[11,14],"295":4,"295543":4,"296":4,"2961":4,"2965":11,"296544":4,"2967":4,"297":4,"297187":4,"297506":4,"298":4,"29816":4,"298194":4,"2982":11,"299":4,"2991":4,"2996":4,"29e":11,"2b66f805db424c48a1d29c45092b6e3c":7,"2d":[0,6],"2e":[8,11,17],"2f":17,"2m":[7,11],"2mb":[7,11],"2msun":[0,6],"2s":11,"3":[0,1,4,5,6,7,8,9,10,11,12,13,14,17,18,21,23,26],"30":[1,4,5,7,8,10,11,12,13,14,15,17],"300":4,"3000":[0,6,15],"3002":4,"3008":4,"301":4,"3010":11,"301129":4,"301483":4,"3017":4,"302":[4,17],"3025":4,"302750e":17,"303":4,"3034":4,"3035":11,"303533":4,"3038":4,"30388e":4,"304":4,"3042":4,"30441":4,"3046":4,"3048":4,"305":4,"305334":4,"3059":11,"306":4,"30642":14,"3065":4,"306619":4,"3069":4,"307199":4,"3078":11,"308":4,"3081e":17,"3082":4,"308203":4,"3084":4,"309":4,"30902":14,"309361":4,"309461":4,"3096":4,"30975":4,"30e4":[0,6],"31":[0,4,6,7,11,17],"310":4,"3100":[4,11],"310029":4,"3101":4,"311":4,"312":[4,5],"3124":11,"312637":4,"3127":4,"313":4,"313623":11,"314":4,"31408":4,"314533":4,"3148":11,"315":4,"315124":4,"315223":4,"3154":4,"315404":4,"315903":4,"315973":4,"316":[4,7],"316118":4,"317":4,"3171":4,"3172":4,"3174":11,"3176":4,"317663":4,"317921":4,"318":4,"3185":4,"318753":4,"319":4,"3192":4,"3193":4,"31958":4,"3197":11,"31e":11,"32":[4,7,11,14,18,21],"320":4,"3205":14,"32076":4,"321":4,"321082":4,"3211":4,"32118":4,"3216":4,"321643":4,"322":4,"3223":4,"3228":[4,14],"32282":4,"323":4,"3231":[4,11],"323359":7,"3235":4,"324":4,"3243":4,"3244":4,"3245144":14,"3246":4,"3247":4,"3248":4,"325":4,"325197":4,"3256":11,"325743":4,"325965":4,"326":4,"326147":4,"32620":4,"32631":4,"3264":4,"326601":4,"32684":4,"327":4,"3273":[4,11],"328":4,"328066":4,"3282":4,"328512":4,"329":[4,7],"3294":11,"32e":11,"33":[0,4,11],"330":4,"331":4,"331680e":17,"332":4,"332091":4,"3321":11,"332251":4,"332777":4,"33295":4,"333":4,"333032":4,"3331":4,"334":4,"33451":4,"33469":8,"3348":11,"335":4,"335153":4,"3352":4,"335342":4,"335428":4,"33552":4,"335642":4,"335847":4,"336":4,"336295":4,"3368":4,"33699":14,"337":4,"33719":4,"337249":4,"3373":11,"338":[4,8],"33817":17,"33879":4,"339":4,"3394":11,"339587":4,"3396":4,"34":[4,5,6,7,8,10,11,12,14,15],"340":4,"34018":4,"340477":4,"34081":4,"341":4,"3412":4,"34126":4,"34175":4,"3419":4,"342":[4,11],"34213":8,"342134":4,"3422":11,"342474":4,"3429":4,"343":4,"3438":4,"344":4,"34421":17,"3445":11,"344772":4,"3448":4,"345":4,"34537":4,"345842":11,"346":4,"3461":4,"3462":4,"3464":11,"3469":4,"347":4,"3471":4,"347169":4,"347405":4,"347623":4,"348":[4,7],"3483":11,"34870":4,"349":4,"3495":4,"3497":4,"34e":7,"35":[4,7,11],"350":[4,11],"3502":4,"35051":4,"3507":4,"3509":11,"351":4,"351532":4,"3518":4,"352":4,"3529":4,"353":4,"3533":11,"353432":4,"3536":4,"354":4,"3540":17,"354576":4,"35487":4,"354981":4,"355":4,"3550":11,"35505":4,"355513":4,"3559":4,"356":4,"3563":4,"3568":11,"356812":4,"357":4,"358":4,"3583":4,"3588":11,"3589":4,"35895":4,"359":4,"3591":4,"359784":4,"359881":4,"3599":4,"36":[4,7,11,14],"360":4,"360093":4,"36016":4,"361":4,"3616":4,"362":4,"3622":11,"362601":4,"36298":4,"363":4,"3630":17,"3631":17,"36314":4,"3632":17,"36323":4,"3633":17,"3634":17,"3635":17,"364":4,"3640":11,"364017":4,"36403":4,"364747":4,"3649":4,"365":4,"3657":11,"365763":4,"365949":4,"366":4,"366259":4,"366392":4,"367":4,"367065497322e":14,"367268":4,"3674":4,"36747":4,"3676":11,"367793":4,"368":4,"368345":4,"3688":4,"369":4,"3695":4,"36957":4,"3698":4,"36e":11,"37":[4,7,11],"370":4,"3702e":17,"3706":11,"371":4,"371427":4,"371458":4,"371625":4,"3719":4,"372":4,"3726":[4,11],"3729":4,"373":4,"373282":4,"374":4,"37409":4,"3746":11,"374905":4,"375":4,"3752":4,"375537":4,"3757":4,"375712":4,"3758":4,"376":4,"376059":4,"3763":11,"376604":4,"3767":4,"377":4,"3771":4,"378":4,"3781":4,"3786":11,"37874":4,"379":4,"379292":4,"37e":11,"38":[0,4,7,11],"380":4,"38009":4,"380393":4,"380887":4,"381":4,"3811":11,"382":4,"382144":4,"382472":4,"383":4,"38316":4,"3832":11,"384":4,"3849":11,"385":4,"386":4,"387":4,"3875":11,"38788e":14,"388":4,"388321":4,"389":4,"38908":4,"389208":4,"38921":4,"389749":4,"38m":11,"39":[4,5,6,7,9,10,11,12,13,14,15,16],"390":4,"3905":11,"391":4,"3914":17,"39152e":4,"391798":4,"392":[4,17],"39205":14,"392194":4,"392487":4,"3927":17,"3928":[4,17],"3929":17,"393":4,"3930":[11,17],"3931":[11,17],"3932":17,"393886":4,"394":4,"394722435913e":14,"395":4,"39521":4,"3954":11,"3957":4,"3959":4,"396":4,"396133472739e":14,"396288708628e":14,"3963":4,"396675941641e":14,"3967":4,"397":4,"3971":4,"39754":14,"3977":11,"397754":4,"3978":4,"398":4,"39831":4,"39834":4,"398381":4,"398419":4,"398927":4,"399":4,"3995":4,"3999999999996":13,"3d":[0,6],"3e":17,"3m":11,"3mb":[7,11],"3s":[7,11],"4":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,17,19],"40":[4,7,11,12,13],"400":4,"4000":[0,11],"40049":4,"401":4,"4011":4,"401263":4,"4013":4,"401728":4,"4018":4,"402":4,"40238":4,"402750e":17,"402961":4,"403":4,"40339":4,"404":4,"4046":4,"404641347602e":14,"4048":4,"404962":4,"405":4,"405068":4,"405577":4,"406":[4,11],"407":4,"40735":4,"4076":4,"408":4,"409":4,"4098":4,"40e":11,"41":[4,11],"410":[4,17],"4101":4,"4102":4,"4108":4,"410828":4,"411":4,"411151":4,"412":4,"41238":4,"413":[4,5],"413467":4,"414":4,"41457":4,"4146":4,"41485":4,"414875":4,"415":4,"416":4,"416141":5,"4162":4,"417":4,"41726":4,"4176":4,"418":4,"418029":4,"4182":4,"4183":4,"4184":4,"4186":4,"41862":4,"418757":4,"4188":4,"419":4,"4192":4,"4197":4,"41996":4,"41e":11,"42":[0,4,7,11],"420":4,"420182":4,"4202":4,"420316":4,"4205":4,"42052":4,"42097":4,"421":4,"421365":4,"421436":4,"421475":4,"4218":4,"4219":4,"422":4,"422436":4,"42266":4,"4229":4,"423":4,"42362":4,"424":[4,5],"4243":4,"424712":4,"424924":4,"425":4,"4251":4,"4256":4,"425788":4,"426":4,"427":4,"427601421985e":14,"42785":4,"428":4,"428699":4,"429":[4,11],"429122":4,"429398":4,"42e":11,"42msun":[0,6],"43":[4,11],"430":4,"4304":4,"430936289925951":14,"431":4,"4311":4,"431313":4,"431680e":17,"43173":4,"432":4,"4321":4,"432729":4,"433":[4,14],"4330":4,"433207":11,"4333":4,"433477":4,"434":4,"43422e":14,"435":4,"4357":4,"435809":4,"436":4,"43618":4,"4365":4,"4369":4,"437":[4,11,14],"43711":14,"4379":4,"438":4,"4380":4,"4385":4,"438686":4,"4387":4,"438861":4,"439":4,"4397":14,"44":[4,11],"440":4,"441":4,"441158":4,"44170":4,"442":4,"44211":4,"4422":4,"44223e":4,"443":4,"4433":4,"4438":4,"444":[4,17],"444217227690e":14,"445":4,"4454":4,"4455":4,"44558":4,"445821":4,"446":4,"447":4,"447918":4,"448":4,"448242":4,"448401":4,"44852":4,"449":[4,11],"4493":4,"44e":11,"44msun":[0,6],"45":[4,5,7,11,14],"450":4,"4500":6,"45000000080":14,"4501":4,"4504":14,"450629":4,"4507":4,"450818":4,"450828476487e":14,"4509":4,"451":[4,7],"45114":4,"451192744924e":14,"451732":4,"452":4,"453":4,"4530":[8,10,17],"453059":11,"453317880232e":14,"453348":4,"453412":4,"453932":4,"454":4,"4540":4,"454013":4,"45407":14,"454268":4,"454409":4,"455":4,"45534":4,"455552":4,"456":11,"456313":4,"456519":4,"457":4,"45757":4,"457987":4,"458":4,"458064":4,"458272":17,"4588":4,"45889":4,"459":4,"459382":4,"45msun":[0,6],"46":[4,7,11,14],"460":4,"460081":4,"46057":4,"46089":4,"462":[4,17],"4621":14,"4622":4,"46220":4,"4623":4,"462779538274e":14,"463":4,"463455":4,"464":4,"464494":4,"465":4,"465133":4,"46573":14,"465867":4,"46607":4,"4666":4,"4670":4,"4673":4,"467851":4,"468":4,"4680":7,"46822":4,"4683":4,"469":4,"46901":4,"469056":4,"469524":4,"47":[4,7,11],"470":4,"471":4,"4710":4,"471379":4,"4714":4,"472":[13,17],"472105":4,"472318":4,"4734":4,"473762":4,"474":4,"47419":4,"475":4,"4752":4,"475287":4,"47534":4,"4755":4,"4759":4,"476":4,"4764":4,"476589":4,"477":4,"477089":4,"4773":4,"47745":14,"477535":4,"477791":4,"478":4,"478253":4,"478315":4,"4788":4,"478807":4,"479":4,"47946":4,"4797":4,"479973":4,"48":[4,11],"480":4,"480045":4,"48046":4,"4807":4,"4809":4,"481":4,"482":4,"4822":4,"4825":4,"482668":4,"483":4,"48336":4,"4838":[6,8,10],"484":4,"4845":4,"485":4,"48586":4,"486":4,"4862":4,"4865":4,"4867":4,"4872":4,"48749":4,"4877":4,"488":4,"48809":4,"489":4,"489077":4,"48926":4,"48e":[7,11],"49":[4,5,11],"490":4,"491":4,"491811":4,"492":4,"492242":4,"492302":4,"492484":4,"492707":4,"492818":4,"493":4,"493648":4,"493975":4,"494":4,"4945":4,"4949":4,"495":4,"4957":4,"4959":4,"495924":4,"496":4,"4961":4,"496312":4,"4966016":13,"497":4,"497008":4,"497294":4,"498":4,"4981":4,"498232":4,"499":4,"49e":11,"4b8c7f4a86e445099d73f27dffaad94b":13,"4e":[0,6,17],"4e3":[0,6],"4m":11,"4mb":[7,11],"4s":[7,11],"5":[0,1,4,5,6,7,8,9,10,11,12,13,14,15,17],"50":[0,4,6,7,11,13],"500":[0,4,6],"500000e":17,"501":4,"5017":4,"502":4,"502451":4,"502775":4,"502841":4,"503":4,"503726":4,"504":4,"5043":4,"5046":4,"505":4,"5051":4,"50537":4,"506":4,"5064":4,"50652":4,"5066257":13,"50682":4,"50687":4,"507":4,"507104":4,"507443":4,"508":[4,14],"5089":4,"509":4,"5094":4,"50973":4,"50e":11,"50fb66cc659c46c8bbc29fe0c8651c2f":14,"51":[4,7,11],"510":4,"511":4,"511114":4,"5112":4,"5114":4,"5117":4,"512":4,"512561":4,"512617":4,"512mb":21,"513":4,"514":4,"514087":4,"51478":4,"514898":4,"514916":4,"515":11,"515062":4,"5164":4,"517":4,"51742":4,"517454":4,"5175":4,"518":4,"51803":8,"51809":4,"51819":4,"518397":4,"518757914":12,"518851":4,"519":4,"51e":11,"52":[4,5,7,11],"52058":4,"5208":4,"520903":4,"5217":4,"522":4,"5221":4,"523":4,"523485":4,"523561":4,"524":4,"52414":14,"52415":14,"5244":4,"524629":17,"524755":4,"525":4,"526":4,"527":4,"528":4,"528102":4,"5286":4,"529":4,"5294":14,"52e":11,"53":[4,5,7,11],"530":4,"5301":4,"5309":4,"531":4,"531293":4,"531411":4,"5317":4,"532":4,"5324":4,"533":4,"5333":4,"534":4,"534699":4,"535":4,"5358":4,"536":4,"5366":4,"53715":4,"5374":4,"537743":4,"538":4,"53854":4,"539":4,"539343":4,"539941":4,"53e":11,"54":[4,11],"54027":4,"5403":4,"541":4,"541792":4,"542":4,"5423":4,"542419":4,"543":4,"54307":4,"54371":4,"544":4,"54439":4,"544482":4,"545":4,"5456":4,"545743":4,"546":4,"5462":4,"547002":4,"547729":4,"548":4,"5483":14,"548589":4,"548740826516e":14,"548864":4,"549":4,"5493":4,"54949":4,"55":[4,5,7,11,13,14],"550575":4,"551":[4,5],"551072":4,"552":4,"552711":4,"5528":4,"553":4,"5532":4,"554":4,"55458":8,"55473":4,"555":[4,7],"5556":4,"5557":4,"557":4,"558":4,"559":4,"5593":4,"55982":4,"559889":4,"55e":11,"56":[4,7,11,14],"560118":4,"5603":4,"561":4,"5612":4,"5619":4,"562":4,"562029":17,"56228":4,"564":4,"565":4,"56518":4,"5652":4,"566":[4,17],"566263":4,"56631":4,"566495":4,"567":4,"567303":4,"567898":4,"568":4,"5681":4,"56865":4,"569":4,"569581":4,"5696":4,"56e":11,"57":[4,5,7,11],"570":4,"570222":4,"5703":4,"57062":4,"57093":4,"571":4,"5712":4,"57141":4,"5717":14,"572":4,"573":4,"5734":4,"5735":4,"573703":4,"5738":4,"573874":4,"574":4,"57443":8,"574826":4,"575":4,"57538":4,"57571":14,"576":4,"577":4,"57739":4,"5775":4,"577826":4,"578":4,"57878":4,"579":4,"579099761269e":14,"5791":4,"5794":4,"5795":4,"5796":4,"5798":4,"58":[4,11],"581":4,"5812":4,"581558":4,"58166":4,"582":4,"582318":4,"583":4,"58332":4,"583346":4,"5834":0,"583436":4,"584622":4,"585":4,"58504":4,"58518":14,"585985":4,"586":4,"587":[4,13],"588":4,"588396":4,"5885":4,"589":4,"58e":7,"59":[4,5,11],"590":4,"5904":4,"590877":4,"591":4,"5919":4,"592":4,"592309":4,"592733":4,"593":4,"594":4,"59429":4,"59452":8,"595":4,"596":[4,11],"59616":4,"596161":4,"597":4,"5977":4,"598":4,"5982":4,"59867":4,"59e":11,"5dex":[7,11,12,13],"5e":11,"5m":11,"5mb":[7,11],"5msun":[0,6],"5s":11,"6":[0,1,4,5,6,7,8,9,10,11,12,13,14,17,23,26],"60":[4,11,14],"600":4,"6000":[0,6],"600000":0,"60007":14,"600258":4,"600593":4,"6008":4,"601":4,"60101":4,"602":4,"603":[4,11],"6032":4,"604":4,"60468":4,"605":4,"60547":4,"6058":4,"606":[4,11],"606169":4,"60636":4,"607":11,"608":[4,11],"608269":4,"608402":17,"608485":4,"608655":4,"60876":4,"609":4,"6094":4,"61":[4,11],"610184":4,"610285":4,"611":[4,11],"61117":4,"611632":4,"611763":4,"611785":4,"612":[4,11],"612281":4,"613":[4,11],"613167":4,"614":[4,11],"6145":4,"615":4,"615165":4,"61521":4,"616":[4,11],"6161":4,"616737":4,"61679":4,"617":[4,11],"617224":4,"6179":4,"618":4,"6181":4,"6182":4,"618382":4,"618445":4,"6185":4,"618705":4,"619":[4,11],"619099":4,"61e":11,"62":[0,4,11],"620":11,"621":13,"6212":4,"62124":17,"621375":4,"6215":4,"62172":10,"622":4,"62200":4,"622081":4,"622494":4,"6225":4,"623":11,"623052":4,"623232":4,"623354":4,"62366":4,"624":[4,11],"624125":4,"6249793":14,"625":[0,4],"62549":4,"626":[4,11],"627748":17,"628":[4,11],"628169":4,"629":[4,11],"63":[4,7,11],"630":11,"631":[4,7],"63153":4,"632":[4,11],"6328":4,"633":4,"633148":4,"633684":4,"634":[4,11],"634261":4,"6344":4,"634667":17,"635":[0,6,11],"63566e":4,"635703":4,"636":11,"636985":4,"637":[4,11],"637666":4,"637754":4,"6379":4,"638":[4,11],"63818":4,"6384":4,"6388":4,"639":[4,11,17],"63923":4,"639951":4,"63e":11,"64":[4,11],"640":[4,11],"6409":4,"641":11,"6413":4,"64137":4,"642":11,"64207":4,"64265":4,"6429":4,"643":11,"64359":4,"6438124832773024":11,"644":[4,11],"644553":10,"64463":4,"645":[4,10,11,17],"645286":4,"645339":4,"645763":4,"646":4,"64611":4,"646273":4,"647":4,"647161":4,"64724":4,"6474":4,"6475":4,"648":4,"648549":4,"6485656144116352":11,"648566":11,"6489":4,"6492":4,"6493":4,"64932":4,"649327":4,"64e":11,"65":[4,11],"651":4,"6514":4,"6515":4,"65262":4,"652638":11,"652755":4,"653":[4,14],"6548":4,"6550":4,"6552":4,"655371":4,"6556":4,"6559":4,"656":4,"6562":4,"657":4,"6571":4,"6579":4,"658":4,"6588":4,"659":4,"659393":4,"659448":4,"659469":4,"659526":4,"659581":4,"659743":4,"65976":4,"65e":11,"66":[4,11],"66003":14,"66016":4,"66025":4,"6602514":11,"6604":4,"660415":4,"661":4,"661725":4,"662":4,"6626":4,"663":4,"663251":4,"663976":4,"664":4,"664546":4,"6649":4,"665406":4,"66554":4,"665969":4,"666661":4,"667":4,"6674":4,"668":4,"668328":4,"669":4,"66915":4,"669442":4,"66e":11,"67":[4,11],"670":4,"67023":4,"670337":4,"670413":4,"670422":4,"67059":4,"671":4,"671001":4,"671551":4,"67179":4,"672":4,"67245":4,"673":4,"674":4,"674063083432e":14,"6745":4,"674645":4,"6747":4,"6749":4,"675":4,"675689":4,"6758":4,"67586e":14,"676":4,"676181":4,"676215":4,"6764":4,"6765":4,"677":4,"6771":4,"677623":4,"678":4,"679":[4,7],"679223":4,"6797":4,"67e":11,"68":[4,7,11],"681":4,"681473":4,"681487":4,"6816":4,"682":[4,7],"6822":4,"683":4,"6831":4,"6832":4,"6834":4,"683467":4,"68376":4,"684":[4,7,14],"684890":11,"685":[7,11],"685255":4,"685872":4,"686":4,"686591":4,"687":[4,7],"68746":4,"68748":14,"688":[4,7],"6883":4,"6885":4,"689":4,"689781":4,"689835":4,"68e":11,"69":[4,11],"690":11,"690194":11,"690203":4,"6905":4,"690746":4,"6908":4,"6909":4,"691":[4,7],"691586":4,"692":4,"693":[4,7],"693128":4,"693321":4,"6934":4,"693944":4,"694":[4,7,11],"6944":0,"694517":11,"695":[4,14],"6952":4,"695505":4,"69569":4,"696":4,"696003":17,"696284":4,"697":4,"6975":4,"697827":4,"698":[4,11],"69808":4,"698517":4,"6989":4,"699":4,"6e":[7,11],"6e5":[0,6],"6m":11,"6mb":[7,11],"6msun":[0,6],"6s":[7,11],"7":[0,1,4,5,6,7,8,10,11,12,13,14,16,17,23,26],"70":[4,7,11,14],"700":[4,17],"70005":4,"700359":4,"70043":4,"70052":4,"70054":4,"701":4,"702":4,"70235":4,"7028":4,"703":4,"703545":4,"70365":4,"704":4,"70429":4,"7046":4,"705":[4,17],"7052":4,"705715":4,"706":4,"7060":4,"706029":4,"706126":4,"706483":4,"706780":11,"7069":4,"706984":4,"707":[4,11],"708":4,"7085":4,"7087":17,"709":4,"7093":4,"709965":4,"70e":11,"71":[4,11],"710":4,"71025":14,"7106":17,"7107":4,"7108":4,"711":4,"7114":4,"71196":14,"712":4,"712414":4,"7128":14,"713946":4,"714712":4,"716":[4,10],"71617":10,"71662":8,"71746":4,"71818":4,"7184":4,"718549":4,"7188":4,"719058":4,"71e":11,"72":[4,11],"720749":4,"721":4,"7210":4,"7214":4,"7219":4,"722":4,"72386":4,"724":[4,8],"72498e":[8,14],"725":4,"725718":4,"726":17,"726002":4,"72611":4,"72617":4,"7267":4,"7269":4,"727":4,"727196":4,"72764":4,"728":[4,7],"7282":4,"728237":4,"72832e":4,"728797":4,"729":4,"729193":4,"7292":4,"7296":4,"72983":4,"72e":11,"73":[4,11,14],"730":4,"731":4,"7315":4,"7319":4,"732":4,"7322":4,"732244":7,"7324":4,"7326":4,"732818":4,"732953":4,"732983":4,"7335":4,"734":4,"7342":4,"734534":4,"735":4,"7354":4,"7359":4,"736":[4,7],"736112":4,"7365":4,"737":4,"7370":4,"737411":4,"738":4,"7380":4,"7381":4,"738399":4,"7384":4,"7385":4,"738524":4,"7386":4,"739":4,"7390":4,"739962":4,"73e":11,"74":[4,11],"740":4,"740494":4,"740929":4,"7413":4,"741346":4,"741448":4,"7418":4,"7419":4,"742":4,"7420":4,"7421":4,"7422":4,"7423":4,"7424":4,"7425":4,"7426":4,"7427":4,"7428":4,"7429":4,"743":4,"7430":4,"7431":4,"743118":4,"7432":4,"7433":4,"7434":4,"7435":4,"7436":4,"7437":4,"7438":4,"743837":4,"7439":4,"744":4,"7440":4,"7446":4,"7447":4,"7448":4,"7449":4,"745":4,"7450":4,"7451":4,"7452":4,"7453":4,"7454":4,"7455":4,"7456":4,"7457":4,"7458":4,"74583":4,"7459":4,"746":4,"7460":4,"7461":4,"7462":4,"747":4,"7472":4,"748":[4,17],"748832":4,"749":4,"75":[0,4,7,11],"750":[4,5],"7500":4,"75005":4,"750149":4,"750806":4,"7509":17,"751305":4,"752":4,"752134":4,"752438":4,"7527":4,"753":4,"7530":4,"7536":4,"7537":4,"754":4,"754141":4,"7544":4,"755":4,"75508":4,"755323":4,"7554":4,"7557":4,"756":4,"7561":14,"7564":4,"7566":4,"756795":4,"757":[4,7],"757025":4,"7572":4,"758":[4,17],"7582":4,"7589":4,"759":4,"75921":4,"75931":4,"7595":4,"7598":4,"75e":11,"76":[4,11],"760064":4,"760389":4,"7605":4,"7607":4,"761":4,"7612":4,"7613":4,"76134":4,"761478":4,"7617":4,"7619":0,"7620":4,"7622":4,"7626":4,"7629":4,"763":4,"7631":4,"7633":4,"7635":4,"764":4,"76416e":4,"7644":4,"7645":4,"764629":4,"7647":4,"7647737053496777":14,"764989":4,"765":4,"7650":4,"7657":4,"7659":4,"766":4,"766094":4,"7666":4,"7669":4,"767":4,"7671":4,"7675":4,"7677":4,"7678":4,"7679":4,"768":4,"7683":4,"768339":4,"7684":4,"768655":4,"7689":4,"769":4,"7690":4,"7691":4,"769195":4,"7695":17,"76e":7,"77":[4,11,13],"7705":4,"770532":4,"7706":4,"7709":4,"7714":4,"7717":4,"7718":4,"772":4,"7720":4,"7721":4,"772169325355e":14,"7722":4,"7727":4,"7728":4,"77287":14,"773":4,"7730":4,"7731":4,"773166":4,"7734":4,"7735":4,"7736":4,"7737":4,"774":4,"7741":4,"77416":4,"7742":4,"7743":4,"7745":4,"77455":4,"7748":4,"774954":4,"774969":4,"775":[4,17],"7750":4,"77505":4,"7751":4,"7752":4,"77541":4,"7757":4,"7759":4,"776":[4,17],"7761":4,"77624":4,"776263":4,"77631":4,"7764":4,"7765":4,"776523":4,"7766":4,"7767":4,"776818":4,"7769":4,"777":4,"7772":4,"7773":[4,17],"7774":4,"77766":4,"7779":4,"778":4,"7781":4,"7782":4,"7785":4,"7789":4,"779":4,"7790":4,"779197348711e":14,"7792":4,"7795":4,"7797":4,"78":[4,11],"78012":4,"7803":4,"7806":4,"7809":14,"781":4,"781046":4,"78125":0,"7813":4,"7817":4,"7819":4,"782":4,"7823":4,"7825":4,"7826":4,"7827":4,"7828":4,"783":[4,10],"7831":4,"7836":4,"783746":4,"783792":4,"784":4,"7840":4,"7842":4,"7843":4,"7844":4,"7845":4,"7848":4,"78488":4,"784972":4,"785":4,"7852":4,"785539":4,"7856":4,"7858":4,"786":4,"786062":4,"7861":4,"7863":4,"7864":4,"7868":4,"786e":17,"787":4,"7871":4,"787102":4,"787368":4,"7874":4,"7875":4,"7877":4,"787705":4,"7879":4,"788":4,"78817":17,"7882":4,"7883":4,"7886":4,"7887":4,"789":4,"789064":4,"7891":4,"789188":4,"7893":4,"7898":4,"789859":4,"7899":4,"78e":11,"79":[4,11],"7901":4,"7902":4,"7903":4,"7905":4,"7907":4,"7909":4,"79092":14,"790941":4,"791":4,"7911":4,"7912":4,"791274":4,"7913":4,"791478":4,"7916":4,"7918":4,"7919":4,"791991":4,"792":4,"7920":4,"7925":4,"7926":4,"79264":4,"7927":4,"792721":4,"792744":4,"7928":4,"7933":4,"7934":4,"7936":4,"793832":4,"7941":4,"79412":4,"7942":4,"7943":4,"7944":4,"79487":14,"795":4,"795024":4,"7958":4,"796":4,"7960":4,"7962":4,"7964":4,"796455":17,"7965":4,"7967":4,"7968":4,"7969":4,"797":4,"7973":4,"7974":4,"7975":4,"7979":4,"798":4,"7980":4,"7982":4,"7988":4,"799":4,"7990":4,"79911":4,"7996":4,"7997":4,"799889":4,"79e":11,"7a2e4301f5224b2cb8939d2297df0aad":13,"7e":11,"7m":11,"7mb":11,"7s":7,"8":[0,4,5,6,7,8,10,11,12,13,14,17],"80":[4,11],"800":5,"8000":4,"8001":4,"8003":4,"8004":4,"8008":4,"8009":4,"801":4,"8010":4,"8012":4,"8013":4,"802":4,"802706":5,"802986496151e":14,"803":4,"8031":4,"8034":4,"8039":4,"804":4,"80402":4,"8043":4,"8044":4,"8047":4,"8048":4,"804961":4,"805":4,"8050":4,"8053":4,"8055":4,"805733":4,"8058":4,"8059":4,"80592":14,"806":4,"8060":4,"80602":17,"8062":4,"806431":4,"8065":4,"8066":4,"8067":4,"806722":4,"807":4,"8071":4,"8073":4,"807331":4,"807361":4,"8074":4,"807403":4,"8076":4,"8079":4,"808":4,"808134":4,"809":[4,5],"8091":4,"8095":4,"80954":4,"809662":4,"80e":11,"81":[4,7,11],"810":7,"8101":4,"8104":4,"8105":4,"81066":14,"8107":4,"8108":4,"8109":4,"811":4,"8111":4,"8115":4,"812":4,"8121":4,"8123":4,"8124797":5,"813":4,"81352":4,"8138":4,"81395":8,"814":4,"8140":4,"8141":4,"814387":4,"81495":14,"81499":14,"815":4,"8151":4,"81529":14,"81536":14,"8155":4,"81562":4,"81563":14,"8158":4,"816":4,"8163":4,"81636":14,"81689":14,"816958":4,"817":[4,10],"81705":4,"817432":4,"817620e":17,"81762e":17,"817843":4,"817888":4,"818":4,"8182":4,"818294":4,"819":4,"8194":4,"8195":4,"81957":14,"8196":4,"819715":4,"8199":4,"81e":11,"82":[4,11],"8200":4,"8202":4,"8205":4,"82061":14,"82064":4,"82074":14,"82088":14,"821":4,"82123":14,"821301":4,"821367":4,"8216":14,"822":4,"82224":4,"8224":4,"82245":4,"82255":14,"823":4,"823059079115e":14,"82325":4,"8234":4,"823767":4,"824494":4,"8245":4,"8247":4,"824848":4,"82486":4,"8249":4,"825":4,"8250":4,"825086":4,"8251":4,"8252":4,"8254":4,"82563":11,"825648":4,"826":4,"8261":4,"8263":4,"82642":4,"826771":4,"8268":4,"826831":4,"827":4,"8271":4,"8276":4,"82797":4,"828":4,"8280":4,"828241":4,"828858":4,"829":4,"829017":4,"8292":4,"8293":4,"8295":4,"829668":4,"829726":4,"829757":4,"8299":4,"82e":11,"83":[4,7,11],"830":[4,17],"8300":4,"8303":4,"830541":4,"831236":4,"832":4,"832981":4,"833":4,"8339":4,"834303":4,"834483":4,"835":4,"8354":4,"836":[4,5],"836621":4,"83672":4,"836783":4,"837":4,"8372":4,"83762":4,"8377":4,"837816":4,"8379":4,"838":[4,5],"838411":5,"838423":4,"83843":4,"839":4,"8399":4,"83e":11,"84":[4,7,11],"840":4,"84029":4,"84071":4,"840796":4,"840994":4,"841":4,"841284":4,"841718":4,"8427e":17,"8429":4,"843":4,"8435":4,"8435e":17,"844":[4,5],"8441":4,"84428":4,"8443":4,"845":4,"84502":4,"8452":4,"845387":4,"845641":4,"846":[4,5],"846045":5,"847":4,"847153":4,"84827":4,"848380621869e":8,"848866":4,"8493":4,"85":[4,7,11],"850":4,"850309":4,"851":4,"851646":4,"852":4,"852252":4,"8523":4,"852712":4,"853":4,"8533":4,"854":4,"85406e":4,"8544":4,"8545":4,"854649":4,"855":4,"856":[4,11],"85661":17,"8569":4,"857":4,"8573":4,"857699":4,"8577":4,"858":[4,5],"8585":4,"859":4,"8596":4,"859753":4,"8598":4,"859977":4,"86":[4,7,11],"860402":4,"8605":4,"861":4,"861368":4,"863":[4,7],"86323":4,"86334":4,"8635":4,"8638":4,"865":4,"8653":4,"8654":4,"865806":4,"866":4,"8664":4,"867":4,"86728":4,"8674":4,"8678":4,"86794":4,"868":4,"8683":4,"86878":4,"869":4,"86918":4,"8694":4,"869544":4,"87":[4,11,14],"870":4,"8704":4,"8706":4,"8708":4,"871":4,"872":[4,14],"872312":4,"872316":4,"873":4,"8731":4,"873639":4,"874":4,"874638":4,"875":4,"876":4,"876084":4,"876382":4,"877":4,"877963":4,"878":4,"87813":4,"878253":4,"879":4,"8791":4,"87e":11,"88":[4,11],"880":4,"8805":4,"880528":4,"881":4,"8813":4,"882017":4,"8828":4,"883":4,"883252":4,"88343":4,"8837":4,"884":4,"8840":4,"8843":4,"88441":4,"884461":4,"8846":4,"8848":4,"885":4,"8851":4,"8853":4,"8855":4,"885537":4,"8856":4,"8858":4,"88581":4,"886":4,"8860":4,"8862":[4,14],"8864":4,"8866":4,"8867":4,"8868":4,"8869":4,"887":4,"8870":4,"8871":4,"8872":4,"8873":4,"8874":4,"8875":4,"8876":4,"8877":4,"8878":4,"888":4,"8880":4,"8881":4,"888123":4,"8882":4,"8884":4,"8886":4,"888613":4,"8887":4,"8889":4,"889":4,"8891":4,"8892":4,"8893":4,"8894":4,"8896":4,"8897":4,"8898":4,"8899":4,"89":[4,5,11,13],"890":4,"8901":4,"8902":4,"8903":4,"8904":4,"8906":4,"8907":4,"8908":4,"8909":4,"891":4,"8910":4,"891056":4,"8911":4,"8912":4,"8917":4,"892":4,"89211":17,"8924":4,"8926":4,"893":4,"8934":4,"8935":4,"8939":4,"893941":4,"894":4,"894041":4,"8941":4,"8949":4,"895":4,"895821":4,"896":4,"8961":4,"896110e":17,"896196":4,"896286":4,"8972":4,"8975":4,"897612":4,"898":4,"8982":4,"898786":4,"899":4,"8992":4,"899464":4,"8a7d52edc59346ce991063d9e05e9ba7":5,"8bc1eafea1c34b05894c1618639d8c37":14,"8e":[0,6],"8m":[7,11],"8mb":11,"8s":[7,11],"9":[0,4,5,6,7,8,10,11,13,14,17],"90":[4,7,11],"900":4,"901":4,"901988":4,"902":4,"903":4,"9032":4,"9036":4,"9038":4,"904":4,"9043":4,"9046":4,"9047":4,"905":4,"905335716621e":14,"9057":4,"906":4,"906059":4,"906299":4,"90695":4,"907":4,"9071":4,"90716":4,"9073":4,"9074":4,"908":4,"9087":4,"909":4,"9093":4,"9098":4,"90e":11,"91":[4,7,11],"910419":4,"9105":4,"910817":4,"910981":4,"911":4,"9110":4,"911093":4,"9113":4,"912":4,"912238":4,"912283":4,"912289":4,"912327":4,"9127":4,"912919":4,"913":4,"9139":4,"914":4,"9147":4,"9148":4,"915":[4,7],"915148":4,"915221":4,"9153":4,"91548":4,"916":4,"916093":4,"916207":4,"917":4,"917439":4,"9179":4,"918":4,"918543":4,"9189":4,"919":4,"9196":4,"91e":11,"92":[4,11],"920":4,"9203":4,"9206":4,"920832":4,"921":4,"9214":4,"922":4,"922199":4,"923":4,"92382":4,"924":4,"924056":17,"925":4,"9253":4,"9255":4,"9256":4,"925761":4,"926":4,"9263":4,"9264":4,"927":4,"929":4,"929511":4,"92995":4,"92e":11,"93":[4,11,14],"930":[4,13],"930282":4,"9304":4,"93044":4,"9308":4,"9309":4,"930943":4,"931":4,"9310":4,"932":4,"9323":4,"932839":4,"933":4,"9339":4,"934":4,"9342":4,"935":4,"935069":4,"9351":4,"9357":4,"935816":4,"935920339886e":14,"936":4,"936532":4,"936762":4,"937":4,"9373e":17,"938":4,"938568":4,"938576":4,"93898":4,"939":4,"939376":4,"939378":4,"939757":4,"93e":11,"94":[4,5,7,11,18],"941":[4,7],"9411":4,"941478":4,"942":4,"942154":4,"9423":4,"9427":4,"942854":4,"943":4,"9436":14,"944":4,"9445":4,"94464":4,"945":4,"9452":4,"946":4,"946468":4,"946757":4,"947":4,"9471":4,"947719":4,"947774":4,"94797":4,"948":4,"949":4,"95":[4,11,13],"950":4,"9505":4,"950733":4,"951":4,"951344":4,"951597":4,"952":4,"9524":4,"952496":4,"953":4,"953182":4,"9537":4,"953738":4,"953798":4,"954":4,"954624":4,"9548":4,"954848":4,"955":4,"9557":4,"956":4,"9561":4,"956619":4,"957":4,"9573":4,"95783":4,"957894":4,"958":4,"959":4,"959422":4,"959492":4,"9595":4,"9598":4,"95e":7,"96":[4,5,7,11],"960":4,"9603":4,"9606":4,"960734":4,"961":4,"9610":4,"96112":4,"96161":4,"962":4,"962482":4,"962876":4,"963":[4,7],"963621764679e":14,"964":4,"9648":4,"965":4,"9650":4,"965167":4,"96557e":4,"966":4,"966681":4,"967":4,"968":4,"969":4,"96963":4,"96e":11,"97":[4,11],"970":4,"97008":14,"970206":4,"970505":4,"970783":4,"971":4,"971686":4,"971941":4,"972":4,"9725":4,"973":[4,11],"973135":4,"97316":4,"9739":4,"9739752":7,"974":4,"9743":4,"9749":4,"975":4,"9757":4,"9758":4,"975864":4,"976":4,"976041":4,"977":4,"9779":4,"97797":4,"978":4,"979":4,"97923e":14,"9794":4,"9797":4,"97e":[7,11],"98":[4,11,13],"98061":4,"98081":4,"98096":4,"981":4,"981292":4,"9814":4,"981555":4,"9816":4,"982":4,"9825":4,"983":4,"983229":4,"984":[4,13],"9841":4,"9842":4,"985":4,"9851":4,"985359":4,"9859":4,"986":[4,7],"9869":4,"987":4,"988":4,"988755":4,"989":4,"98e":11,"99":[4,11,13],"990":4,"9900":4,"9902":4,"991":4,"9912":4,"991224":4,"991657":7,"99191":8,"99192":8,"99194":8,"992":4,"99203":4,"9927":[4,10],"993":4,"994":4,"994118":4,"995":4,"995631":13,"995687":4,"995824":4,"996":[4,7],"996798":4,"997":4,"9977":4,"997751":4,"998":4,"998023":4,"99808":4,"9983":10,"998563":4,"999":4,"999122":4,"9999999999999998":13,"99e":11,"9e":7,"9m":11,"9mb":[7,11],"9s":[7,11],"abstract":27,"boolean":[0,6,18,19,21,25,30],"break":[0,6],"case":[0,3,6,14,18,21,23],"catch":[5,7,10,11,12,13,14,17,18,21],"char":21,"class":[18,19],"const":[5,7,11,12,13,14],"default":[0,1,5,6,8,9,11,12,13,14,17,18,19,21,27],"do":[0,1,4,5,6,7,8,11,12,13,14,17,19,21,23,25,26,30],"export":[14,18,19],"final":[4,7,11,12,13,17],"float":[0,4,6,9,10,15,18,30],"function":[0,1,3,4,5,7,8,16,19,21,23,24,25,26,27,30],"import":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],"int":[0,1,4,6,11,14,18,19,21,30],"krtickov\u00e1":[0,6],"kub\u00e1t":[0,6],"long":[0,5,6,7,14,21,29],"new":[0,5,6,7,10,11,12,13,14,19],"null":[0,5,6,7,14,18],"paczy\u0144ski":[0,6],"public":[11,12,13,14,23],"return":[1,4,5,6,7,9,10,11,12,13,14,17,18,19,21,25,27,30],"short":[0,5,6,7,11,12,13,29],"super":[0,6],"switch":[0,6],"throw":[23,26],"true":[0,4,5,6,7,9,11,12,13,14,16,17,18,19,21,25],"try":[0,4,6,7,10,11,12,13,14,23,26],"void":8,"while":[0,4,5,6,7,11],A:[0,3,6,14,30],And:[23,26,30],As:[0,5,6,7,10,11,12,13,14],At:[5,14],But:10,By:[0,5,6,11,12,13,14,17,21],For:[0,6,8,10,11,12,13,25],If:[0,5,6,7,11,12,13,14,19,21,23,25,26,27,30],In:[0,5,6,7,8,9,10,11,12,13,14,17,21],It:[0,5,6,7,10,11,12,13,14,15,17,21,23,26],Its:21,NO:21,NOT:[0,6,27],No:[4,6,21,23,26],Not:[5,7],OR:17,On:[0,6,14,18],One:[0,6,21],Or:[14,17],Such:7,That:[0,5,6],The:[0,1,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,21,23,25,26,27],Then:[5,18,23,26],There:[5,6,7,8,9,10,11,12,13,14,15,17,19,21,25],These:[5,6,11,12,13,14,18,21,25],To:[0,6,10,11,12,13,14,21,23,26],Will:[0,6,18,21,27],_1:[11,12,13],_:[5,7,11,12,13,21],__:14,__arg_begin:6,__attribute__:8,__enter__:18,__exit__:18,_actually_evolve_system:21,_analyt:19,_binary_c_bind:[6,8,10,15,30],_binary_c_config_execut:21,_binary_c_dir:21,_binary_c_execut:21,_binary_c_shared_librari:21,_cach:19,_commandline_input:21,_count:21,_custom_logging_shared_library_fil:21,_dataio:19,_distribution_funct:19,_end_time_evolut:21,_errors_exceed:21,_errors_found:21,_evolution_type_opt:21,_failed_count:21,_failed_prob:21,_failed_systems_error_cod:21,_generate_grid_cod:21,_grid_log:19,_grid_options_default:19,_grid_vari:[12,13,21],_gridcod:19,_hpc:19,_kill:21,_loaded_moe2017_data:21,_main_pid:21,_metadata:19,_moe2017_json_data:21,_moe_di_stefano_2017:19,_population_id:21,_pre_run_setup:19,_probtot:21,_process_run_population_grid:21,_queue_don:21,_repeat:21,_set:19,_set_moe2017_grid:21,_spacing_funct:19,_start_time_evolut:21,_store_memaddr:21,_system_gener:21,_total_mass_run:21,_total_probability_weighted_mass_run:21,_total_starcount:21,_version_info:19,_zero_prob_stars_skip:21,a173:[0,6],a3146490:0,a_in:4,a_out:4,abat:[0,6],abbrevi:29,abl:6,about:[3,5,7,11,12,13,14,18,19,21,30],abov:[0,5,6,8,10,12,13,14,18,19],abridg:[6,8],absolut:[0,6,18],abund:[0,6],ac:[5,14],acceler:[0,6],accept:[14,18],access:[8,10,11,12,13,14,21],accord:[0,5,6],accordingli:[10,12,13,14],account:[0,6,21],accret:[0,4,6],accretion_limit_dynamical_multipli:[0,6],accretion_limit_eddington_lmms_multipli:[0,6],accretion_limit_eddington_steady_multipli:[0,6],accretion_limit_eddington_wd_to_remnant_multipli:[0,6],accretion_limit_thermal_multipli:[0,6],accretor:[0,4,6,30],accur:[11,12,13],acquir:4,act:[0,6,12,13,14,21],activ:[0,6,21],actual:[0,5,6,7,8,10,11,12,13,14,19,21,23,25,26],ad:[3,5,7,10],adam:[0,6],adapt:[0,6,12,13],add:[0,5,6,7,8,10,11,12,13,14,19,21,25],add_grid_vari:[5,7,11,12,13,14],addit:0,address:[1,6,8,21,30],admittedli:25,adress:[6,8,30],advis:8,af:4,affect:[0,5,6],after:[0,5,6,7,8,11,12,13,14,19,21],ag89:[0,6],ag:[0,3,4,5,6,7,13,23],again:[5,9,10,18,21],against:25,agb:[0,5,6],agb_3dup_algorithm:[0,6],agb_core_algorithm:[0,6],agb_core_algorithm_default:0,agb_core_algorithm_hurlei:0,agb_core_algorithm_karaka:0,agb_luminosity_algorithm:[0,6],agb_luminosity_algorithm_default:0,agb_luminosity_algorithm_hurlei:0,agb_luminosity_algorithm_karaka:0,agb_radius_algorithm:[0,6],agb_radius_algorithm_default:0,agb_radius_algorithm_hurlei:0,agb_radius_algorithm_karaka:0,agb_third_dredge_up_algorithm_default:0,agb_third_dredge_up_algorithm_hurlei:0,agb_third_dredge_up_algorithm_karaka:0,agb_third_dredge_up_algorithm_stancliff:0,ago:5,al:[0,6,30],albedo:[0,6],algorithm:[6,23],algothim:[0,6],all:[0,1,5,6,7,9,10,11,12,13,14,16,17,18,19,21,23,24,25,26,27],all_info:19,alloc:6,allow:[0,6,8,16,17,21],almost:21,along:[0,21,23,26],alpha:[0,4,6],alpha_:7,alpha_c:[0,4,5,6,7],alpha_ej:4,alphacb:[0,6],alreadi:[5,14,15],also:[0,3,4,5,6,7,8,11,12,13,14,17,18,19,21,23,26,30],alter:[7,11],altern:[0,6,21],although:15,alwai:[0,6,21],amanda:[0,6],amount:[0,6],amp:[5,6,7],an:[0,5,6,7,9,10,11,12,13,14,17,18,21,23,27],analys:27,analyt:[5,7,11,12,13,14,19],analyz:10,andrew:[23,26],andronov:[0,6],angelou_lithium_cheb_decay_tim:[0,6],angelou_lithium_cheb_massfrac:[0,6],angelou_lithium_cheb_tim:[0,6],angelou_lithium_decay_funct:[0,6],angelou_lithium_decay_tim:[0,6],angelou_lithium_eagb_decay_tim:[0,6],angelou_lithium_eagb_massfrac:[0,6],angelou_lithium_eagb_tim:[0,6],angelou_lithium_gb_decay_tim:[0,6],angelou_lithium_gb_massfrac:[0,6],angelou_lithium_gb_tim:[0,6],angelou_lithium_hg_decay_tim:[0,6],angelou_lithium_hg_massfrac:[0,6],angelou_lithium_hg_tim:[0,6],angelou_lithium_lmms_decay_tim:[0,6],angelou_lithium_lmms_massfrac:[0,6],angelou_lithium_lmms_tim:[0,6],angelou_lithium_ms_decay_tim:[0,6],angelou_lithium_ms_massfrac:[0,6],angelou_lithium_ms_tim:[0,6],angelou_lithium_tpagb_decay_tim:[0,6],angelou_lithium_tpagb_massfrac:[0,6],angelou_lithium_tpagb_tim:[0,6],angelou_lithium_vrot_trigg:[0,6],angelou_lithium_vrotfrac_trigg:[0,6],angular:[0,6,15,25],ani:[0,6,10,14,18,19,23,26],anoth:[0,6],ansi:[0,6,18],ansi_colour:[0,6],anyth:[0,6,11,12,13,14,18,21],anywai:[10,14],api:[0,3,18,23],api_log_filename_prefix:[0,4,6,10,15],appear:21,append:[1,5,10,11,12,13,15],appli:[0,6],apply_darwin_radau_correct:[0,6],appropri:[0,6,14,21],approxim:[0,5,6,7],ar:[0,1,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,21,23,25,26,30],arang:17,aren:21,arg:[4,6,14,18],arg_dict:18,argh:15,argopt:[0,6],argpair:9,argstr:[6,8,10,15,17],argument:[0,6,10,12,14,15,16,17,18,19,21,27],argument_of_periastron:[0,6],argument_of_periastron_quadrupl:[0,6],argument_of_periastron_tripl:[0,6],aritif:7,around:[0,6,8,10,16,17],arrai:[10,14,17,18,21],arrow:[0,6],artefact:[12,13],artifici:[0,6],artificial_accretion_end_tim:[0,6],artificial_accretion_ignor:0,artificial_accretion_start_tim:[0,6],artificial_angular_momentum_accretion_r:[0,6],artificial_mass_accretion_r:[0,6],artificial_mass_accretion_rate_by_stellar_typ:[0,6],artificial_orbital_angular_momentum_accretion_r:[0,6],arxiv:[0,6],ask:[0,6,30],asplund:[0,6],assign:[11,12,13,14],associ:[5,7,11,12,13],assum:[0,5,6,7,11,15,25],ast871:[0,6],astronomi:[0,6],astrophys:[7,12,13],astropi:[23,25,26],asymptot:5,attempt:19,au:15,auto:[1,24],autogen_c_logging_cod:[1,8,17],autogener:17,automat:[0,1,6,8,14,16,17,21,23,26],avaibl:[23,26],avail:[0,6,7,8,11,12,13,14,18,21,23,26],avoid:[5,6,7],awai:[0,6,11],ax:17,axessubplot:16,axi:[0,6,25],b6213f2eb7f94d3196cf966b7b76b9f9:13,b:21,b_1:[0,6],b_2:[0,6],b_3:[0,6],b_4:[0,6],b_inclination1:[0,6],b_inclination2:[0,6],b_inclination3:[0,6],b_inclination4:[0,6],back:[0,4,6],background:17,backward:[0,6],bagb:[0,6],bar:[12,13],barn:[0,6],base:[0,6,7,11,12,13,14,18,19,23,25,26,30],base_filenam:[14,19],bash:21,basic:14,batch:21,batchmod:[0,6],batchnam:21,bb:[0,6],bbox_inch:17,beasor:[0,6],becaus:[0,5,6,7,10,11,12,13,15,17,19,21,23,26],becom:[0,1,4,6,8,12,13,15,18,21],been:[0,6,9,19,21],befor:[0,4,5,6,7,11,12,13,14,19,21,23,26],beg_bss:4,beg_rch:4,beg_symb:4,begin:5,behaviour:[5,11,12,13,14,27],behind:17,belczynski:[0,6],below:[0,3,5,6,7,8,11,12,13,14,21],berro:[0,6],bertolami:[0,6],best:[4,19,21],beta:[0,6],beta_reverse_nova:[0,6],beta_reverse_novae_geometri:0,better:[0,3,6,14,30],between:[0,6,21],bewar:14,beyond:15,bh:[0,4,7],bh_belczynski:[0,4,6],bh_bh:4,bh_fryer12_delai:[0,6],bh_fryer12_rapid:[0,4,6],bh_fryer12_startrack:[0,6],bh_hurley2002:[0,6],bh_prescript:[0,4,6],bh_spera2015:[0,6],bhbh:4,big:[0,6,21],biinari:14,bin:[0,6,7,11,12,13,18,21,23,26],bin_data:[7,11,12,13,18],binari:[3,6,7,10,12,13,14,21,23,25,26,30],binary_c2:[23,26],binary_c:[1,3,5,7,11,12,13,15,18,19,21,25,27],binary_c_api_funct:8,binary_c_cal:14,binary_c_default:14,binary_c_grid:[5,7,11,14],binary_c_grid_25014bc73b334765a1c09a4e4a97ed66:11,binary_c_grid_26171201413c43f5b91552a374879940:5,binary_c_grid_2b66f805db424c48a1d29c45092b6e3c:7,binary_c_grid_50fb66cc659c46c8bbc29fe0c8651c2f:14,binary_c_grid_8a7d52edc59346ce991063d9e05e9ba7:5,binary_c_grid_f4e5925effeb42e69b5be956f400ae41:5,binary_c_inline_config:1,binary_c_log_cod:[1,8,10,16,17],binary_c_macro:[0,6],binary_c_paramet:[0,5,11,12,13,14],binary_c_python:[5,6,7,10,11,12,13,14,18],binary_c_python_api:17,binary_c_task_:[0,6],binary_c_write_log_cod:1,binary_grid:[0,6],binary_star:30,binaryc:[1,18,27],binaryc_config:1,binarycpython:[1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,25,26,27,30],binarygrid:[11,12,13,14],bind:[0,6,8,10,15],binned_log_luminos:[11,12,13],binned_post_period:7,binned_pre_period:7,binwidth:[7,11,12,13,18],birth:[0,6],bit:[5,11],bivari:[0,6],black:[0,3,5,6,23],black_hol:0,block:14,bloecker:[0,6],blog:1,boltzman:25,boltzmann:[0,6],bondi:[0,6],bondi_hoyle_accretion_factor:[0,6],bool:[14,18,19,25],born:[0,5,6,11,12,13],bosswissam:18,both:[0,6,11,12,13,14],bottom:[0,6,14],bottomcod:[5,7,14],bound:4,brake:[0,6],branch:[0,5,6,18],branch_david:0,branchcod:[5,7,14],branchpoint:[5,7,14],breakup:[0,6],brighten:[12,13],broken:[0,6],bse:[0,6,8,14],bse_opt:[5,7,10,11,12,13,14,19],bsf:[0,6],buffer:[0,6],build:[0,1,3,6,18],built:[0,1,9,18,23,26],burn:[0,6],busso:[0,6],bye:[0,6],c13_eff:[0,6],c:[0,1,4,6,8,10,14,27],c_auto_log:21,c_log:0,c_logging_cod:[5,7,8,10,11,12,13,14,21],cach:[19,21],cache_dir:21,cachetool:21,calc_period_from_sep:30,calc_sep_from_period:[7,11,14,30],calcul:[0,5,6,7,11,12,13,14,18,21,30],call:[0,1,6,10,12,13,14,15,18,19,21,25,27],call_binary_c_config:18,calls_filenam:14,can:[0,1,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,21,23,25,26,27,30],candid:7,cannot:[5,8],canon:21,cap:[0,6],capit:[11,12,13],capsul:[1,6,18],captur:[0,6,18],carbon:[0,4,5,6],carbon_oxygen_white_dwarf:0,care:[5,11,12,13,21],carlo:[0,6,21],carrasco:[0,6],carri:[0,6],carriag:[18,21],cast:[17,18],catchtim:18,categor:6,categori:[6,14],categoris:18,caught:[10,18],caus:[4,11,30],cbdisc:[0,6],cbdisc_albedo:[0,6],cbdisc_alpha:[0,6],cbdisc_eccentricity_pumping_dermin:0,cbdisc_eccentricity_pumping_method:[0,6],cbdisc_eccentricity_pumping_non:0,cbdisc_end_evolution_after_disc:[0,6],cbdisc_fail_ring_inside_separ:[0,6],cbdisc_gamma:[0,6],cbdisc_init_djdm:[0,6],cbdisc_init_dm:[0,6],cbdisc_inner_edge_strip:[0,6],cbdisc_inner_edge_stripping_timescal:[0,6],cbdisc_kappa:[0,6],cbdisc_mass_loss_constant_r:[0,6],cbdisc_mass_loss_fuv_multipli:[0,6],cbdisc_mass_loss_inner_l2_cross_multipli:[0,6],cbdisc_mass_loss_inner_viscous_accretion_method:[0,6],cbdisc_mass_loss_inner_viscous_accretion_method_equ:0,cbdisc_mass_loss_inner_viscous_accretion_method_gerosa_2015:0,cbdisc_mass_loss_inner_viscous_accretion_method_non:0,cbdisc_mass_loss_inner_viscous_accretion_method_young_clarke_2015:0,cbdisc_mass_loss_inner_viscous_angular_momentum_multipli:[0,6],cbdisc_mass_loss_inner_viscous_multipli:[0,6],cbdisc_mass_loss_ism_pressur:[0,6],cbdisc_mass_loss_ism_ram_pressure_multipli:[0,6],cbdisc_mass_loss_xray_multipli:[0,6],cbdisc_max_lifetim:[0,6],cbdisc_minimum_evaporation_timescal:[0,6],cbdisc_minimum_fr:[0,6],cbdisc_minimum_luminos:[0,6],cbdisc_minimum_mass:[0,6],cbdisc_no_wind_if_cbdisc:[0,6],cbdisc_outer_edge_strip:[0,6],cbdisc_outer_edge_stripping_timescal:[0,6],cbdisc_resonance_damp:[0,6],cbdisc_resonance_multipli:[0,6],cbdisc_torquef:[0,6],cbdisc_viscous_l2_coupl:[0,6],cbdisc_viscous_photoevaporative_coupl:[0,6],cbdisc_viscous_photoevaporative_coupling_inst:[0,6],cbdisc_viscous_photoevaporative_coupling_non:[0,6],cbdisc_viscous_photoevaporative_coupling_visc:[0,6],ce:[0,6,7],cee:[0,6,7],cell:[6,11,12,13,14],cemp:[0,6],cemp_cfe_minimum:[0,6],centr:[7,14],central:15,central_object:[0,6],centralis:27,certain:[21,23,26],certainli:21,cf:[0,6],cf_amanda_log:[0,6],cflag:[23,26],challeng:[12,13],chandrasekhar:[0,6],chandrasekhar_mass:[0,6],chang:[0,1,4,5,6,7,8,11,12,13,14,17,18,19,21,23,26],chapter:[0,21,24],charact:[18,21],cheb:[0,6],check:[0,5,6,7,11,12,13,14,17,18,19,21,27,30],check_if_in_shel:18,chemic:[0,6],chen:[0,6],child:18,choic:[0,6,25],choos:[0,5,6,7,8,11,17,25],chose:10,chosen:[11,12,13,14],ci:15,circular:[0,4,6],circumbinari:[0,6],circumstanti:[0,6],claei:[0,6],clark:[0,6],clean:[1,5,10,12,13,19],clean_up_custom_logging_fil:19,clear:[12,13],clearli:[12,13],clock:18,close:[0,4,6,7,12,13,15],closer:4,cloud:[0,6],clusterid:21,co2:[12,13],co:[0,4,6],coalesc:4,code:[0,1,5,6,7,8,10,11,12,13,14,16,17,19,23,25,26,27,30],collaps:[0,6],collapsar:[0,6],collect:30,collid:30,color:[18,25],color_by_index:25,colour:[0,6],colour_log:[0,6],column:[5,7,10,14,15,17,25],column_nam:10,com:[1,18],combin:[1,8,18,19,21],combine_ensemble_with_thread_join:21,come:[23,26],comenv:[4,7],comenv_bs:0,comenv_count:7,comenv_disc_angmom_fract:[0,6],comenv_disc_mass_fract:[0,6],comenv_ejection_spin_method:[0,6],comenv_ejection_spin_method_do_noth:[0,6],comenv_ejection_spin_method_sychron:[0,6],comenv_ejection_spin_method_synchron:0,comenv_merger_spin_method:[0,6],comenv_merger_spin_method_breakup:0,comenv_merger_spin_method_conserve_angmom:[0,6],comenv_merger_spin_method_conserve_omega:[0,6],comenv_merger_spin_method_specif:[0,6],comenv_ms_accret:[0,6],comenv_ms_accretion_fract:[0,6],comenv_ms_accretion_mass:[0,6],comenv_nandez2016:0,comenv_nelemans_tout:0,comenv_ns_accret:[0,6],comenv_ns_accretion_fract:[0,6],comenv_ns_accretion_mass:[0,6],comenv_post_eccentr:[0,6],comenv_prescript:[0,6],comenv_splitmass:[0,6],comenv_undef:0,command:[0,1,6,14,19,21,23,26],command_lin:21,commandlin:14,comment:14,common:[0,3,4,5,6,8,10,11,12,13,14,23],compact:[7,14],companion:[0,4,6,17],compar:[0,6,7,11,14,21],compens:[12,13],compil:[1,8,14,17,23,26],compile_shared_lib:1,complet:[5,7,11,12,13,14],complex:[7,8,14,16,17,21],compon:[18,25],comput:[0,5,6,11,12,13],conceptu:11,concurr:21,condit:[5,7,8,11,12,13,14,16,17],condor:21,condor_bash:21,condor_batchnam:21,condor_clusterid:21,condor_d:21,condor_dir:21,condor_env:21,condor_extra_set:21,condor_getenv:21,condor_initial_dir:21,condor_kill_sig:21,condor_memori:21,condor_njob:21,condor_postpone_join:21,condor_postpone_submit:21,condor_process:21,condor_pwd:21,condor_q:21,condor_requir:21,condor_should_transfer_fil:21,condor_snapshot_on_kil:21,condor_stream_error:21,condor_stream_output:21,condor_submit:21,condor_univers:21,condor_warn_max_memori:21,condor_when_to_transfer_output:21,config:[1,18,21,23,26],config_fil:1,configur:[5,10,11,12,13,14,17,21],conjunct:9,conserv:[0,6],consid:[0,1,6,11,12,13,19,21,25],constant:[0,6,12,13,25],construct:[0,1,5,6,7,10,11,12,13,15,17,21],contact:4,contain:[0,1,6,9,10,11,12,13,14,18,19,21,23,24,25,26,27,29],content:[6,18,19],context:18,continu:14,contribut:[23,26],control:[0,5,6,11,12,13,14,21],conv_time_unit:18,convect:[0,6],conveni:18,converg:[0,6],convert:[5,7,15,18,19],convert_byt:18,convfloat:18,convfrac:4,cool:[0,5,6],copi:[0,6,7,12,13,21,30],core:[0,5,6,7,11,12,13,14,21,25],core_co:8,core_h:8,core_helium_burn:0,core_mass:[0,6,8],correct:[0,6,10,19,25,30],correctli:[10,17,23,26],correspond:[14,25],corretor:[0,6],cost:[11,12,13],could:[0,6,12,13,14,17,18],count:[4,5,17,18,21],counter:21,coupl:[0,3,6],cours:[5,25],cover:[9,11,12,13],coverag:[23,26],cowd:[0,6],cpu:[0,5,6,7,11,12,13,14,21],cpython:6,crap_paramet:[0,6],creat:[5,7,8,10,11,12,13,14,18,19],create_and_load_logging_funct:[1,8,17],create_arg_str:18,create_hdf5:18,creation:6,critic:[0,6],cross:[0,6],crunch:[5,7,11,12,13],cs1:15,ctype:1,cube:11,cubic:11,cuntz:[0,6],current:[0,6,7,8,11,12,13,18,23,26],curv:[7,12,13],custom:[0,1,3,5,6,7,10,11,12,13,14,18,19,21,23,25,27],custom_gener:21,custom_log:[10,17,19,21],custom_logging_cod:[1,8,10,16,17,27],custom_logging_func_memaddr:[6,8,21],custom_logging_funct:[8,10,14,16,17,21,23,24],custom_logging_info:19,custom_logging_memaddr:8,custom_logging_print_stat:10,custom_logging_stat:[5,7,11,12,13,14],custom_opt:[5,10,11,12,13,14,19],custom_output_funct:8,custom_tmp_dir:1,customis:25,cut:17,cvode:[0,6],d48r:17,d:[0,1,4,5,6,7,8,10,11,14,15,18],d_:18,dai:[0,4,6,7,8,10,11,14,17,30],damp:[0,6],darwin:[0,6],dat:[0,14,18],data:[0,4,5,6,7,10,11,12,13,14,15,17,18,21,27,30],data_dir:[14,18,19,21],datadir:14,datafram:[5,7,10,11,12,13,15,16,17,25],dataio:19,datalinedict:[5,7,11,12,13,18],dataset:[14,21],date:[18,19,21],david:[0,17,23,26],david_logging_funct:0,dd7:[0,6],de:[0,4,6],deactiv:[0,6],deal:10,dear:4,death:[0,6],debug:[0,4,5,6,7,11,12,13,14,21],dec:0,decai:[0,6],decid:[0,6,8,16,17,18,19,21],decreas:[0,6],deepcopi:7,deeper:14,def:[4,5,7,10,11,12,13,14,17],default_to_metal:[0,6],defaultdict:18,defer:[0,6],defin:[0,1,6,14,15,19,25],definit:[1,11,12,13,30],degener:[0,6],degenerate_core_helium_merger_ignit:[0,6],degenerate_core_merger_dredgeup_fract:[0,6],degenerate_core_merger_nucsyn:[0,6],degner:[0,6],degre:[0,6],del:7,delai:[0,6,21],delta:18,delta_mcmin:[0,6],demonstr:7,den:[0,6],densiti:[11,12,13],depend:[0,5,6,18,21,23,25,26],deprec:[0,6,19],dermin:[0,6],describ:[0,6,17,21],descript:[0,6,9,18,21,23,24],design:25,desir:[0,6],destruct:14,detail:[0,5,6,10,18,21],detect:[0,4,6,7,15],detector:4,determin:[0,6,8,11,12,13,14,19,30],deton:[0,6],dev:[0,6],develop:1,development_requir:[23,26],dewi:[0,6],dex:[0,6,7],df2:17,df:[15,16,17,25],di:[14,23],diagnost:21,diagram:[0,3,6,23,25],dict:[1,4,5,10,11,12,13,14,15,18,19,21,29],dict_kei:[5,9,10],dictionari:[1,3,5,7,11,12,13,14,18,19,21,25,29],did:[18,23,26],differ:[0,5,6,7,11,12,13,14,17,18,21,23,25,26],differenti:18,dimmer:[0,6,11],dir:[23,26],direct:[0,6,19],directli:[10,21],director:21,directori:[0,3,6,14,18,19,21,23,26],disabl:[0,6,14],disable_debug:[0,6],disable_end_log:[0,6],disable_ev:[0,6],disc:[0,6,15],disc_legacy_log:[0,6],disc_log2d:[0,6],disc_log:[0,6],disc_log_directori:[0,6],disc_log_dt:[0,6],disc_log_level_non:0,disc_log_level_norm:0,disc_log_level_normal_first_disc_onli:0,disc_log_level_subtimestep:0,disc_log_level_subtimestep_first_disc_onli:0,disc_n_monte_carlo_guess:[0,6],disc_stripping_timescale_infinit:0,disc_stripping_timescale_inst:0,disc_stripping_timescale_orbit:0,disc_stripping_timescale_visc:0,disc_timestep_factor:[0,6],discret:14,discs_circumbinary_from_comenv:[0,6],discs_circumbinary_from_wind:[0,6],disk:[0,6,19],dispers:[0,6],displai:[0,5,6,7,15],disrupt:[0,4,6,17],dist:18,distanc:[5,15],distant:15,distefano2017:21,distribut:[0,3,6,7,11,14,18],distribution_funct:[5,7,11,12,13,14,19,23,24],dj:[0,6],dlnm1:[7,11,14],dlnm:[12,13],dlnm_1:[12,13],dlog10per:[7,11,14],dm1:[5,12,13],dm:[0,4,6,12,13],dm_1:[5,12,13],dn:18,do_analyt:21,do_dry_run:21,doc:[5,11,12,13,14,18,23,26],docstr:[10,23,25,26],document:[11,12,13,14,21,24],doe:[0,5,6,8,9,10,11,12,13,14,19,21,30],doesn:[5,21],doesnt:17,don:[5,18,21],done:[0,4,5,6,11,12,13,14,17,21,23,26],donor:[0,4,6,30],donor_limit_dynamical_multipli:[0,6],donor_limit_envelope_multipli:[0,6],donor_limit_thermal_multipli:[0,6],donor_rate_algorithm_bs:0,donor_rate_algorithm_claeys2014:0,dont:[6,17],doubl:[5,8,14],down:14,dphasevol:[5,7,11,12,13,14],dprob:[5,7,12,13],dq:[7,11,14],dr2:[0,6],dr3:[0,6],drai:[0,6],dredg:[0,6],drop:10,dry:[5,7,11,13,14,21],dry_run:[5,7,11,14],dry_run_hook:21,dry_run_num_cor:21,dt:[0,1,6,18],dt_limit:9,dtfac:[0,6],dtm:[1,8,14],dtype:[15,16,17],due:[23,26],dummi:[21,25],dump:[0,6,10,19],dumpvers:[0,6],dure:[0,4,6,17],dust:[0,6],dwarf:[0,5,6,12,13],dx:[0,6],dynam:[0,6],e2:[0,6],e2_hurley_2002:0,e2_izzard:0,e2_mint:0,e2_prescript:[0,6],e:[0,4,5,6,7,8,10,11,12,13,14,18,19,21,23,26,30],each:[0,6,7,11,12,13,14,15,18,21],eagb:[0,4,6],eagb_wind_beasor_etal_2020:0,eagb_wind_bs:0,eagb_wind_goldman_etal_2017:0,eagbwind:[0,6],eagbwindfac:[0,6],earli:[0,6],early_asymptotic_giant_branch:0,earth:15,easi:10,easier:[14,17,18],ebindi:4,ecc:[4,10,14,17],eccentr:[0,6,8,10,11,12,13,14,15,17,25,30],eccentric_rlof_model:[0,6],eccentricity_quadrupl:[0,6],eccentricity_tripl:[0,6],echo:[0,6],eddington:[0,6],edg:[0,5,6,14],edit:8,edu:[0,6],eej:4,eff:5,effect:[0,4,6,8,11,21],effective_metal:[0,6,17],effici:[0,5,6,7],egg:[23,26],eggleton:[0,6,30],either:[0,6,11,12,13,14,17,19,21,23,26,27],eject:[0,6,7,15],el:[10,14],elabor:8,eld:[0,6],eldridg:[0,6],electon:[0,6],electron:[0,6],element:[0,1,6,9,15,21,25],els:[4,7,21],emp:[0,6],emp_feh_maximum:[0,6],emp_logg_maximum:[0,6],emp_minimum_ag:[0,6],empti:10,enabl:[0,6],encount:21,end:[0,4,6,18,21],end_bss:4,end_rch:4,end_symb:4,end_timestamp:[5,7,11,13,14],energi:[0,6],enhanc:[0,6],enlarg:[0,6],ensembl:[0,6,9,21],ensemble_def:[0,6],ensemble_dt:[0,6],ensemble_factor_in_probability_weighted_mass:21,ensemble_filt:9,ensemble_filter_:[0,6],ensemble_filters_off:[0,6],ensemble_legacy_ensembl:[0,6],ensemble_list:19,ensemble_logdt:[0,6],ensemble_logtim:[0,6],ensemble_macro:[0,6],ensemble_output_:21,ensemble_startlogtim:[0,6],ensure_ascii:19,enter:[0,6,21],enthalpi:[0,6],entir:[8,10,16,17],entri:[18,19],env:[21,25],envelop:[0,3,4,5,6,23],environ:21,eorbf:4,eorbi:4,ep:17,equal:[0,6,12,13,14,18],equat:[0,6],equation_of_state_algorithm:[0,6],equation_of_state_paczynski:0,equatori:[0,6],equival:[11,21],errno:[23,26],error:[0,5,6,7,11,12,13,14,18,21,23,26],errors_exceed:[5,7,11,13,14],errors_found:[5,7,11,13,14],escap:[0,6],escape_fract:[0,6],escape_veloc:[0,6],estim:[5,15,18,21],et:[0,6,30],eta:[0,6,7,11],etal:[0,6],etc:[0,6,10,12,13,14,18,19,21,23,25,26,27],etf:[7,11],euler:[0,6],evalu:[14,30],evan:[0,6],evapor:[0,6],evaporate_escaped_orbiting_object:[0,6],even:[9,12,13],event:[0,4,5,6],everi:[0,6,7,18,21,23,26],everyth:[10,14,19,21],everytim:[23,26],evid:[0,6],evolut:[0,1,3,4,5,6,10,11,12,13,14,17,21,23,25],evolution_split:[0,6],evolution_splitting_maxdepth:[0,6],evolution_splitting_sn_eccentricity_threshold:[0,6],evolution_splitting_sn_n:[0,6],evolution_stop:7,evolution_typ:[5,7,11,13,14,21],evolutionari:[0,6,10],evolv:[0,3,6,8,19,21],evolve_popul:14,evolve_singl:[8,10,19],exact:[1,21],exactli:[0,6,12,13],exampl:[1,10,18,27],example_compact_object:14,example_dco:14,example_df:10,example_head:18,example_header_1:17,example_header_2:17,example_log:27,example_log_co:[1,8],example_logging_string_co:8,example_logging_string_post_m:8,example_massloss:[8,10],example_output:10,example_parse_output:[16,18],example_pop:[10,14],example_pop_set:14,example_post_m:8,example_python_population_result:14,example_sn:8,exc_tb:18,exc_typ:18,exc_val:18,exce:[0,6,11],except:[4,5,6,11,12,13,14,21,25],excess:21,excit:7,execut:[0,6,14,21],exist:[0,5,6,14,17,21],exist_ok:[14,18],exit:[0,6,18,19,21],exit_after_dry_run:21,exit_cod:21,exp:[7,11,12,13,14],expand:14,expect:[5,6,7,11,12,13,21,23,26],experiment:[0,6,18],explain:3,explicitli:[0,1,6],explod:[0,4,6],explor:15,explos:[0,4,5,6,17],expoenti:[0,6],expon:[0,6,18],export_all_info:[14,19],express:[0,6,18],extend:[0,6,7,23,26],extens:6,extern:[0,6],extra:[0,3,6,14,21,23,27],extract:14,extrapol:21,f4e5925effeb42e69b5be956f400ae41:5,f:[0,4,6,10,14,17],fabian:[0,6],fabian_imf_log:[0,6],fabian_imf_log_tim:[0,6],fabian_imf_log_timestep:[0,6],factor:[0,6,21],fade:[0,6],fail:[0,5,6,7,11,18,21,23,26],fail_sil:18,failed_count:[5,7,11,13,14],failed_prob:[5,7,11,13,14],failed_system:21,failed_system_log:21,failed_systems_error_cod:[5,7,11,13,14],failed_systems_threshold:21,failsaf:10,failur:[0,6,18],fallback:[0,6],fals:[0,4,5,6,7,11,13,14,15,18,19,21,25],fancy_parsing_funct:27,far:[0,4,5,6,12,13,15],farmer:0,fase:14,fast:[0,6],faster:[11,12,13,14],favorit:10,fe:[0,6],featur:[3,14,23],feed:21,ferguson:[0,6],fetch:10,few:[0,6,7],fewer:10,field:[0,6],fifocach:21,fig:[0,6,17],figsiz:[5,7,11,12,13,15,17],figur:[5,7,11,12,13,15,25],file:[0,1,4,6,10,14,18,19,21,23,25,26,27],file_log:[0,6],filenam:[0,1,4,6,10,14,18,19,21,27],filenotfounderror:[23,26],filepath:1,fill:[10,18],filter:[0,6,18],filter_arg_dict:18,filter_valu:18,fin:[0,6],final_mass:17,final_tim:17,find:[4,7,14,18,21],finish:[5,7,11,13,14,18,25],finit:[5,7,11,12,13],first:[0,5,6,7,10,11,12,13,14,15,18,23,26,30],first_giant_branch:0,fishlock:[0,6],fit:[0,6,10,30],fix:[0,4,6,10,14,18,19,25],flag:[0,1,19,21],flash:[0,6],flat:21,flatsect:[7,11,14],flaw:19,float64:[16,17],float_overflow_check:[0,6],flto:[23,26],flush:19,fo:21,focu:7,follow:[0,6,8,17,18,21,23,25,26],font_scal:[5,7,11,12,13,15],fontsiz:17,forc:[0,4,6,21],force_circularization_on_rlof:[0,6],force_corotation_of_primary_and_orbit:[0,6],foreach_star:[5,11],form:[0,5,6,7,11,12,13,14,19],formal:[0,6],format:[0,4,6,7,8,10,11,12,13,14,15,17,18,21],format_numb:18,former:4,formula:[0,6],forward:[0,6],found:[4,5,7,11,13,14],four:[0,6],fourth:15,fraction:[0,6,11,17,21],fractions_z0002:17,fractions_z001:17,fractions_z002:17,framework:6,free:[5,7,11],free_persistent_data_memaddr_and_return_json_output:6,free_store_memaddr:6,frequenc:[0,6,15],friction:[0,6],fring:[0,6],from:[0,4,5,7,9,10,11,12,13,14,15,16,17,18,19,21,25,30],from_binary_c_config:1,from_dict:[7,11,12,13,16,17],fryer:[0,6],ftz:[23,26],full:[3,8,15,18,21],full_path:18,func_memaddr:17,function_cach:21,function_cache_default_maxs:21,function_cache_default_typ:21,function_cache_funct:21,function_cache_ttl:21,further:14,futur:15,fuv:[0,6],g:[0,1,4,5,6,7,8,10,11,12,13,14,16,17,18,21,23,26],ga:[0,6],gaia:[0,6],gaia_colour_transform_method:[0,6],gaia_conversion_ubvri_bivariate_jordi2010:[0,6],gaia_conversion_ubvri_riello2020:[0,6],gaia_conversion_ubvri_univariate_evans2018:[0,6],gaia_conversion_ubvri_univariate_jordi2010:[0,6],gaia_conversion_ugriz_bivariate_jordi2010:[0,6],gaia_conversion_ugriz_riello2020:[0,6],gaia_conversion_ugriz_univariate_evans2018:[0,6],gaia_conversion_ugriz_univariate_jordi2010:[0,6],gaia_l_binwidth:[0,6],gaia_teff_binwidth:[0,6],galact:[0,6],gallino:[0,6],gamma:[0,6],gap:[0,6],garcia:[0,6],gauss:[0,6],gb:[0,6],gb_reimers_eta:[0,6],gb_wind_beasor_etal_2020:0,gb_wind_goldman_etal_2017:0,gb_wind_reim:0,gb_wind_schroeder_cuntz_2005:0,gbwind:[0,6],gbwindfac:[0,6],gcc:[1,23,26],gce:[0,6],gener:[0,1,5,6,7,8,10,11,13,14,16,17,18,19,21,25],geometr:[0,6],geq:5,gerosa:[0,6],get:[0,3,5,8,10,11,12,13,14,15,17,18,19,23,26,27,30],get_ansi_colour:18,get_arg_kei:18,get_default:[9,18],get_help:[9,18],get_help_al:[9,18,19],get_help_sup:[9,18],get_siz:18,get_usernam:18,gettempdir:17,giant:[0,5,6,15],giant_branch:0,git:[0,11,12,13,14,18],github:18,gitlab:23,give:[0,4,6,7,18,19,30],given:[0,1,6,11,12,13,16,17,18,19,21,27,30],global:[0,6,11,12,13,18],gnu:6,go:[0,5,6,9,11,14,19,23,25,26],goe:[0,6,8,10,25],gogo:[0,6],goldman:[0,6],good:[0,6,10,11,12,13,14,21,30],got:[12,13],gov:[0,6],gravit:[0,5,6,7,14],gravitational_const:5,gravitational_radiation_bs:0,gravitational_radiation_bse_when_no_rlof:0,gravitational_radiation_landau_lifshitz:0,gravitational_radiation_landau_lifshitz_when_no_rlof:0,gravitational_radiation_model:[0,6],gravitational_radiation_modulator_:[0,6],gravitational_radiation_modulator_j:[0,6],gravitational_radiation_non:0,grb:[0,6],great:[0,6,12,13,21],greater:[0,6],grevess:[0,6],grid:[0,3,6,8,10,18,19,23,24,30],grid_class:[23,24],grid_cod:19,grid_log:19,grid_opt:[5,7,10,11,12,13,14,19],grid_options_default:19,grid_options_descript:[5,14],grid_result:[5,7,11,12,13,21],grid_vari:[14,21],grid_variable_numb:[5,7,14],gridcod:19,gridcode_filenam:21,gridtyp:[5,7,14],group:[5,11,15],grvitation:4,gsl:[23,26],gsl_dir:[23,26],gt:[4,5,6,7,8,10,12,14,15,16,17],guess:[0,6],gyr:[4,5,7],h5py:[23,26],h:[0,4,6,8,18],ha:[0,1,4,5,6,7,8,9,11,12,13,14,17,18,21],hachisu:[0,6],hachisu_disk_wind:[0,6],hachisu_ignore_qcrit:0,hachisu_qcrit:[0,6],had:[5,7,11,12,13,19],half:[0,6],hall:[0,6],handi:[0,6],handl:[0,3,6,10,18,19,21,27,30],happen:[0,5,6,7],hardcod:[8,11,12,13,14],have:[0,3,4,5,6,7,8,10,11,12,13,14,17,18,19,21,23,25,26,27],haven:5,hbb:[0,6],hbbtfac:[0,6],hd:25,hdf5:18,hdf5file:18,he:[0,4,6],head:15,header:[1,5,7,8,10,11,12,13,14,17,18],headerlin:14,headlin:21,hegb:[0,4],hehg:0,height:[7,11,14],helium:[0,5,6],helium_flash_mass_loss:[0,6],helium_white_dwarf:0,help:[0,3,4,6,10,11,12,13,14,18],help_al:[0,6],hem:0,henc:[0,6,7,12,13,15],hendrik:[0,17,23,26],here:[1,5,6,8,10,11,12,13,15,17,18,19,21,25,27],hertzsprung:[0,3,6,23],hertzsprung_gap:0,hertzstrpung:[0,6],heuvel:[0,6],hewd:[0,6],hewd_hewd_ignition_mass:[0,6],hex:21,hg:[0,6],high:[0,6,12,13],higher:[0,5,6,7,11,12,13,14,18,21,23,26],histogram:7,hole:[0,3,5,6,23],home:6,homogen:[0,6],hood:10,hook:21,hopefulli:[0,6],hot:[0,6],hour:18,how:[0,4,5,6,7,8,10,11,12,13,14,17,21],howev:[0,6,8,11,12,13,14],hoyl:[0,6],hpc:[19,21],hpc_force_join:21,hpc_function:[23,24],hpc_jobid:19,hpc_rebuild_joinlist:21,hr:25,hr_diagram:25,hrd:[0,5,6,7],hrdiag:[0,6],hrdiag_output:[0,6],htcondor:21,html:[5,14,23,26],http:[0,1,5,6,14,18],human:18,hurlei:[0,6],hut:[0,6],hybrid:[0,6],hydro:[0,6],hydrogen:[0,5,6],i:[1,4,5,6,7,8,10,11,12,13,14,15,18,19,21,23,26,30],ia:[0,6,7],ib:[0,4,6],ibc:[0,6],id:[19,21],id_cor:8,idea:[14,25],idum:[0,6],ignit:[0,5,6],ignor:[0,6,8,10,14,17,21],ii:[0,6,17],iia:[0,6],iloc:[10,17],images:21,imf:[0,6,12,13],immedi:[0,5,6,21],implement:[0,6,21],impli:[0,6],implic:[12,13],impos:[5,7,11,12,13,14],imposs:7,inclin:[0,6],inclination1:[0,6],inclination2:[0,6],inclination3:[0,6],inclination4:[0,6],inclini:[0,6],incliniation_quadrupl:[0,6],incliniation_tripl:[0,6],includ:[0,1,5,6,8,10,12,13,14,15,18,19,23,25,26],include_binary_c_default:[14,19],include_binary_c_help_al:[14,19],include_binary_c_version_info:[14,19],include_default:14,include_popul:14,include_population_set:19,incom:[0,6],increas:[0,4,6,7,11,12,13],inde:[0,6,12,13],indent:[10,19],index:[0,6,9,10,15,21,23],indic:[0,6],individu:[3,11,23],individual_nova:[0,6],induc:[0,6],inertia:[0,6],info:[6,9,14,18,19,23,25,26],inform:[0,1,3,5,8,10,11,12,13,14,18,19,21,25],init:19,init_abund:[0,6],init_abund_dex:[0,6],init_abund_mult:[0,6],init_abunds_onli:[0,6],initi:[0,3,4,6,9,10,17,19],initial_abundance_hash:19,initial_abundance_mix:[0,6],initial_abunds_onli:[0,6],initial_grid:17,initial_mass:[10,17],initial_tim:17,inlin:17,inner:[0,6,15],input:[1,6,9,10,18,19,21,23,25,27,30],insert:14,insid:[0,6],inspect:[10,25],inspir:[1,25,30],instabl:[0,6],instal:[21,30],install_without_depend:[23,26],instanc:[10,11,12,13,14],instant:[0,6],instantli:[0,6],instead:[0,4,6,12,13,18,21],integ:[0,5,6,21,30],integr:[11,12,13],intens:[12,13],interact:[0,4,5,6,7,15,17],interfac:[6,15,18,23,26],interfer:[23,26],intermedi:7,intern:[0,6,9,21],internal_buff:[0,6],internal_buffering_off:0,internal_buffering_print:0,internal_buffering_stor:0,intershel:[0,6],interstellar:[0,6],intger:[0,6],intro:[0,6],introduc:4,introduct:5,inv:[4,17],invers:30,invert_xaxi:5,involv:[0,6],inward:[0,6],ipykernel_216542:15,ipykernel_519112:12,ipynb:[11,12,13,14],is_capsul:18,isfil:14,isfloat:18,isint:18,isn:[12,13,18],isnt:14,isotop:[0,6,9],isotope_hash:19,isotope_list:19,item:[1,5,7,11,12,13],iter:18,its:[0,6,11,12,13,14,15,18,21,23,25,26,27],itself:[5,8,10,21,23,26],iwamoto:[0,6],izzard:[0,5,6,7,10,11,12,13,14,23,26],jager:[0,6],jeff:[23,26],jej:4,jerki:5,jf:4,jia:[0,6],job:[19,21],jobarrayindex:21,jobid:[19,21],john:[0,6],join:[6,8,10,14,17,21],joinlist:21,jorb_in:4,jorb_out:4,jordi:[0,6],json:[6,10,14,19,21],jtot_in:4,jupit:15,jupyt:[23,26],just:[0,5,6,7,14,17,18,19,21,23,26,30],k1:[4,10,17],k2:[4,10,17],k:[0,5,6,15],kap:[0,6],kappa:[0,6],kaps_rentrop:[0,6],karaka:[0,6],keep:[7,14],kei:[1,5,9,10,14,15,17,18,19,21,25],kelvin:[0,6],keplerian:[0,6],keyword:[12,25,27],kick:[0,4,6,17,21],kick_backward:0,kick_forward:0,kick_inward:0,kick_outward:0,kick_random:0,kick_straight_up:0,kick_velocity_custom:0,kick_velocity_fix:0,kick_velocity_maxwellian:0,kill:[1,8,14,19],kilonova:5,kim:[0,6],kind:[0,6],kippenhahn:[0,6],klencki:[0,6],km:[0,6],know:[0,1,6,9,10,12,13,21],known:[0,5,6,10,11,12,13,14,19,27],kroupa2001:14,kroupa:[12,13],krticka:[0,6],kwarg:[17,19,25,27],l1:4,l2:[0,6],l:[0,5,6,11,12,13],l_:[11,12,13],label:[5,17],lambda:[0,4,6,7],lambda_:7,lambda_c:[0,4,6,7],lambda_ce_dewi_tauri:[0,6],lambda_ce_klencki_2020:[0,6],lambda_ce_polytrop:[0,6],lambda_ce_wang_2016:[0,6],lambda_enthalpi:[0,6],lambda_ion:4,lambda_ionis:[0,6],lambda_min:[0,6],lambda_mult:[0,6],lambda_multipli:[0,6],lamer:[0,6],landau:[0,6],langer:[0,6],languag:5,larger:[0,5,6],last:[3,12,15,17,18],last_st:17,last_stellar_type_change_time_1:17,lastli:[6,10],late:17,later:[11,12,13,21],latest0:[5,7,11],latest1:[5,7,11],latest2:[5,14],latest3:5,latest4:5,latest5:5,latest:[23,26],latter:[0,6],launch:21,law:[12,13],lbv:[0,6],ld_library_path:[23,26],ldist:[12,13],lead:[0,5,6,11,12,13,14,30],learn:[8,21],least:[23,26],leav:[0,6,21],left:[0,6],legaci:[0,6],legacy_yield:[0,6],legend:[15,17],len:[4,5,10,14,17],length:[4,18],lengthen:[0,6],leq:5,less:[0,1,3,4,6],let:[4,7,10,11,12,13,14,15,19],level:[1,5,18],lfucach:21,li7:[0,6],li:[0,6],lib:[6,10,16,17,23,26],libbinary_c:21,libcustom_logging_0639ee205c7d4782b4a27378f5d890bd:10,libcustom_logging_dafa15d2b1e64e19972ac0e9eb5c9a55:10,libgsl:[23,26],libmemo:[23,26],librari:[0,1,5,6,8,17,19,21,27],library_path:[23,26],librinterpol:[23,26],life:7,lifetim:[0,6,7,11,12,13,14],lifshitz:[0,6],like:[0,1,5,6,7,11,12,13,14,17,18,21,23,25,26],limit:[0,5,6,7,11,12,13,14,21,25],line:[1,4,5,7,8,10,11,12,13,14,15,16,18,19,21,23,25,26],linear2:21,linear:[0,6,11,12,13,21],linearli:[12,13],linedata:[5,7,11,12,13],lineplot:[5,7,11,12,13,15],linewidth:[5,7,11,12,13,15],linker:1,linux:6,list:[0,1,5,6,7,10,11,12,13,14,15,18,21,27],list_arg:[0,6],lit:[0,6],lithium:[0,6],lithium_gb_post_1dup:[0,6],lithium_gb_post_heflash:[0,6],lithium_hbb_multipli:[0,6],lithium_t:[0,6],littl:[4,5,7,11,15],littleton:[0,6],liu:[0,6],ll:[8,9,12,13,15],llnl:[0,6],lnm1:[7,11,12,13,14],lnm_1:[12,13],load:[0,1,5,6,7,8,10,11,12,13,14,17,18,19,21,25],load_logfil:18,lobe:[0,4,6,7,30],loc:15,local:[6,21],locat:[0,6,21,23,26],lock:4,lodder:[0,6],log10:[0,5,6,7,11,12,13,14],log10m1:21,log10per:[7,11,14],log:[0,1,3,4,6,10,15,16,18,21,23,25,26,27,30],log_:[5,7,11,12,13],log_arg:21,log_args_dir:21,log_arrow:[0,6],log_dt:[7,21],log_every_timestep:[8,10],log_fil:[4,21],log_filenam:[0,4,6,10,17,27],log_newlin:21,log_runtime_system:21,logarithm:[12,13],logensembletim:[0,6],logfil:[10,18,23,26],logg:[0,5,6],logger:14,logging_dict:1,logging_lin:[8,16,17],loggrav:5,logi:16,logic:[1,8,19,21],logl:5,logper:7,logperrang:[7,11],logteff:5,longer:[0,5,6,7],longnam:[5,7,11,12,13,14],look:[1,5,7,11,12,13,14,17,23,26],lookback:[0,6],loon:[0,6],loop:[5,7,10,11,12,13,14],loos:25,lose:[0,6,17],loss:[0,4,6,10,11,15],lost:[0,6,7,17],lot:[5,11,12,13,14,15,21,27],lovegrov:0,low:[0,5,6,7,12,13],low_mass_m:0,low_mass_main_sequ:0,lower:[0,6,11,14],lrucach:21,lsoda:[0,6],lsun:[0,6,25],lt:[5,6,7,10,12,14,15,16],lugaro:[0,6],luminos:[0,3,5,6,23,25],luminosity_1:25,luminosity_2:25,luminosu:5,lw:[0,6],lynnett:[0,6],m01:4,m1:[0,4,6,7,8,10,11,12,13,14,17,30],m2:[4,7,8,10,11,14,17,30],m:[0,4,5,6,7,11,12,13,15,17,18,30],m_1:[0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,27],m_2:[0,4,5,6,7,8,10,11,14,16,17],m_3:[0,6],m_4:[0,6],m_:17,m_max:14,m_min:14,m_sun:5,maccretor:[0,4,6],machin:[7,21,23,26],macro:[0,6,9,18],made:[5,23,26],maeder:[0,6],magellan:[0,6],magnet:[0,6],magnetic_braking_algorithm:[0,6],magnetic_braking_algorithm_andronov_2003:0,magnetic_braking_algorithm_barnes_2010:0,magnetic_braking_algorithm_hurley_2002:0,magnetic_braking_algorithm_rappaport_1983:0,magnetic_braking_factor:[0,6],magnetic_braking_gamma:[0,6],magnitud:18,mai:[0,6,7,11],main:[0,1,5,6,8,11,12,13,14,17,21,23,26],main_sequ:[0,6,11,12,13,17],mainprocess:[5,7,11],major:[0,6],make:[0,1,4,5,6,7,10,11,12,13,14,15,17,18,19,21,23,25,26,27,30],make_build_text:18,makedir:[14,18],manag:[18,23,26],mani:[0,5,6,7,9,11,12,13,14,21],manual:[8,21],manufactur:[0,6],map:21,mar:15,maria:[0,6],mass:[0,1,3,4,5,6,7,9,10,11,14,15,17,18,21,25,27,30],mass_1:[14,17,25],mass_2:[14,17,25],mass_accretion_for_eld:[0,6],mass_accretor:30,mass_donor:30,mass_evolut:25,mass_for_hestar_ia_low:[0,6],mass_for_hestar_ia_upp:[0,6],mass_loss_m:17,mass_lost:17,mass_of_pmz:[0,6],mass_rang:17,massiv:[0,3,4,5,6,7,11,15,23],massless:[0,6],massless_remn:0,massloss:0,massrang:[5,7,11,12,13],master:[21,25],match:[0,5,6,10,11,14,15,21,25],materi:[0,5,6],math:[5,7,11,12,13,14,15],mathrm:[5,7,11,12,13],matplotlib:[5,7,12,13,15,17,23,25,26],matter:[0,6],mattsson:[0,6],mattsson_mass_loss:[0,6],mattsson_orich_tpagbwind:[0,6],max:[0,6,7,8,11,12,13,14,21],max_column:[5,7,15],max_evolution_tim:[0,1,5,6,7,8,10,11,12,13,14,15,17],max_hewd_mass:[0,6],max_model_numb:[0,6],max_neutron_star_mass:[0,6],max_queue_s:21,max_row:[5,7,15],max_stellar_angmom_chang:[0,6],max_stellar_type_1:[0,6],max_stellar_type_2:[0,6],max_stellar_type_3:[0,6],max_stellar_type_4:[0,6],max_tim:[4,10,17],maxcount:4,maximum:[0,5,6,7,8,11,12,13,14,21,30],maximum_mass_ratio_for_instant_rlof:[0,6],maximum_mass_ratio_for_rlof:30,maximum_mcbagb_for_degenerate_carbon_ignit:[0,6],maximum_nuclear_burning_timestep:[0,6],maximum_timestep:[0,6],maximum_timestep_factor:[0,6],maxmimum:[0,6],maxsiz:21,maxwellian:[0,6],mayb:25,mb:[5,7,11,13,14,18,21],mc13_pocket_multipli:[0,6],mc1:4,mc:[0,4,6,14,17],mch:[0,6],mcmin:[0,6],mdonor:[0,4,6],mean:[0,4,6,18,21,23,26],meant:21,measur:18,medium:[0,6],megabyt:21,mem:[7,11],mem_us:18,memaddr:[6,8],memori:[1,5,6,7,8,11,13,14,17,18,19,21,30],menv:[0,4,6],mer:4,mercuri:15,merg:[0,4,5,6,7,21],merge_dict:9,merger:[0,4,6],merger_angular_momentum_factor:[0,6],merger_mass_loss_fract:[0,6],mesa:[23,26],mesasdk_init:[23,26],mesasdk_root:[23,26],mess:15,messag:[18,19],messi:5,mestel:[0,6],met:[14,19],metadata:19,metal:[0,4,5,6,7,8,10,11,12,13,14,15,16,17,30],metallicity_0002:17,metallicity_001:17,metallicity_002:17,method:[0,6,8,10,11,12,13,14,17,19,21],meynet:[0,6],mf1:4,mf2:4,might:[7,11,14,15,18,21,23,26],milki:[0,6],miller:[0,6],min:[7,8,11,12,13,14],mind:17,minimal_verbos:18,minimum:[0,6,18,21,30],minimum_co_core_mass_for_carbon_ignit:[0,6],minimum_co_core_mass_for_neon_ignit:[0,6],minimum_donor_menv_for_comenv:[0,6],minimum_envelope_mass_for_third_dredgeup:[0,6],minimum_helium_ignition_core_mass:[0,6],minimum_mcbagb_for_nondegenerate_carbon_ignit:[0,6],minimum_orbital_period_for_instant_rlof:[0,6],minimum_period_for_rlof:30,minimum_separation_for_instant_rlof:[0,6],minimum_separation_for_rlof:30,minimum_time_between_pn:[0,6],minimum_timestep:[0,6],mint:[0,6],mint_data_cleanup:[0,6],mint_dir:[0,6],mint_disable_grid_load_warn:[0,6],mint_fallback_to_test_data:[0,6],mint_hard_max_nshel:[0,6],mint_hard_min_nshel:[0,6],mint_kippenhahn:[0,6],mint_kippenhahn_companion_stellar_typ:[0,6],mint_kippenhahn_stellar_typ:[0,6],mint_maximum_nshel:[0,6],mint_maximum_shell_mass:[0,6],mint_metal:[0,6],mint_minimum_nshel:[0,6],mint_minimum_shell_mass:[0,6],mint_ms_rejuven:[0,6],mint_nshel:[0,6],mint_nuclear_burn:[0,6],mint_remesh:[0,6],mint_use_zams_profil:[0,6],minut:[7,18],mira:[0,6],misc:[6,23],miscellan:9,miss:[0,6,11,12,13,18],mistak:21,mix:[0,6,21],mixtur:[0,6,11],mmax:[12,13],mmin:[12,13,21],mnra:30,model:[0,1,5,6,7,8,10,11,12,13,14,15,16,17,21],model_numb:[11,12,13],modif:3,modifi:[0,6,8,23,26],modul:[0,6,7,9,11,12,13,14,15,21,24],modulo:21,moe2017_opt:21,moe:[14,23],moe_di_stefano_2017:19,moment:[0,5,6,8,14,17],momenta:[0,6,25],momentum:[0,6,15],monoton:[12,13],mont:[0,6,21],monte_carlo_kick:[0,6],more:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,23,25,26],most:[5,6,7,12,13,15,18],mostli:[5,7,11,12,13,14,17,18,21,25,27],move:[0,5,6],mrucach:21,ms:[0,4,6,8,11],mstart:4,msun:[0,5,6,8,10,11,12,13,15,17],mu:[0,6],much:[0,5,6,7,11,14,17,18],multipl:[0,5,6,21],multiplc:[0,6],multipli:[0,6,12,13,21],multiplicity_fraction_funct:21,multiplicity_model:21,multiplicity_modul:21,multiply_values_dict:9,multiprocess:21,must:[0,5,6,7,10,11,12,13,14,15],mw:[0,6],my:10,my_stellar_data:[1,8,14,16,17],myr:[0,5,6,7,10,11,12,13,15],n100:[0,6],n100_z0:[0,6],n100h:[0,6],n100l:[0,6],n10:[0,6],n150:[0,6],n1600:[0,6],n1600c:[0,6],n1:[0,6],n200:[0,6],n20:[0,6],n300c:[0,6],n3:[0,6],n40:[0,6],n5:[0,6],n:[0,1,4,5,6,7,8,10,11,12,13,14,16,17,18,21],n_logging_stat:21,naked_helium_star_giant_branch:0,naked_helium_star_hertzsprung_gap:0,naked_main_sequence_helium_star:0,name:[1,4,5,6,7,11,12,13,14,15,17,18,21,27,29],nameerror:15,narrow:[12,13],natur:[0,6,12,13],nauenberg:[0,6],nazehdin:0,nb:[0,6],nbinary_c:17,ncol:17,nearer:[0,6],nearest:[7,11,12,13],nebula:[0,6],necessari:[7,14,15,17,18,19],need:[0,6,8,10,11,12,13,14,15,17,21,23,26,30],neg:[0,6],neither:[0,6,19],neleman:[0,6],nelemans_gamma:[0,6],nelemans_max_frac_j_chang:[0,6],nelemans_minq:[0,6],nelemans_n_comenv:[0,6],nelemans_recalc_eccentr:[0,6],nemp:[0,6],nemp_cfe_minimum:[0,6],nemp_nfe_minimum:[0,6],nenamg:[0,6],neon:[0,5,6],neptun:15,nest:14,network:[0,6,9],neutrn:[0,6],neutron:[0,5,6,14],neutron_star:0,never:[0,5,6,12,13,21],newer:[0,6],newli:[0,6],newlin:[18,21],newton:[0,6],next:[11,12,13,14,18],nf:21,nice:[19,25],nieuwenhuijzen:[0,6],nieuwenhuijzen_windfac:[0,6],nine:5,no_thermohaline_mix:[0,6],nocach:21,node:21,noecho:[0,6],noechonow:[0,6],noel:[0,6],nolowq:21,nomin:[0,6],non:[0,6,12,13,21],nonconservative_angmom_gamma:[0,6],none:[0,1,4,5,6,7,11,13,14,15,17,18,19,21,30],nonzero:21,nor:[0,6],norm:21,normal:[0,6,19],normalis:21,normalize_multipl:21,nospac:18,notabl:14,notat:18,note:[0,4,5,6,11,12,13,14,17,18,21],notebook:[4,5,6,7,8,9,10,11,12,13,14,15,23,26],notebook_api_funct:10,notebook_bhbh:4,notebook_comenv:7,notebook_custom_log:[10,11,12,13,14],notebook_hrd:5,notebook_individual_system:[8,10,11,12,13,14],notebook_luminos:[12,13],notebook_luminosity_funct:11,notebook_luminosity_function_binari:[12,13],notebook_popul:[10,14],notebook_solar_system:15,noteworthi:3,noth:21,notic:[12,13],notifi:27,nov:17,nova:[0,5,6,7],nova_faml_multipli:[0,6],nova_irradiation_multipli:[0,6],nova_retention_algorithm_claeys2014:0,nova_retention_algorithm_const:0,nova_retention_algorithm_hillman2015:0,nova_retention_fract:[0,6],nova_retention_method:[0,6],nova_timestep_accelerator_index:[0,6],nova_timestep_accelerator_max:[0,6],nova_timestep_accelerator_num:[0,6],now:[0,4,5,6,7,8,10,11,12,13,14,15,17,18],now_object:18,np:[10,16,17],nre:11,nrow:17,ns:[0,1,6,7,8,14],nsep:7,nsep_max:7,nsep_min:7,nstar:[5,11],nuclear:[0,6],nuclear_mass_hash:19,nuclear_mass_list:19,nucleosynthesi:[0,6],nucleosynthesis_sourc:9,nucreacmult:[0,6],nucsyn:[6,23],nucsyn_angelou_lithium:[0,6],nucsyn_gce_outflow_check:[0,6],nucsyn_hbb:[0,6],nucsyn_metal:[0,6],nucsyn_network:[0,6],nucsyn_network_error:[0,6],nucsyn_s_process:[0,6],nucsyn_solv:[0,6],nucsyn_third_dredge_up:[0,6],nugi:[0,6],nullcach:21,num_ansi_colour:[0,6],num_cor:[5,7,11,12,13,14,21],num_cores_avail:21,number:[0,4,5,6,7,11,12,13,14,15,17,18,19,21,23,26],numpi:[10,14,16,17,18,23,26],o:[6,18,23],obj:18,object:[0,3,6,15,18,19,21,25,27],object_parse_funct:10,observ:[11,12,13],obtain:[0,5,7,11,12,13],obvious:8,occur:[0,6,30],odot:[5,7,17],off:[0,4,6,14,17,21],off_m:[4,10,17],offset:[0,6],oh:4,ohio:[0,6],old:[12,13,21],omega:[0,4,6,17],on_exit_or_evict:21,onc:[0,6],one:[0,6,9,12,13,14,15,16,17,21,25,27],onewd:0,onli:[0,5,6,8,11,12,13,14,15,17,18,21,30],onset:[0,6],onto:[0,6],oop:4,opac:[0,6],opacity_algorithm:[0,6],opacity_algorithm_ferguson_op:0,opacity_algorithm_paczynski:0,opacity_algorithm_star:0,opal:[0,6],open:[4,10,14,17],opt:[4,6],option:[0,1,5,6,7,11,12,13,14,15,16,17,18,19,23,24,26,30],orb:[7,14],orbit:[0,4,6,7,11,15,25,30],orbit_evolut:25,orbital_eccentr:15,orbital_inclin:[0,6],orbital_inclinationi:[0,6],orbital_period:[0,4,6,7,8,10,11,14,16,17,30],orbital_period_quadrupl:[0,6],orbital_period_tripl:[0,6],orbital_phas:[0,6],orbital_phase_quadrupl:[0,6],orbital_phase_tripl:[0,6],orbital_separ:15,orbiting_object:[0,6,15],orbiting_objects_close_pc_threshold:[0,6],orbiting_objects_log:[0,6,15],orbiting_objects_tides_multipli:[0,6],orbiting_objects_wind_accretion_multipli:[0,6],order:[3,14,18],org:[0,6],orient:7,origin:[15,23,26],original_command_lin:21,original_submission_tim:21,original_working_diretori:21,os:[4,5,7,10,11,12,13,14,15,17,18],other:[0,1,5,6,9,10,11,12,13,14,18,21,23,25,26],otherwis:[0,6,18,19,21],our:[5,7,11,12,13,21],out:[5,7,8,11,12,13,15,18,21],outcom:[0,6],outer:[0,5,6],outermost_core_mass:5,outfil:[14,19],outfile_nam:1,outfilenam:14,output:[1,3,4,6,8,9,10,15,16,17,18,19,21,23,25,26,27,30],output_dict:[5,7,10,11],output_dir:[10,14],output_fil:[10,18],output_filenam:14,output_lin:18,outsid:[0,6],outward:[0,6],over:[5,7,9,10,11,12,13,14,18,19],overflow:[0,4,6,7],overhead:21,overrid:[17,21],overriden:14,overshoot:[0,6],overspin_algorithm:[0,6],overspin_bs:[0,6],overspin_massloss:[0,6],overview:6,overwrit:21,own:[8,10,14,16,17,21,23,26],oxygen:[0,5,6],oxygen_neon_white_dwarf:0,p:[5,7,11,12,13,15],p_:7,p_in:4,p_out:4,packag:[6,14,18,23,26],paczynski:[0,6],pad:[7,11,12,13],pad_output_distribut:[5,7,11,12,13,18],page:[0,5,6,14,23,26],pair:[0,4,18],panda:[5,7,10,11,12,13,15,16,17,18,23,25,26],pane:25,panel:[0,6],paper:[0,6],param:18,param_nam:18,paramet:[1,3,5,6,7,8,10,11,12,13,14,18,19,21,23,25,27,30],parameter_nam:[5,6,7,9,11,12,13,14,18],parameter_value_input_typ:[9,18],pars:[3,5,7,10,11,12,13,14,17,18,19,25,27],parse_cmdlin:19,parse_data:7,parse_funct:[5,7,10,11,12,13,14,19,21,27],parse_function_hr_diagram:25,parse_function_mass:25,parse_function_orbit:25,parse_output:17,part:[5,6,10,11,12,13,14,17,19,30],partial:[0,6],particularli:[0,6],partit:21,pass:[6,8,10,14,15,17,18,19,21,23,25,26,27],path:[10,14,17,18,21,23,26],patho:[23,26],pd:[5,7,10,11,12,13,15,16,17],pdf:[0,6,17,23,26],peak:[7,12,13],pend:[0,4,6],per:[0,4,6,7,10,11,14,18,21,30],percentag:[0,6],peret:[0,6],perfect:[12,13],perfectli:[11,12,13],perform:[0,6],perhap:[0,5,6,7,19],periastron:[0,6],pericent:30,period:[0,4,6,7,8,10,11,12,13,14,15,17,25,30],perl:[1,11,12,13,14],persist:6,persistent_data:6,pgo:[0,6],phase:[0,5,6,7,11,12,13],phasevol:[0,6,14],phdi:0,phi:[4,17],photoevapor:[0,6],physic:[5,11,12,13,14,21],pick:25,pid:19,piec:[14,17],pinnsonneault:[0,6],pisn:0,pkg:[23,26],pl:19,place:[0,6,11,18,21],placehold:25,plai:[0,6,12,13],plan:21,planet:15,planetari:[0,6],plaw2:21,pleas:[0,5,6,11,12,13,14,18,21],plot:[0,5,6,7,10,11,12,13,15,16,17,25],plot_data:[7,11,12,13],plot_funct:[23,24],plot_hr_diagram:25,plot_hr_diagram_singl:25,plot_mass:25,plot_orbit:25,plot_system:25,plot_typ:25,plt:[5,7,12,13,15,17],plu:[0,6],pluto:15,pm:25,pms_mass_1:25,pms_mass_2:25,pn:[0,6],pn_comenv_transition_tim:[0,6],pn_fast_wind:[0,6],pn_fast_wind_dm_agb:[0,6],pn_fast_wind_dm_gb:[0,6],pn_fast_wind_mdot_agb:[0,6],pn_fast_wind_mdot_gb:[0,6],pn_hall_fading_time_algorithm:[0,6],pn_hall_fading_time_algorithm_maximum:[0,6],pn_hall_fading_time_algorithm_minimum:[0,6],pn_resolv:[0,6],pn_resolve_maximum_envelope_mass:[0,6],pn_resolve_minimum_effective_temperatur:[0,6],pn_resolve_minimum_luminos:[0,6],pne:[0,6],png:17,pogg:[0,6],point:[0,5,6,18,19,21,23,26],poisson:21,pol:[0,6],polytrop:[0,6],poor:[12,13],pop:[4,8,15],pop_macro:8,popul:[0,3,6,19,23,26,27],population_extens:19,population_id:21,population_nam:[5,7,11,13,14],population_set:19,posit:[0,6,7],possibl:[0,1,5,6,10,15,18,21,23,26],post:[0,4,5,6,7,8,19],post_ce_adaptive_menv:[0,6],post_ce_envelope_dm_eagb:[0,6],post_ce_envelope_dm_gb:[0,6],post_ce_envelope_dm_tpagb:[0,6],post_ce_objects_have_envelop:[0,6],post_comenv_period:7,post_sn_orbit_bs:0,post_sn_orbit_method:[0,6],post_sn_orbit_tt98:0,postagb_legacy_log:[0,6],postagb_wind_gi:0,postagb_wind_krticka2020:[0,6],postagb_wind_non:[0,6],postagb_wind_use_gi:[0,6],postagbwind:[0,6],postcod:[5,7,14],potenti:[0,6],pow2:5,power:[0,6,7,12,13,21],ppisn:0,ppisn_additional_massloss:0,ppisn_core_mass_range_shift:0,ppisn_farmer19:0,ppisn_new_fit_21:0,ppisn_non:0,ppisn_prescript:0,ppn_envelope_mass:[0,6],pragma:8,pre:[0,4,6,7,17,25],pre_comenv_period:7,pre_events_stardata:[0,6],pre_main_sequ:[0,6],pre_main_sequence_fit_lob:[0,6],precod:[5,7,11,12,13,14],predefin:[11,12,13,14],predict:21,predictor:[0,6],prefer:[0,6,19],prefix:[0,6],prep:0,presc:4,prescrib:[0,6],prescript:[0,4,6,14],prescrit:[0,6],present:[5,11,12,13,14,17,19],preserv:[0,6],preset:25,pressur:[0,6],prev_stellar_type_1:14,prev_stellar_type_2:14,prevent:[0,4,5,6,21],previou:[7,12,13,18,21],previous:[10,14],previous_stardata:[1,7,8,10,14],primari:[1,5,7,11,12,13,14,30],prime:7,pringl:[0,6],print:[4,5,6,7,8,9,10,11,12,13,14,15,17,18,21],print_help:[9,18],print_stack_on_exit:21,printf:[1,5,7,8,10,11,12,13,14,16,17],prior:[0,5,6],privat:[19,23],probability_weighted_mass:21,probabl:[0,1,5,6,7,8,11,12,13,14,17,19,21,25],probdist:[5,7,11,12,13,14],problem:[0,6,11],probtot:[12,13],process:[0,5,6,7,11,12,13,14,16,17,18,19,21],processor:[5,7,11],produc:5,profil:[0,6],progenitor:[0,6,14],program:[5,23,26],progress:18,project:[0,6],proper:[5,8],properli:[0,6],properti:[0,18,21,25],proport:7,prot1:[0,6],prot2:[0,6],prot3:[0,6],prot4:[0,6],provid:[0,6,14,19,21,27],pseudorandom:[0,6],publicli:8,puls:[0,5,6,30],pulsat:0,pump:[0,6],purpos:[11,12,13,14,21,25],push:15,push_macro:8,put:[1,5,7,11,12,13,14,17,18,21,25],pwd:21,py:[5,7,11,12,13,14,15,21,23,26],py_rinterpol:[23,26],pyenv:[23,26],pyplot:[5,7,12,13,15,17],pysiz:18,pytest:[23,26],python3:[6,23,26],python:[3,5,7,11,12,13,18,21],q:[0,4,6,7,11,14,17,21,30],q_high_extrapolation_method:21,q_low_extrapolation_method:21,qc:4,qcrit_bh:[0,6],qcrit_bs:0,qcrit_cheb:[0,6],qcrit_chen_han_formula:0,qcrit_chen_han_t:0,qcrit_cowd:[0,6],qcrit_degenerate_bh:[0,6],qcrit_degenerate_cheb:[0,6],qcrit_degenerate_cowd:[0,6],qcrit_degenerate_eagb:[0,6],qcrit_degenerate_gb:[0,6],qcrit_degenerate_hegb:[0,6],qcrit_degenerate_hehg:[0,6],qcrit_degenerate_hem:[0,6],qcrit_degenerate_hewd:[0,6],qcrit_degenerate_hg:[0,6],qcrit_degenerate_lmm:[0,6],qcrit_degenerate_m:[0,6],qcrit_degenerate_n:[0,6],qcrit_degenerate_onewd:[0,6],qcrit_degenerate_tpagb:[0,6],qcrit_eagb:[0,6],qcrit_gb:[0,6],qcrit_gb_bs:0,qcrit_gb_chen_han_formula:0,qcrit_gb_chen_han_t:0,qcrit_gb_ge2015:0,qcrit_gb_hjellming_webbink:0,qcrit_gb_q_no_comenv:0,qcrit_gb_temmink2021:0,qcrit_gb_vos2018:0,qcrit_ge2015:0,qcrit_hegb:[0,6],qcrit_hehg:[0,6],qcrit_hem:[0,6],qcrit_hewd:[0,6],qcrit_hg:[0,6],qcrit_hjellming_webbink:0,qcrit_lmm:[0,6],qcrit_m:[0,6],qcrit_n:[0,6],qcrit_onewd:[0,6],qcrit_q_no_comenv:0,qcrit_temmink2021:0,qcrit_tpagb:[0,6],qcrit_vos2018:0,qcrits_:[0,6],qcrits_degenerate_:[0,6],quad:21,quadrat:[0,6],quadrulpl:[0,6],quadrupl:[0,6,21],quantiti:25,queri:10,queue:[5,7,11,21],quickli:10,quit:[0,5,6,18],r1:[4,10,17],r2:[4,10,17],r:[0,1,4,5,6,10,14,17,23,26],r_l:30,r_sun:5,radau:[0,6],radi:[0,6],radiat:[0,6],radii:[0,6,30],radiu:[0,1,5,6,8,14,16,25,30],radius_1:25,radius_2:25,ragb:30,rai:[0,6],railton:[0,6],rais:[0,6,14,18,21],ram:[0,6,21],ran:[5,7,11,21],randbuf:[4,17],random:[0,4,6,17,21],random_count:[4,10,17],random_se:[0,4,6,10,17],random_skip:[0,6],random_system:[0,6],random_systems_se:[0,6],rang:[0,5,6,7,10,11,12,13,14,21],rapid:[0,6],rapidli:[0,6],rappaport:[0,6],rate:[0,6,12,13],rather:[0,6,8,10,14,18,21,23,26],ratio:[0,5,6,7,11,12,13,14,30],raw:[6,17,18,19,21,25,27],rc:[4,5,7,11,12,13,15,25],re:[0,1,5,6,7,11,12,13,15],reach:[0,4,5,6,7],reaction:[0,6],read:[3,4,10,14,17,18,21],readabl:18,readlin:4,real:[5,11,14],realist:[12,13],realiti:[12,13],realli:[0,5,6,14,19,21],reason:[0,6,12,13],rebuild:[0,6,21,23,26],rebuilt:[23,26],recalcul:[0,6],receiv:18,recent:[12,15],recogn:14,recombin:[0,6],recommend:[1,3,23,26],recompil:[11,12,13,14,23,26],recurs:18,red:[0,5,6,12,13,15],redhat:1,reduc:[0,4,6],reduct:21,refer:21,regardless:25,region:[0,6],regist:14,reignit:[0,6],reimer:[0,6],reinstal:[23,26],reject:[0,6],rejects_in_log:[0,6],rejuven:[0,6,11],rel:[0,6],relat:[0,6],releas:[18,23,26],relev:19,reliabl:6,remain:[0,6,18,21],rememb:[4,5,12,13],remesh:[0,6],remnant:[0,5,6],remov:[0,6,7,10,14,15,18,19],remove_fil:18,renam:[12,13],rename_grid_vari:[12,13],rentrop:[0,6],repeat:[0,6,21],repo:23,report:[0,5,6,7,11,12,13,14],repositori:3,repres:21,represent:14,reproduc:[0,6],requir:[0,6,7,10,11,12,13,14,15,17,18,21,25,27],rerun:[5,21],reset:[0,6],reset_pref:[0,6],reset_star:[0,6],reset_stars_default:[0,6],resolut:[0,5,6,7,11,12,13,14,21],resolv:[0,6,11],reson:[0,6],resourc:[12,13],respect:[0,6],rest:14,restore_from_snapshot_dir:21,restore_from_snapshot_fil:21,restructuredtext:18,result:[0,1,5,6,7,10,11,12,13,14,17,18,21,23,26],result_example_head:17,result_example_header_1:17,result_example_header_2:17,results_dictionari:[5,7,11,12,13],retain:[0,6],rethink:18,return_after_dry_run:21,return_all_info:19,return_arglin:6,return_binary_c_default:19,return_binary_c_version_info:[9,19],return_compilation_dict:1,return_help:6,return_help_al:[6,18],return_maximum_mass_ratio_for_rlof:[6,30],return_minimum_orbit_for_rlof:[6,30],return_persistent_data_memaddr:6,return_population_set:19,return_store_memaddr:6,return_version_info:6,reus:19,revap_in:[0,6],revap_out:[0,6],revers:[0,6,25],reverse_tim:[0,6],revis:0,rewrit:19,rgb:5,rhagavan:21,ri0005:[5,14],rich:[0,6],riello:[0,6],rin:[0,6],ring:[0,6],risk:14,ritter:[0,6],rk2:[0,6],rk4:[0,6],rl1:4,rl2:4,rl:[0,4,6],rlof:[0,4,6,30],rlof_angular_momentum_transfer_model:[0,6],rlof_angular_momentum_transfer_model_bs:0,rlof_angular_momentum_transfer_model_conserv:0,rlof_eccentric_as_circular:[0,6],rlof_entry_threshold:[0,6],rlof_f:[0,6],rlof_interpolation_binary_c:0,rlof_interpolation_bs:0,rlof_interpolation_method:[0,6],rlof_mdot_factor:[0,6],rlof_mdot_modul:[0,6],rlof_method:[0,6],rlof_method_adapt:0,rlof_method_adaptive2:0,rlof_method_bs:0,rlof_method_claei:0,rlof_method_ritt:0,rlof_nonconservative_gamma_donor:0,rlof_nonconservative_gamma_isotrop:0,rlof_radiation_correct:[0,6],rlof_transition_objects_escap:[0,6],rob:[0,6,30],robert:[23,26],roch:[0,4,6,7,30],roche_lob:30,rochelob:30,rol1:[4,10,17],rol2:[4,10,17],room:14,root:[23,26],rotat:[0,6],rotation:[0,6],rotationally_enhanced_expon:[0,6],rotationally_enhanced_mass_loss:[0,6],rotationally_enhanced_massloss:[0,6],rotationally_enhanced_massloss_angmom:0,rotationally_enhanced_massloss_langer_formula:[0,6],rotationally_enhanced_massloss_langer_formula_and_angmom:0,rotationally_enhanced_massloss_non:0,rough:5,rout:[0,6],routin:[0,3,6,23,25,27],row:[10,17,25],rrcach:21,rring:[0,6],rst:18,rsun:[5,25],run:[0,1,3,4,5,6,7,11,12,13,16,18,19,21,23,26,27,30],run_and_calc_mass:17,run_binary_custom_log:17,run_popul:6,run_system:[4,6,8,9,10,15,16,25,27],run_system_wrapp:[3,4,8,16,23,24],run_zero_probability_system:21,runawai:[4,17],rungrid:21,runtim:[1,21],russel:[0,3,6,23],rzam:[4,30],s:[0,4,5,6,7,10,12,13,14,15,17,18,19,21,30],safe:14,sai:[0,5,6],said:[0,6],same:[0,6,10,14,21,23,26,27],sampl:[0,3,6,11,14],sampler:23,samplerfunc:[5,7,11,12,13,14,21],sana12:[7,11,14],sander:0,saturn:15,save:[0,1,5,6,7,8,11,12,13,14,21],save_ensemble_chunk:21,save_loop:17,save_population_object:21,save_pre_events_stardata:[0,6],save_snapshot:21,sbatch:21,scalar:18,scanf:0,scene:17,scheme:[0,6],schneider:[0,6],schroeder:[0,6],scientif:18,script:[3,8,18,21,23,26],sdb:[0,6],sdo:[0,6],seaborn:[5,7,11,12,13,15],search:[5,11,15,23],search_for_bhbh:4,second:[0,6,7,15,18,25],secondari:[4,5,11,30],section:[6,14,18,23,26],see:[0,4,5,6,7,8,9,10,11,12,13,14,17,19,21,23,25,26],seed:[0,6],seem:[23,25,26],seen:18,seitenzahl2013_model:[0,6],seitenzahl:[0,6],select:[0,6,10,11,15,17,18],selected_head:[17,18],selector:[0,6],self:[5,7,10,11,12,13,14,19,21],semi:[0,6],sent:[0,6],sentenc:1,sep:[4,7,10,11,14,17,30],sep_max:[7,11,14],sep_min:[7,11,14],separ:[0,4,5,6,8,10,14,15,16,17,25,30],separation_quadrupl:[0,6],separation_tripl:[0,6],separta:[0,6],seper:14,sepf:4,sequenc:[0,5,6,8,11,12,13,17],sequnec:[11,12,13],seri:[0,6],serv:[17,18],server:17,set:[0,1,3,4,8,9,10,15,17,18,19,21,23,25,26],set_context:[5,7,11,12,13,15],set_opt:[5,7,15],set_titl:17,set_xlabel:[5,7,11,12,13,15,17],set_ylabel:[5,7,11,12,13,15,17],set_yscal:17,setup:[5,14,27],sever:[9,14,17,21,25,27],sh:[23,26],shara:[0,6],share:[1,10,16,17,21,27],shared_lib_filenam:8,shell:[0,6,18],shellular:[0,6],shift:0,shorten:[0,4,6],shorter:4,shortli:5,should:[0,1,4,5,6,7,10,11,12,13,14,17,18,21,23,25,26,27],shouldn:[0,6,18],show:[0,3,4,5,6,7,10,11,12,13,14,17,21,25],show_plot:25,show_stellar_typ:25,shown:[0,6,25],shrink:[4,7],shrinkagb:10,side:[11,12,13,14],siess:[0,6],sigint:21,sigkil:21,signal:[5,7,11,21],silent:18,sill:[0,6],sim10:7,sim:5,simpl:[5,7,11,15],simplest:10,simpli:[0,6,12,13],simul:[0,1,5,6,7,8,11,12,13,14],simulation_:19,sinc:[18,25],singl:[0,3,4,5,6,11,12,13,14,17,19,21,25],single_star_lifetim:[6,8,10],sit:[0,6],site:6,situat:6,size:[18,21],skip:[0,5,6,7,11,21],slice:17,sliced_df:17,slightli:6,slow:[0,5,6,7,11,12,13],slower:[0,6],slurm:21,slurm_arrai:21,slurm_array_max_job:21,slurm_bash:21,slurm_dat:21,slurm_dir:21,slurm_env:21,slurm_extra_set:21,slurm_jobarrayindex:21,slurm_jobid:21,slurm_jobnam:21,slurm_memori:21,slurm_njob:21,slurm_ntask:21,slurm_partit:21,slurm_postpone_join:21,slurm_postpone_sbatch:21,slurm_pwd:21,slurm_sbatch:21,slurm_tim:21,slurm_warn_max_memori:21,small:[0,4,6,12,13],small_envelope_method:[0,6],small_envelope_method_bs:0,small_envelope_method_miller_bertolami:0,smaller:[0,6],smarter:[12,13],smooth:[5,12,13],smoother:[7,12,13],sn:[0,4,5,6,7,11,12,13,15,17],sn_impulse_liu2015:0,sn_impulse_non:0,sn_impulse_wheeler1975:0,sn_kick_companion_a:[0,6],sn_kick_companion_aic_bh:[0,6],sn_kick_companion_bh_bh:[0,6],sn_kick_companion_bh_n:[0,6],sn_kick_companion_ecap:[0,6],sn_kick_companion_grb_collapsar:[0,6],sn_kick_companion_hestaria:[0,6],sn_kick_companion_ia_chand:[0,6],sn_kick_companion_ia_chand_co:[0,6],sn_kick_companion_ia_eld:[0,6],sn_kick_companion_ia_h:[0,6],sn_kick_companion_ia_he_co:[0,6],sn_kick_companion_ia_hybrid_hecowd:[0,6],sn_kick_companion_ia_hybrid_hecowd_sublumin:[0,6],sn_kick_companion_ibc:[0,6],sn_kick_companion_ii:[0,6],sn_kick_companion_iia:[0,6],sn_kick_companion_ns_n:[0,6],sn_kick_companion_phdi:0,sn_kick_companion_pisn:0,sn_kick_companion_ppisn:0,sn_kick_companion_tz:[0,6],sn_kick_companion_wdkick:[0,6],sn_kick_dispersion_aic_bh:[0,6],sn_kick_dispersion_bh_bh:[0,6],sn_kick_dispersion_bh_n:[0,6],sn_kick_dispersion_ecap:[0,6],sn_kick_dispersion_grb_collapsar:[0,4,6],sn_kick_dispersion_ia_hybrid_hecowd:[0,6],sn_kick_dispersion_ia_hybrid_hecowd_sublumin:[0,6],sn_kick_dispersion_ibc:[0,4,6],sn_kick_dispersion_ii:[0,4,6],sn_kick_dispersion_ns_n:[0,6],sn_kick_dispersion_phdi:0,sn_kick_dispersion_pisn:0,sn_kick_dispersion_ppisn:0,sn_kick_dispersion_tz:[0,6],sn_kick_distribution_aic_bh:[0,6],sn_kick_distribution_bh_bh:[0,6],sn_kick_distribution_bh_n:[0,6],sn_kick_distribution_ecap:[0,6],sn_kick_distribution_grb_collapsar:[0,6],sn_kick_distribution_ia_hybrid_hecowd:[0,6],sn_kick_distribution_ia_hybrid_hecowd_sublumin:[0,6],sn_kick_distribution_ibc:[0,6],sn_kick_distribution_ii:[0,6],sn_kick_distribution_ns_n:[0,6],sn_kick_distribution_phdi:0,sn_kick_distribution_pisn:0,sn_kick_distribution_ppisn:0,sn_kick_distribution_tz:[0,6],sn_none:8,sn_type:8,snapshot:21,sneia:[0,6],snia:[0,6],snippet:[6,10],so:[0,4,5,6,7,8,10,11,12,13,14,19,21,25],solar:[0,3,5,6,7,9,23,30],solver:[0,6],solver_forward_eul:0,solver_predictor_corrector:0,solver_rk2:0,solver_rk4:0,some:[0,1,5,6,7,8,9,10,11,12,13,14,17,21,23,25,26],someth:[0,5,6,7,10,11,12,13,21,30],sometim:9,somewhat:[11,12,13,14,15],sort:[5,11,12,13,15,18],sourc:[1,7,18,19,21,24,25,27,30],source_file_filenam:21,source_list:19,sourcecod:[6,8,23,26],sourcefile_nam:1,space:[0,5,6,11,12,13,14],spacing_funct:[19,23,24],spawn:18,special:[0,6,14],specif:[0,6,9,10,25],specifi:[0,6,18,21],speed:[0,6],speedtest:[0,6],spent:18,spera:[0,6],spheric:[0,6],spiki:[12,13],spin:[0,6,15],spinrat:[0,6],split:[0,4,6,10,14,15,17,21],split_lin:10,splitlin:[5,6,7,8,10,11,12,13,14,15],splitpoint:[0,6],spread:19,sqrt:[0,6],src:[0,6,8,23,26],st1:17,st2:17,st:4,stabil:[0,6],stabl:[0,6,23,26],stack:21,stacktrac:19,stancliff:[0,6],standard:[0,6,11,12,13],star1:15,star:[1,3,4,6,7,8,9,10,11,12,14,15,16,17,21,23,25,30],star_with_no_mass:0,starcount:[5,7,11,13,14],stardata:[0,1,5,6,7,8,10,11,12,13,14,16,17],stardata_dump_filenam:[0,6],stardata_load_filenam:[0,6],stardata_t:8,starnum:[5,11],start:[0,1,4,5,6,7,10,11,12,13,14,17,18,21],start_at:21,start_tim:[0,6,21],start_timestamp:[5,7,11,13,14],startrack:[0,6],startswith:10,state:[0,6],statement:[1,8,10,11,12,13,14,15,16,17,21],statist:[0,6,21],statu:[0,1,5,6,7,11,12,13,14,21],status_dir:21,stderr:[0,6,21],stdout:[18,21],steadi:[0,6],stefan:25,stefano:[14,23],stellar:[0,3,4,6,13,21,23,25,29],stellar_structure_algorithm:[0,6],stellar_structure_algorithm_external_funct:0,stellar_structure_algorithm_mint:0,stellar_structure_algorithm_modified_bs:0,stellar_structure_algorithm_non:0,stellar_typ:[1,5,8,10,11,12,13,14,23,24,25],stellar_type1:4,stellar_type2:4,stellar_type_1:[0,6,14,25],stellar_type_2:[0,6,14,25],stellar_type_3:[0,6],stellar_type_4:[0,6],stellar_type_dict:29,stellar_type_dict_short:29,step:[5,7,8,10,11,12,13,14,25],stepsiz:14,stick:21,stiff:[0,6],still:[1,8,15,21,30],stop:[0,5,6,7,11,17,18,21],stop_queu:21,stopfil:[0,6],storag:[0,6],store:[0,3,5,7,10,11,12,13,14,18,19,21,23,26,30],store_capsul:6,store_memaddr:[6,30],str:[1,4,5,14,18,19,25],straightforward:[5,11,12,13,14],straniero:[0,6],stream:21,strength:[0,6],strictli:[11,12,13],string:[0,1,3,6,10,11,12,13,14,15,18,19,21,25,27],strip:[0,6,10,15],strong:5,stronger:[0,5,6],struct:[0,6,8],structur:[0,6,7,18,21,25],studi:5,stuff:[10,14,21],style:[0,6,18],sub:[0,6,18],subject:[0,6],sublumin:[0,6],submiss:21,submit:[21,23],subplot:17,subsequ:[0,6],succe:[0,6],suddenli:5,suffer:5,suffici:5,suggest:[0,6,23,26],suit:[23,26],sum:[0,6],sun:15,sundial:[0,6],supercrit:[0,6],superflu:15,supernova:[0,4,6,7,21],superwind:[0,6],superwind_mira_switchon:[0,6],sure:[10,11,12,13,14,23,26,27],surfac:[0,6],surrei:[5,14],surviv:[0,6,15],survivor:[0,6],sview:21,swallow:15,switcher:[0,6],sy:19,symlink:[5,7,11,14],symlink_latest_gridcod:21,symmetr:[0,6],synchron:[0,6],synonym:[0,6],synthesi:[11,12,13,14,21,23,26],system:[0,3,5,6,7,8,11,12,13,14,16,17,18,19,21,23,25,26,27,30],system_gener:14,system_queue_fil:[5,7,11],t:[0,1,4,5,6,10,12,13,14,18,21],t_:5,tabl:[0,6],take:[0,6,7,11,14,17,18,21,27],taken:[0,6,8],talk:5,target:1,task:[0,6,14,17,18,19,25,27,30],tauri:[0,6],tbse:[0,6],te:21,technic:[5,7,8,11,12,13,14],teff:[0,4,6],teff_1:25,teff_2:25,teff_from_star_struct:5,teff_postagb_max:[0,6],teff_postagb_min:[0,6],tell:18,temp_dir:[4,5,7,10,12,13,14,15,18],temperatur:[0,6,15,25],tempfil:17,termin:[1,5,8,14,23,26],test:[0,6,10,14,18,21,23,26],test_data:[0,6],test_func:6,test_log:17,test_logfil:10,test_pop:14,text:[5,7,15,18],than:[0,5,6,7,11,12,13,14,18,21,23,26],thats:14,thei:[0,4,5,6,7,11,14,15,19,21,25],thelog:[0,6],them:[5,6,7,14,16,17,18,27],theoret:[11,12,13],thermal:[0,5,6,30],thermally_pulsing_asymptotic_giant_branch:0,thermohalin:[0,6],thermonuclear:5,thesi:[0,6],thi:[0,1,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,21,23,24,25,26,27,30],thick:[0,6],thick_disc_end_ag:[0,6],thick_disc_logg_max:[0,6],thick_disc_logg_min:[0,6],thick_disc_start_ag:[0,6],thin:[0,6],thing:[0,5,6,7,11,12,13,14,17,18,19,27],think:[0,6,18,19],third:[0,6,15],third_dup:[0,6],third_dup_multipli:[0,6],thorn:[0,6],those:[5,7,11,12,13,14,17,19,23,26],thread:[5,7,11,12,13,18,21],thread_id:21,three:[0,6,12,13,14],three_part_powerlaw:[7,11,12,13,14],threshold:[0,6,18,21],through:[5,6,10,11,12,13,14,25,27],throughout:[11,12,13,14],tidal:[0,4,6],tidal_strength_factor:[0,6],tide:[0,6,15],tides_convective_damp:[0,6],tides_diagnosis_log:[0,6],tides_hurley2002:[0,6],tides_zahn1989:[0,6],tight:17,time:[0,1,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,21,23,25,26],timedelta:18,timescal:[0,6],timestamp:21,timestep:[0,6,7,8,10,11,12,13],timestep_limit:[0,6],timestep_log:[0,6],timestep_modul:[0,6],timestep_multipli:[0,6],timestep_solver_factor:[0,6],tini:5,tip:5,titl:11,tmp:[0,5,6,7,10,11,12,13,14,15,18,23,26],tmp_dir:[4,5,7,10,12,13,14,15,21],toasti:15,todo:[0,1,4,6,9,14,18,19,21,25,27,30],toler:[0,6],too:[0,5,6,12,13,15,21,23,26,27],took:[5,7,11,13,14,17],tool:21,top:[0,14],topcod:[5,7,14],topic:[0,6],torqu:[0,6],total:[0,5,6,7,11,12,13,14,17,18,21,25],total_count:[5,7,11,13,14],total_mass_run:[5,7,11,13,14],total_prob:[5,7,11,12,13,14],total_probability_weighted_mass_run:[5,7,11,13,14],tout:[0,6,30],tout_pringle_1992_multipli:[0,6],tp:[0,6],tpagb:[0,5,6],tpagb_reimers_eta:[0,6],tpagb_wind_beasor_etal_2020:0,tpagb_wind_bloeck:0,tpagb_wind_goldman_etal_2017:0,tpagb_wind_mattsson:0,tpagb_wind_reim:0,tpagb_wind_rob_cwind:0,tpagb_wind_van_loon:0,tpagb_wind_vw93_karaka:0,tpagb_wind_vw93_karakas_carbon_star:0,tpagb_wind_vw93_orig:0,tpagb_wind_vw93_orig_carbon_star:0,tpagbwind:[0,6],tpagbwindfac:[0,6],tpr:[7,11],trace:21,traceback:[12,15],track:[5,21,25],trade:[0,6],trail:18,transfer:[0,5,6,21],transform:[0,6],transit:[0,6],treat:[0,6],trem:18,trigger:[0,6],trio:[11,12,13,14],tripl:[0,6,21],truli:[0,6],ttlcach:21,tupl:[1,5,18],turn:[0,4,6,10,14],tutori:[3,23],two:[0,5,6,8,18,29,30],txt:[10,14,17,23,26,27],type:[0,1,4,6,7,10,11,12,13,14,17,18,19,21,25,29,30],type_chng:[4,10,17],type_ia_mch_supernova_algorithm:[0,6],type_ia_sub_mch_supernova_algorithm:[0,6],typeerror:12,typic:[0,6],ubvri:[0,6],ugriv:[0,6],uk:[5,14],unavail:[0,6],unbound:4,uncom:[10,11,12,13,14,15],unction:6,undef:8,under:10,undergo:[0,7],understand:21,unexpect:12,union:[14,30],uniqu:[14,17,21],unit:[0,5,6,9,18,30],univari:[0,6],univers:[5,7,21],unknown:27,unless:[1,19,21],unlik:[12,13],unload:19,unmerg:7,unpars:6,unphys:[4,7,11],unrecogn:[23,26],unresolv:11,unsign:0,unstabl:[0,4,6],until:[0,5,6],unus:[0,6,21],unweight:14,up:[0,1,3,8,10,15,18,19],updat:[12,13,14,19,23,26],update_dict:9,update_grid_vari:[12,13],upon:30,upper:[0,6],uranu:15,us:[0,1,3,9,10,14,18,19,21,23,25,26,27,30],usag:[0,3],use_astropy_valu:25,use_datadir:[14,19],use_fixed_timestep_:[0,6],use_lwn_fallback:0,use_periastron_roche_radiu:[0,6],use_tabular_intershell_abundances_karakas_2012:[0,6],usecas:3,useful_func:[23,24],user:[1,8,18,19,21,27],usernam:18,usr:21,usual:[0,4,5,6,11,12,13,14,18,21],util:[1,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,25,27,30],v:[4,17,23,26],valid:[0,6,8,18],valu:[0,1,5,6,9,10,11,12,13,14,17,18,19,21,25],value_lin:10,valueerror:14,valuerang:[5,7,11,12,13,14],values_arrai:10,van:[0,6],vandenheuvel_log:[0,6],vanilla:21,vari:[0,5,6,7,14],variabl:[0,3,5,6,7,18,21],variant:[0,6],variou:[0,6],vassiliadi:[0,6],vb:4,veloc:[0,6],venu:15,verbos:[1,5,7,10,11,12,13,14,16,18,21,23,26],verbose_print:18,veri:[0,4,5,6,7,8,10,12,13,14],versa:30,version:[0,6,9,14,18,19,23,26],version_info:19,version_info_dict:9,version_onli:[0,6],via:[3,5,6,8,11,12,13,14,19,21,25],vice:30,vink:[0,6],virtual:[23,26],virtualenviron:[23,26],viscos:[0,6],viscou:[0,6],visibl:8,visit:23,vk:[4,17],vn:[4,17],volum:[0,6],vr:[4,17],vrot1:[0,6],vrot2:[0,6],vrot3:[0,6],vrot4:[0,6],vrot_breakup:0,vrot_bs:0,vrot_non_rot:0,vrot_sync:0,vs:[15,25],vw93:[0,6],vw93_eagb_wind_spe:[0,6],vw93_mira_shift:[0,6],vw93_multipli:[0,6],vw93_tpagb_wind_spe:[0,6],vwind:[0,6],vwind_beta:[0,6],vwind_multipli:[0,6],w:[1,10,14,19],wa:[0,5,6,9,10,12,13,14,19,21,23,26],wai:[0,6,10,12,13,19,21],wang:[0,6],want:[0,4,6,7,8,9,11,12,13,14,17,18,21,23,25,26],warmup_cpu:[0,6],warn:[0,6,10,14,21],was_kil:19,wast:[7,12,13],wave:[0,5,6,7,14],wd:[0,6],wd_accretion_rate_new_giant_envelope_lower_limit_helium_donor:[0,6],wd_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor:[0,6],wd_accretion_rate_new_giant_envelope_lower_limit_other_donor:[0,6],wd_accretion_rate_novae_upper_limit_helium_donor:[0,6],wd_accretion_rate_novae_upper_limit_hydrogen_donor:[0,6],wd_accretion_rate_novae_upper_limit_other_donor:[0,6],wd_kick:[0,6],wd_kick_at_every_puls:0,wd_kick_at_given_puls:0,wd_kick_direct:[0,6],wd_kick_end_agb:0,wd_kick_first_rlof:0,wd_kick_pulse_numb:[0,6],wd_kick_when:[0,6],wd_sigma:[0,6],wdwd_merger_algorithm:[0,6],wdwd_merger_algorithm_bs:0,wdwd_merger_algorithm_chen2016:0,wdwd_merger_algorithm_perets2019:0,we:[0,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,21,23,26,30],weight:[0,6,12,13,21],weirdli:11,well:[0,6,8,10,11,12,13,21,23,26],went:[12,13],were:[5,7,11,13,14,18],what:[0,1,4,5,6,7,8,10,11,12,13,14,17,21,23,26,27],whatev:[0,6,8,17,18,19,23,26],wheeler:[0,6],when:[0,1,5,6,7,9,10,14,15,18,21,23,26,27],whenev:[23,26],where:[0,1,5,6,11,12,13,14,18,21,23,26],whether:[0,6,14,18,19,21,25,30],which:[0,1,5,6,7,8,9,10,11,12,13,14,16,17,18,19,21,23,26,27,30],whichev:21,white:[0,5,6],white_dwarf_cooling_carrasco2014:[0,6],white_dwarf_cooling_mestel:[0,6],white_dwarf_cooling_mestel_modifi:[0,6],white_dwarf_cooling_model:[0,6],white_dwarf_radius_carrasco2014:[0,6],white_dwarf_radius_model:[0,6],white_dwarf_radius_mu:[0,6],white_dwarf_radius_nauenberg1972:[0,6],whole:[0,6,7,8,19,21],why:7,wide:[4,11,12,13],wider:4,width:[0,6,7],wiggl:[12,13],wind:[0,4,5,6,11],wind_algorithm_binary_c_2020:[0,4],wind_algorithm_hendriks_2022:0,wind_algorithm_hurley2002:0,wind_algorithm_non:[0,4],wind_algorithm_schneider2018:0,wind_angmom_loss_bs:0,wind_angmom_loss_lw:0,wind_angmom_loss_lw_hybrid:0,wind_angmom_loss_spherically_symmetr:0,wind_angular_momentum_loss:[0,6],wind_disc_angmom_fract:[0,6],wind_disc_mass_fract:[0,6],wind_djorb_fac:[0,6],wind_gas_to_dust_ratio:[0,6],wind_lbv_luminosity_lower_limit:[0,6],wind_mass_loss:[0,4,6],wind_multiplier_:[0,6],wind_nieuwenhuijzen_luminosity_lower_limit:[0,6],wind_type_multiplier_:[0,6],wink:0,within:[0,6,8,9,14,18,23,26],without:[8,10,12,13,18,21],won:[0,6,10],wood:[0,6],wooslei:0,work:[0,6,8,10,11,12,13,17,18,21,23,26],working_diretori:21,would:[0,6,12,13,14,21,25],wouldn:14,wr:[0,6],wr_wind:[0,6],wr_wind_bs:0,wr_wind_eldridg:0,wr_wind_fac:[0,6],wr_wind_maeder_meynet:0,wr_wind_nugis_lam:0,wrap:[1,8],wrapper:[6,8,10,19,30],write:[1,4,5,6,7,8,10,11,14,16,17,18,19,21,27],write_binary_c_calls_to_fil:14,write_binary_c_parameter_descriptions_to_rst_fil:18,write_logfil:6,written:[6,10,14,21,27],written_data:10,wrlof_mass_transf:[0,6],wrlof_method:[0,6],wrlof_non:0,wrlof_q_depend:0,wrlof_quadrat:0,wrong:[12,13,23,26],wrt:17,wrwindfac:[0,6],wtts2:[0,6],wtts_log:[0,6],www:[0,6],x0d:21,x86_64:6,x:[0,5,6,8,10,15,17,18,19,25],xlabel:16,xlim:[7,15],xx:15,y:[4,5,15,18,19,25],ye:21,year:[0,6],year_length_in_dai:7,yet:[0,6,17,18,21,25],yield:[0,6],ylim:15,you:[0,1,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,21,23,25,26,30],young:[0,6],your:[8,10,16,17,21,23,26],yourself:[5,7,11,12,13,14,25],yscale:[11,12,13,15],yy:15,z:[0,5,6,7,17,19,30],zahn:[0,6],zam:[0,3,5,6,11,27,30],zams_collis:30,zams_mass:[5,11,12,13,14],zams_mass_1:14,zams_mass_2:14,zero:[0,1,3,4,5,6,7,13,18,21,23],zero_ag:[5,8,10,11,12,13,14],zero_age_main_sequence_star:[11,12,13],zero_age_main_sequence_starn:11,zero_prob_stars_skip:[5,7,11,13,14],zone:[0,6],zoom:[0,6],zoomfac_multiplier_decreas:[0,6],zoomfac_multiplier_increas:[0,6],zytkow:[0,6]},titles:["Binary_c parameters","custom_logging_functions module","distribution_functions module","Example notebooks","Example use case: Binary black hole systems","Example use case: Hertzsprung-Russell diagrams","Tutorial: Using the API functionality of binary_c-python","Example use case: Common-envelope evolution","Tutorial: Using custom logging routines with binary_c-python","Tutorial: Extra features and functionality of binary_c-python","Tutorial: Running individual systems with binary_c-python","Example use case: Zero-age stellar luminosity function in binaries","Example use case: Zero-age stellar luminosity function","Example use case: Massive star luminosity","Tutorial: Running populations with binary_c-python","Example use case: Solar system using the API functionality","<no title>","Binary_c and python example notebook","functions module","grid_class module","Grid options and descriptions","Population grid code options","hpc_functions module","Welcome to binary_c-python\u2019s documentation!","Binarycpython code","plot_functions module","Python module for binary_c","run_system_wrapper module","spacing_functions module","stellar_types module","useful_funcs module"],titleterms:{"case":[4,5,7,11,12,13,15],"function":[6,9,10,11,12,13,14,15,17,18],"public":21,A:[12,13],about:9,ad:[11,12,13,14],after:[23,26],ag:[11,12],algorithm:0,api:[6,8,10,15,17],better:[12,13],binari:[0,4,5,11,17],binary_c:[0,6,8,9,10,14,17,23,26],binarycpython:24,black:4,build:[9,23,26],code:[21,24],common:7,compact:8,content:[3,23],core:17,custom:[8,17],custom_logging_funct:1,descript:20,develop:[23,26],di:21,diagram:5,dictionari:9,directli:8,distribut:[12,13],distribution_funct:2,document:[23,26],envelop:7,environ:[23,26],evolut:[7,8],evolv:[5,7,11,12,13,14],exampl:[3,4,5,6,7,8,9,11,12,13,14,15,17,23,26],extra:9,faq:[23,26],featur:9,free:6,from:[6,8,23,26],full:14,get:[6,9],grid:[5,7,11,12,13,14,20,21],grid_class:19,handl:[5,7,11,12,13,14],help:9,hertzsprung:5,hole:4,hpc_function:22,i:0,indic:23,individu:10,inform:[6,9],initi:[12,13],input:0,instal:[23,26],instruct:[23,26],issu:[23,26],line:17,log:[5,7,8,11,12,13,14,17],luminos:[11,12,13],mass:[8,12,13],massiv:13,misc:0,modif:9,modul:[1,2,18,19,22,23,25,26,27,28,29,30],moe:21,note:[23,26],notebook:[3,17],noteworthi:14,nucsyn:0,o:0,object:[5,7,8,10,11,12,13,14],option:[20,21],other:17,output:[0,5,7,11,12,13,14],paramet:[0,9],pars:9,pip:[23,26],plot_funct:25,popul:[5,7,8,10,11,12,13,14,21],privat:21,python:[6,8,9,10,14,17,23,26],requir:[23,26],routin:8,run:[8,10,14,17],run_binari:17,run_binary_with_log:17,run_system:17,run_system_wrapp:[10,27],russel:5,s:23,sampl:[12,13],sampler:21,script:14,section:0,set:[5,6,7,11,12,13,14],singl:10,solar:15,sourc:[23,26],spacing_funct:28,star:[0,5,13],stefano:21,stellar:[5,7,11,12],stellar_typ:29,store:6,string:8,supernova:8,system:[4,10,15],tabl:23,tutori:[6,8,9,10,14],up:[5,6,7,11,12,13,14],us:[4,5,6,7,8,11,12,13,15,17],usag:[6,8,23,26],useful_func:30,util:17,variabl:[11,12,13,14,23,26],via:[10,23,26],welcom:23,when:8,wrapper:17,zam:[12,13],zero:[11,12]}}) \ No newline at end of file +Search.setIndex({docnames:["binary_c_parameters","custom_logging_functions","dicts","ensemble","example_notebooks","examples/notebook_BHBH","examples/notebook_HRD","examples/notebook_api_functionality","examples/notebook_common_envelope_evolution","examples/notebook_custom_logging","examples/notebook_extra_features","examples/notebook_individual_systems","examples/notebook_luminosity_function_binaries","examples/notebook_luminosity_function_single","examples/notebook_massive_remnants","examples/notebook_population","examples/notebook_solar_system","examples/old/basic_example","examples/old/workshop_example_notebook","functions","grid","grid_options_descriptions","index","modules","plot_functions","population_extensions/HPC","population_extensions/analytics","population_extensions/cache","population_extensions/condor","population_extensions/dataIO","population_extensions/distribution_functions","population_extensions/grid_options_defaults","population_extensions/gridcode","population_extensions/metadata","population_extensions/slurm","population_extensions/spacing_functions","population_extensions/version_info","readme_link","run_system_wrapper","stellar_types","useful_funcs"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,nbsphinx:3,sphinx:56},filenames:["binary_c_parameters.rst","custom_logging_functions.rst","dicts.rst","ensemble.rst","example_notebooks.rst","examples/notebook_BHBH.ipynb","examples/notebook_HRD.ipynb","examples/notebook_api_functionality.ipynb","examples/notebook_common_envelope_evolution.ipynb","examples/notebook_custom_logging.ipynb","examples/notebook_extra_features.ipynb","examples/notebook_individual_systems.ipynb","examples/notebook_luminosity_function_binaries.ipynb","examples/notebook_luminosity_function_single.ipynb","examples/notebook_massive_remnants.ipynb","examples/notebook_population.ipynb","examples/notebook_solar_system.ipynb","examples/old/basic_example.ipynb","examples/old/workshop_example_notebook.ipynb","functions.rst","grid.rst","grid_options_descriptions.rst","index.rst","modules.rst","plot_functions.rst","population_extensions/HPC.rst","population_extensions/analytics.rst","population_extensions/cache.rst","population_extensions/condor.rst","population_extensions/dataIO.rst","population_extensions/distribution_functions.rst","population_extensions/grid_options_defaults.rst","population_extensions/gridcode.rst","population_extensions/metadata.rst","population_extensions/slurm.rst","population_extensions/spacing_functions.rst","population_extensions/version_info.rst","readme_link.rst","run_system_wrapper.rst","stellar_types.rst","useful_funcs.rst"],objects:{"binarycpython.utils":[[1,0,0,"-","custom_logging_functions"],[2,0,0,"-","dicts"],[3,0,0,"-","ensemble"],[19,0,0,"-","functions"],[20,0,0,"-","grid"],[24,0,0,"-","plot_functions"],[38,0,0,"-","run_system_wrapper"],[39,0,0,"-","stellar_types"],[40,0,0,"-","useful_funcs"]],"binarycpython.utils.custom_logging_functions":[[1,1,1,"","autogen_C_logging_code"],[1,1,1,"","binary_c_log_code"],[1,1,1,"","binary_c_write_log_code"],[1,1,1,"","compile_shared_lib"],[1,1,1,"","create_and_load_logging_function"],[1,1,1,"","from_binary_c_config"],[1,1,1,"","return_compilation_dict"]],"binarycpython.utils.dicts":[[2,2,1,"","AutoVivificationDict"],[2,1,1,"","count_keys_recursive"],[2,1,1,"","custom_sort_dict"],[2,1,1,"","filter_dict"],[2,1,1,"","filter_dict_through_values"],[2,1,1,"","inspect_dict"],[2,1,1,"","keys_to_floats"],[2,1,1,"","merge_dicts"],[2,1,1,"","multiply_float_values"],[2,1,1,"","multiply_values_dict"],[2,1,1,"","normalize_dict"],[2,1,1,"","prepare_dict"],[2,1,1,"","recursive_change_key_to_float"],[2,1,1,"","recursive_change_key_to_string"],[2,1,1,"","set_opts"],[2,1,1,"","subtract_dicts"],[2,1,1,"","update_dicts"]],"binarycpython.utils.dicts.AutoVivificationDict":[[2,3,1,"","__getitem__"],[2,3,1,"","__iadd__"]],"binarycpython.utils.ensemble":[[3,2,1,"","BinaryCEncoder"],[3,2,1,"","binarycDecoder"],[3,1,1,"","binaryc_json_serializer"],[3,1,1,"","ensemble_compression"],[3,1,1,"","ensemble_file_type"],[3,1,1,"","ensemble_setting"],[3,1,1,"","extract_ensemble_json_from_string"],[3,1,1,"","format_ensemble_results"],[3,1,1,"","handle_ensemble_string_to_json"],[3,1,1,"","load_ensemble"],[3,1,1,"","open_ensemble"]],"binarycpython.utils.ensemble.BinaryCEncoder":[[3,3,1,"","default"]],"binarycpython.utils.ensemble.binarycDecoder":[[3,3,1,"","decode"]],"binarycpython.utils.functions":[[19,2,1,"","Capturing"],[19,1,1,"","bin_data"],[19,1,1,"","call_binary_c_config"],[19,2,1,"","catchtime"],[19,1,1,"","check_if_in_shell"],[19,1,1,"","conv_time_units"],[19,1,1,"","convert_bytes"],[19,1,1,"","convfloat"],[19,1,1,"","create_arg_string"],[19,1,1,"","create_hdf5"],[19,1,1,"","datalinedict"],[19,1,1,"","example_parse_output"],[19,1,1,"","filter_arg_dict"],[19,1,1,"","format_number"],[19,1,1,"","get_ANSI_colours"],[19,1,1,"","get_arg_keys"],[19,1,1,"","get_defaults"],[19,1,1,"","get_help"],[19,1,1,"","get_help_all"],[19,1,1,"","get_help_super"],[19,1,1,"","get_size"],[19,1,1,"","get_username"],[19,1,1,"","imports"],[19,1,1,"","is_capsule"],[19,1,1,"","isfloat"],[19,1,1,"","isint"],[19,1,1,"","load_logfile"],[19,1,1,"","make_build_text"],[19,1,1,"","mem_use"],[19,1,1,"","now"],[19,1,1,"","output_lines"],[19,1,1,"","pad_output_distribution"],[19,1,1,"","remove_file"],[19,1,1,"","temp_dir"],[19,1,1,"","timedelta"],[19,1,1,"","trem"],[19,1,1,"","verbose_print"],[19,1,1,"","write_binary_c_parameter_descriptions_to_rst_file"]],"binarycpython.utils.functions.Capturing":[[19,3,1,"","__enter__"],[19,3,1,"","__exit__"]],"binarycpython.utils.functions.catchtime":[[19,3,1,"","__enter__"],[19,3,1,"","__exit__"]],"binarycpython.utils.grid":[[20,2,1,"","Population"]],"binarycpython.utils.grid.Population":[[20,3,1,"","clean"],[20,3,1,"","evolve"],[20,3,1,"","evolve_single"],[20,3,1,"","exit"],[20,3,1,"","export_all_info"],[20,3,1,"","jobID"],[20,3,1,"","parse_cmdline"],[20,3,1,"","return_all_info"],[20,3,1,"","return_binary_c_defaults"],[20,3,1,"","return_population_settings"],[20,3,1,"","set"],[20,3,1,"","was_killed"]],"binarycpython.utils.plot_functions":[[24,1,1,"","color_by_index"],[24,1,1,"","dummy"],[24,1,1,"","parse_function_hr_diagram"],[24,1,1,"","parse_function_masses"],[24,1,1,"","parse_function_orbit"],[24,1,1,"","plot_HR_diagram"],[24,1,1,"","plot_masses"],[24,1,1,"","plot_orbit"],[24,1,1,"","plot_system"]],"binarycpython.utils.population_extensions":[[25,0,0,"-","HPC"],[26,0,0,"-","analytics"],[27,0,0,"-","cache"],[28,0,0,"-","condor"],[29,0,0,"-","dataIO"],[30,0,0,"-","distribution_functions"],[31,0,0,"-","grid_options_defaults"],[32,0,0,"-","gridcode"],[33,0,0,"-","metadata"],[34,0,0,"-","slurm"],[35,0,0,"-","spacing_functions"],[36,0,0,"-","version_info"]],"binarycpython.utils.population_extensions.HPC":[[25,2,1,"","HPC"]],"binarycpython.utils.population_extensions.HPC.HPC":[[25,3,1,"","HPC_can_join"],[25,3,1,"","HPC_check_requirements"],[25,3,1,"","HPC_dir"],[25,3,1,"","HPC_dirs"],[25,3,1,"","HPC_dump_status"],[25,3,1,"","HPC_get_status"],[25,3,1,"","HPC_grid"],[25,3,1,"","HPC_id_filename"],[25,3,1,"","HPC_id_from_dir"],[25,3,1,"","HPC_job"],[25,3,1,"","HPC_jobID"],[25,3,1,"","HPC_jobID_tuple"],[25,3,1,"","HPC_job_task"],[25,3,1,"","HPC_job_type"],[25,3,1,"","HPC_join_from_files"],[25,3,1,"","HPC_join_previous"],[25,3,1,"","HPC_joinlist"],[25,3,1,"","HPC_load_joinfiles_list"],[25,3,1,"","HPC_make_joiningfile"],[25,3,1,"","HPC_njobs"],[25,3,1,"","HPC_path"],[25,3,1,"","HPC_queue_stats"],[25,3,1,"","HPC_restore"],[25,3,1,"","HPC_set_status"],[25,3,1,"","HPC_snapshot_filename"],[25,3,1,"","HPC_status"],[25,3,1,"","HPC_touch"]],"binarycpython.utils.population_extensions.analytics":[[26,2,1,"","analytics"]],"binarycpython.utils.population_extensions.analytics.analytics":[[26,3,1,"","CPU_time"],[26,3,1,"","make_analytics_dict"],[26,3,1,"","set_time"],[26,3,1,"","time_elapsed"]],"binarycpython.utils.population_extensions.cache":[[27,2,1,"","cache"]],"binarycpython.utils.population_extensions.cache.cache":[[27,2,1,"","NullCache"],[27,3,1,"","default_cache_dir"],[27,3,1,"","setup_function_cache"],[27,3,1,"","test_caches"]],"binarycpython.utils.population_extensions.cache.cache.NullCache":[[27,3,1,"","__delitem__"],[27,3,1,"","__getitem__"],[27,3,1,"","__setitem__"],[27,3,1,"","popitem"]],"binarycpython.utils.population_extensions.condor":[[28,2,1,"","condor"]],"binarycpython.utils.population_extensions.condor.condor":[[28,3,1,"","condorID"],[28,3,1,"","condor_check_requirements"],[28,3,1,"","condor_dirs"],[28,3,1,"","condor_grid"],[28,3,1,"","condor_outfile"],[28,3,1,"","condor_queue_stats"],[28,3,1,"","condor_status_file"],[28,3,1,"","condorpath"],[28,3,1,"","get_condor_status"],[28,3,1,"","make_condor_dirs"],[28,3,1,"","set_condor_status"]],"binarycpython.utils.population_extensions.dataIO":[[29,2,1,"","dataIO"]],"binarycpython.utils.population_extensions.dataIO.dataIO":[[29,3,1,"","NFS_flush_hack"],[29,3,1,"","NFSpath"],[29,3,1,"","compression_type"],[29,3,1,"","dir_ok"],[29,3,1,"","load_population_object"],[29,3,1,"","load_snapshot"],[29,3,1,"","locked_close"],[29,3,1,"","locked_open_for_write"],[29,3,1,"","merge_populations"],[29,3,1,"","merge_populations_from_file"],[29,3,1,"","open"],[29,3,1,"","save_population_object"],[29,3,1,"","save_snapshot"],[29,3,1,"","set_status"],[29,3,1,"","snapshot_filename"],[29,3,1,"","wait_for_unlock"],[29,3,1,"","write_binary_c_calls_to_file"],[29,3,1,"","write_ensemble"]],"binarycpython.utils.population_extensions.distribution_functions":[[30,2,1,"","distribution_functions"]],"binarycpython.utils.population_extensions.distribution_functions.distribution_functions":[[30,3,1,"","Arenou2010_binary_fraction"],[30,3,1,"","Izzard2012_period_distribution"],[30,3,1,"","Kroupa2001"],[30,3,1,"","Moe_di_Stefano_2017_multiplicity_fractions"],[30,3,1,"","Moe_di_Stefano_2017_pdf"],[30,3,1,"","build_q_table"],[30,3,1,"","calc_P_integral"],[30,3,1,"","calc_e_integral"],[30,3,1,"","calc_total_probdens"],[30,3,1,"","calculate_constants_three_part_powerlaw"],[30,3,1,"","const_distribution"],[30,3,1,"","cosmic_SFH_madau_dickinson2014"],[30,3,1,"","duquennoy1991"],[30,3,1,"","fill_data"],[30,3,1,"","flat"],[30,3,1,"","flatsections"],[30,3,1,"","gaussian"],[30,3,1,"","gaussian_func"],[30,3,1,"","gaussian_normalizing_const"],[30,3,1,"","get_integration_constant_q"],[30,3,1,"","get_max_multiplicity"],[30,3,1,"","imf_chabrier2003"],[30,3,1,"","imf_scalo1986"],[30,3,1,"","imf_scalo1998"],[30,3,1,"","imf_tinsley1980"],[30,3,1,"","interpolate_in_mass_izzard2012"],[30,3,1,"","ktg93"],[30,3,1,"","linear_extrapolation_q"],[30,3,1,"","merge_multiplicities"],[30,3,1,"","number"],[30,3,1,"","poisson"],[30,3,1,"","powerlaw"],[30,3,1,"","powerlaw_constant"],[30,3,1,"","powerlaw_constant_nocache"],[30,3,1,"","powerlaw_extrapolation_q"],[30,3,1,"","raghavan2010_binary_fraction"],[30,3,1,"","sana12"],[30,3,1,"","three_part_powerlaw"]],"binarycpython.utils.population_extensions.grid_options_defaults":[[31,2,1,"","grid_options_defaults"]],"binarycpython.utils.population_extensions.grid_options_defaults.grid_options_defaults":[[31,3,1,"","default_cache_dir"],[31,3,1,"","get_grid_options_defaults_dict"],[31,3,1,"","get_grid_options_descriptions"],[31,3,1,"","grid_options_description_checker"],[31,3,1,"","grid_options_help"],[31,3,1,"","print_option_descriptions"],[31,3,1,"","write_grid_options_to_rst_file"]],"binarycpython.utils.population_extensions.gridcode":[[32,2,1,"","gridcode"]],"binarycpython.utils.population_extensions.gridcode.gridcode":[[32,3,1,"","add_grid_variable"],[32,3,1,"","delete_grid_variable"],[32,3,1,"","rename_grid_variable"],[32,3,1,"","update_grid_variable"]],"binarycpython.utils.population_extensions.metadata":[[33,2,1,"","metadata"]],"binarycpython.utils.population_extensions.metadata.metadata":[[33,3,1,"","add_ensemble_metadata"],[33,3,1,"","add_system_metadata"]],"binarycpython.utils.population_extensions.slurm":[[34,2,1,"","slurm"]],"binarycpython.utils.population_extensions.slurm.slurm":[[34,3,1,"","get_slurm_status"],[34,3,1,"","make_slurm_dirs"],[34,3,1,"","set_slurm_status"],[34,3,1,"","slurmID"],[34,3,1,"","slurm_check_requirements"],[34,3,1,"","slurm_dirs"],[34,3,1,"","slurm_grid"],[34,3,1,"","slurm_outfile"],[34,3,1,"","slurm_queue_stats"],[34,3,1,"","slurm_status_file"],[34,3,1,"","slurmpath"]],"binarycpython.utils.population_extensions.spacing_functions":[[35,2,1,"","spacing_functions"]],"binarycpython.utils.population_extensions.spacing_functions.spacing_functions":[[35,3,1,"","const_dt"],[35,3,1,"","const_int"],[35,3,1,"","const_linear"],[35,3,1,"","const_ranges"],[35,3,1,"","gaussian_zoom"],[35,3,1,"","peak_normalized_gaussian_func"]],"binarycpython.utils.population_extensions.version_info":[[36,2,1,"","version_info"]],"binarycpython.utils.population_extensions.version_info.version_info":[[36,3,1,"","minimum_stellar_mass"],[36,3,1,"","parse_binary_c_version_info"],[36,3,1,"","return_binary_c_version_info"]],"binarycpython.utils.run_system_wrapper":[[38,1,1,"","run_system"]],"binarycpython.utils.useful_funcs":[[40,1,1,"","calc_period_from_sep"],[40,1,1,"","calc_sep_from_period"],[40,1,1,"","maximum_mass_ratio_for_RLOF"],[40,1,1,"","minimum_period_for_RLOF"],[40,1,1,"","minimum_separation_for_RLOF"],[40,1,1,"","ragb"],[40,1,1,"","roche_lobe"],[40,1,1,"","rzams"],[40,1,1,"","zams_collision"]]},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"0":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,25,27,30,32,35,40],"00":[5,11,12,15,18],"000":[5,11,18],"0000":[5,11,18],"00000":18,"000000":18,"000000000000e":11,"000000e":18,"000001":11,"000002":11,"000003":11,"0001":[5,7,40],"000122339":15,"000161974":15,"000214449":15,"000220016":15,"000283924":15,"000287968":15,"000375908":15,"000497691":15,"000498487":15,"00065893":15,"0007":30,"000872405":15,"001":[0,5,7],"00115504":15,"0013":5,"00152924":15,"00182":5,"002":[5,17,18],"00202467":15,"0021272":5,"00215604":5,"00235329":5,"00237669":5,"00239838":5,"00242158":5,"00247821":5,"00247864":5,"00248439":5,"00254115":5,"00254512":5,"00256681":5,"00261516":5,"00268237":5,"00280816":5,"00283345":5,"00286793":5,"00288661":5,"00294":5,"00296406":5,"003":5,"00300971":5,"00303761":5,"00311757":5,"00317508":5,"00319483":5,"0034":5,"004":5,"004698855121516281":15,"005":5,"00518983":5,"0055":5,"00585495":5,"006":5,"0062211552141636295":15,"00632092":7,"00666382":5,"007":[5,16],"00707417":5,"00712":5,"00730797":5,"0074":5,"008":5,"0081514":5,"00823663875514986":15,"00832":5,"0087":5,"009":[5,16],"00984861":5,"00e":12,"01":[0,5,6,7,8,9,12,15,18],"010":5,"0102":5,"010905083645619543":15,"011":5,"0118":5,"012":5,"0122109":5,"012246630357e":15,"0128":5,"013":5,"0131145":5,"014":5,"0141":7,"0143651":5,"0143896":8,"014832":5,"015":5,"0152545":5,"0153961":5,"0155":5,"0156":5,"01561":5,"0156945":5,"0159":5,"016":5,"0162":5,"016309":8,"0163656":8,"0164":5,"0165":5,"0166":5,"0168":5,"0169":5,"017":[5,16],"0171":5,"0175264":8,"0176575":6,"01791":5,"018":5,"0182":5,"0184":5,"0187":5,"019":5,"0192009":5,"019715467199999996":8,"01e":12,"01t09":[6,8,12],"01t10":12,"02":[0,5,6,7,8,9,11,12,15,16,18,30,40],"020":5,"0208":5,"021":5,"0214":5,"0214824":5,"021960493499e":15,"022":5,"023":5,"0232618":5,"02379":5,"024":5,"0241634":5,"0245":5,"024684":5,"02473":5,"0248684":15,"025":5,"0250231":5,"0251003":5,"0259932":5,"026":5,"0261496":5,"027":5,"0276":5,"02786":5,"0278672":5,"028":5,"02823":5,"0283541":5,"029":5,"0290733":5,"0295":5,"0298011":5,"0298364":5,"02e":[8,12],"03":[0,1,5,7,8,12],"030":5,"0303129":5,"030499912298e":15,"031":5,"0316266":5,"0319":5,"032":5,"03221":5,"033":5,"0335":5,"0335017":5,"034":5,"03493":5,"03499999999999":14,"035":5,"03502960360000004":8,"03507":5,"036":5,"0367878":5,"037":5,"0385396":5,"039":5,"0393944":5,"0394":5,"0399":5,"03996e":5,"03e":12,"04":[0,5,7,12,18],"040":5,"041":5,"0411":5,"0414":5,"04198":5,"042":5,"0425":5,"043":5,"0434":15,"044":5,"0440989":5,"044142002936e":9,"04440288843805411":15,"0444029":15,"044572277695e":9,"044654032097e":9,"0448877":5,"0449442":5,"045":5,"045084306856e":9,"0459174":5,"046":5,"0461":5,"0469097":5,"047":[5,15,16],"0474164":5,"0474572":5,"048":[5,16,18],"049":5,"04924":5,"04e":12,"05":[0,5,7,8,9,12,15],"0501":5,"050651207308e":9,"051":[5,6],"0511173":5,"0512":5,"052":5,"0523":5,"0528412":5,"053":5,"0531294":5,"0533803":5,"0535":5,"0536749":5,"054":[5,30],"0547419":5,"055":5,"055188":5,"056":[5,16],"0563088":5,"057":5,"0570946":18,"0572914":5,"057949":5,"058":5,"0583837":5,"0585":5,"059":5,"05e":12,"05e51ba114934b37bab48f1db40b7333":15,"06":[0,5,8,9,11,12],"0608":5,"061":5,"061141":5,"0613":5,"062":5,"0621119":5,"0625403":5,"06257":5,"0626266":5,"063":5,"064":5,"0641":5,"06459059967730083":8,"0645906":8,"0649":5,"065":5,"06527":5,"066":5,"06696":5,"067":5,"0670735":5,"068":5,"0683196":5,"069":5,"06987":5,"06e":12,"07":[5,12,13,14,18,30,35],"070":[5,15],"0701913":5,"071":5,"07108":5,"0714679":5,"0717":5,"0719":5,"072":5,"0722":5,"0727126":5,"0727584":5,"074":5,"0744186":5,"0745":5,"07484":5,"075":5,"075416":5,"0755737":5,"076":5,"077":5,"0770302":5,"0772021":5,"0772781":5,"078":5,"0784":5,"0784722":5,"0787729":5,"0789786":5,"079":[5,6],"0791":5,"07e":12,"08":[0,5,8,12,18],"080763":11,"0808":5,"081":[5,6],"081024":6,"082":5,"0820":[0,7],"0823499":5,"0831":5,"0834973":18,"0837":5,"084":5,"0849409":5,"085":5,"086":5,"086004":5,"0868":5,"087":5,"0877":5,"0877243":5,"0878":5,"088":5,"089":5,"0890815":5,"0896":5,"08e":12,"08msun":[0,7],"09":[5,6,8,12],"090":5,"0900":18,"0902":[0,7],"0907":5,"0907537":5,"091":5,"0910814":5,"0913095":5,"09164":5,"092":5,"09295167374":12,"093":[6,16],"0931922":5,"094":[5,8],"094409257247e":15,"095":5,"0958704":5,"096":5,"09665":5,"0967":15,"097":5,"09706e":5,"09786":5,"098":[5,6],"0987206":5,"099":5,"0991059":5,"0993":5,"099417":8,"0995":5,"0m":12,"0mb":[8,12],"0msun":35,"0x146f912dbc60":7,"0x149c2e81ec10":11,"0x149c95c56c10":8,"0x14bf2250fdc0":6,"0x1528ac7290d0":15,"1":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,21,22,24,25,28,29,30,32,34,35,37,38,40],"10":[0,2,5,6,7,8,9,11,12,13,14,15,16,17,18,21,30,35,38],"100":[0,5,6,7,8,12,13,14,30,35],"1000":[0,7,8,21,35],"100000000000":[17,18],"1001":12,"1005":5,"101":5,"101038":5,"1012":5,"101323":5,"101955":5,"102":5,"1021":5,"1024mb":21,"1025":12,"102750e":18,"103":5,"1035":5,"103702":5,"103789":5,"104":[5,8],"1043":5,"104427":5,"104997":5,"105":[5,13,14],"105082":5,"10522":5,"105704":5,"106":5,"1062":5,"106368":5,"106545":5,"10689":5,"107":5,"107187":5,"1075":5,"10782":5,"108":[5,15],"1082":5,"1085":11,"108571":5,"10877":5,"1088":5,"109":[5,8],"10941":5,"109679":5,"1098":5,"1099":5,"10e":12,"11":[0,5,6,8,9,11,12,14,15,16,18],"110":5,"11003":11,"1104":5,"1108":5,"111":5,"111023":5,"111583":5,"11182":5,"112":5,"11239":5,"1124":5,"113":5,"1130":5,"11346":5,"113492":18,"1135":5,"11376":5,"114":5,"114678":5,"11491":5,"115":[5,30],"11506":5,"115297":5,"11558":5,"115722":5,"11582":11,"116":5,"11686":5,"11695":5,"117":5,"11707":5,"1173":5,"1178":5,"118":5,"11802":5,"118229":5,"11854":5,"119":5,"1193":5,"1199":5,"11e":12,"12":[0,5,6,9,11,12,14,15,16,18,19,30],"120":5,"120000":[0,7],"120066":5,"1204":[5,18],"121":5,"121263":5,"12136":5,"1219":5,"122":5,"1222":5,"123":5,"123048":5,"12325":11,"123635":5,"1237":5,"123794969278e":15,"1239555":8,"124":5,"1241251901":16,"124379":18,"124496":5,"12457":11,"12460":11,"12461":11,"124931":5,"12495":5,"125":[0,5,7],"12500":0,"12522":5,"1254":5,"12548":5,"125553":5,"125886":5,"125968":5,"126":5,"126532":5,"127":5,"12741":5,"127442":5,"127957":5,"128":5,"12806":5,"129":5,"12974":5,"129879":5,"12e":[1,6,9,11,12,13,14,15],"13":[0,5,6,7,8,9,11,12,14,15,16,18],"130":5,"1301":11,"1302":11,"1306":5,"130725":5,"131":5,"13108":18,"1314":5,"131680e":18,"132":5,"132057":5,"1326":5,"13267":5,"1327":5,"13298":5,"133":5,"1334":5,"134":[5,15],"13416":5,"1345":11,"1346":11,"13461":11,"1347":11,"1348":11,"1349":11,"135":5,"135101":5,"135164":5,"1354":12,"1355":12,"13567":9,"136":5,"1360":5,"13607":5,"13626":15,"137":5,"13700":[6,8],"137502":5,"1379":5,"13796e":5,"138":5,"1380":18,"139":5,"139044":5,"1392":5,"139293101586e":15,"139732":5,"1398":5,"13e3":[0,7],"14":[0,5,6,7,9,11,12,14,15,16,18],"140":5,"1403":30,"141":5,"14112":5,"141361":5,"1415":5,"142":5,"14212":5,"143":5,"144":5,"144141":5,"14439":5,"14461":11,"1449":[5,12],"145":5,"145296":5,"145632":5,"146":5,"1468":5,"146844":5,"147":5,"1471":5,"1473":5,"14764":5,"1478":5,"148":[5,18],"1485":5,"148721":5,"149":5,"1492":5,"1494":12,"1498":5,"14e":12,"15":[0,5,7,8,9,11,12,14,15,16,18,21,30],"150":[5,8,12,13,14,15],"15000":[0,5,7,9,11,15,16,18],"1502":5,"150217":5,"15042":5,"150681":5,"151":5,"1514":5,"151616":5,"1517":5,"15186":5,"152":5,"1521":5,"1527":5,"153":5,"153329":5,"153852":5,"1539":12,"154":5,"155":5,"1551":5,"1553":5,"155342":5,"155662":12,"155678":8,"15594":5,"156":[5,8,18],"1560":5,"1567":5,"1569":5,"157":5,"1571":5,"1575":5,"158":5,"1585":12,"1586":5,"158640":8,"15884":5,"159":[5,8],"15907":5,"1599":5,"15e":12,"15msun":30,"16":[0,5,8,12,14,15,16,18,30],"160":5,"1606":5,"160675":12,"161":5,"1610":5,"1612":5,"1618":5,"162":5,"162006":5,"162038":5,"1622":5,"1624":[5,12],"162454":12,"16265":5,"1627":11,"162734":11,"162941":5,"163":[5,8],"1631":5,"1633":5,"163481":8,"1635760192":6,"1635760194":6,"1635760256":8,"1635760377":8,"1635760613":12,"1635760806":14,"1635760813":14,"1635760967":15,"1635760970":15,"1635761189":12,"1637":5,"164":5,"164714":5,"165":5,"16539":5,"16564":5,"166":[5,8],"1663":5,"166559":5,"167":[5,12],"1670":5,"16729":5,"16733":5,"1674":[5,12],"1678":5,"168":[5,8],"16833":5,"16837":5,"168379":8,"168558":5,"168972":5,"169":5,"1691":5,"1695":5,"169775":12,"17":[5,6,8,12,14,15,16,18],"170":5,"1703":12,"1708":5,"171":5,"171096":5,"1713":5,"1715":5,"172":5,"172014":5,"1722":5,"1729":5,"173":5,"1736":5,"174":5,"174169":5,"1747":5,"1749":12,"175":5,"175004":5,"1753":5,"17588":5,"176":5,"176751":12,"177":[5,8],"177444":5,"1775":5,"177551":5,"177727":5,"178":5,"1780":12,"1781":5,"1783":5,"1784":5,"1786":5,"179":5,"179142":5,"1792":5,"17932":5,"1796":5,"18":[5,12,14,16,18],"180":5,"1804":5,"180453":5,"1806":5,"1807":5,"1808":5,"1809":5,"181":5,"1810":5,"18108":5,"1811":5,"1812":5,"181244":5,"1813":5,"18139":5,"1814":[5,12],"18148":5,"1815":5,"1816":5,"1817":5,"181795":5,"1818":5,"1819":5,"181971798545e":15,"182":5,"1821":5,"1822":5,"1823":5,"1824":5,"1825":5,"1826":5,"1827":5,"1828":5,"1829":5,"183":5,"1830":5,"183048":5,"1831":5,"1833":5,"1834":5,"1835":5,"1838":5,"1839":5,"183974":5,"184":5,"1841":5,"1843":5,"1844":5,"184464":5,"1845":5,"1846":5,"1847":5,"184829":5,"185":5,"1851":[5,12],"1854":5,"1858":5,"186":[5,12],"1865":9,"187":5,"1876":5,"187694":5,"1877":5,"1879":12,"187993":5,"188":5,"1882":5,"189":5,"189239":5,"19":[5,8,12,15,18],"190":[0,5,18],"19097":5,"191":5,"1910":12,"1915":5,"191543":5,"192":5,"1920":5,"1923":5,"193":5,"193528":5,"19366":5,"19393":5,"194":5,"1947":12,"195":5,"1951":[0,7],"19521":5,"196":5,"196046":5,"196177":5,"19622":5,"196311":5,"1967":5,"1968":12,"197":5,"1972":[0,7],"1973":5,"1975":[0,7],"1977":5,"197729":5,"197x":[0,7],"198":5,"1980":30,"1983":40,"1986":[0,7,30],"1987":5,"1989":[0,7,12],"199":5,"19907":5,"1991":30,"1992":[0,7],"1993":[0,7],"1996":40,"1998":[0,5,7,30],"1999":[0,7],"19e":12,"1aearth":16,"1ajupit":16,"1amar":16,"1amercuri":16,"1aneptun":16,"1apluto":16,"1asaturn":16,"1auranu":16,"1avenu":16,"1ckzg0p9":[22,37],"1dex":[12,13,14],"1e":[0,7,8,9,11,12,18],"1e2":[0,7],"1e9":[0,7],"1gyr":35,"1m":12,"1mb":[8,12],"1mearth":16,"1mjupit":16,"1mmar":16,"1mmercuri":16,"1mneptun":16,"1mpluto":16,"1msaturn":16,"1msun":35,"1muranu":16,"1mvenu":16,"1s":[8,12],"1y":[0,7],"2":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,18,19,21,22,24,25,28,30,34,35,37],"20":[0,5,6,8,9,12,13,14,15,16,18,35],"200":[0,5,7],"2000":[0,5,7],"2001":[13,14,30],"2002":[0,7],"2003":[0,7,30],"2004":[0,5,7],"2005":[0,5,7],"2008":5,"2009":[0,7],"201":5,"2010":[0,7,21,30],"2012":[0,7,30],"2013":[0,7],"2014":[0,5,7,30],"2015":[0,5,7],"2016":[0,7],"2017":[0,7,12,15,21,30],"2018":[0,1,5,7],"2019":[0,5,7,18],"202":5,"2020":[0,7],"2021":[0,5,6,8,12],"20211216":0,"202196":5,"202339":5,"202569":5,"20265":5,"202750e":18,"2029":5,"203":5,"2033":5,"204":5,"2044":5,"20447":5,"204663":5,"2048":12,"205":5,"2053":5,"205353":5,"205527":5,"205537":5,"2057":5,"206":[5,16],"2063":5,"20677":5,"207":5,"2071":12,"2075":5,"208":5,"2081":5,"208169":5,"208453":5,"20887":5,"208923":5,"209":5,"2091":12,"209274":5,"20938":5,"20980":5,"20e":[8,12],"21":[0,1,5,6,12,18],"210":[5,18],"21043":5,"211":[5,14],"2112":5,"2118":18,"212":5,"212034":5,"2122":12,"2127":5,"213":5,"2132":5,"21333":5,"213396":5,"2135":5,"213854":5,"214":5,"214274644851685":18,"2143":12,"2147":5,"215":5,"215504":5,"2156":5,"215638":5,"2157":5,"21587440567681537":15,"21587440567681548":15,"2158744056768156":15,"216":5,"21603":5,"216067":5,"2164":12,"216496":5,"216951":5,"217":5,"21764":5,"218":5,"2182":5,"218222":14,"21824":5,"2183":12,"21844":5,"219":5,"219029061236e":15,"219058":5,"2191":5,"21927":5,"21948":5,"21e":12,"22":[5,12,18],"220":5,"22036":5,"2206":12,"22098":5,"221":5,"2210":5,"2214":5,"2216":5,"221832":5,"222":5,"2221":5,"2224":5,"22281":5,"223":5,"2232":12,"2234":5,"224":5,"2245":12,"224923":5,"225":5,"225135":5,"22518":5,"22543":5,"2258":12,"226":5,"2261":5,"22611318083528548":8,"226424":5,"2266":5,"2268":5,"2269":12,"227":5,"227249":5,"2275":5,"22787":5,"227955577093495":15,"228":5,"2282":12,"228555":5,"229":5,"2291":5,"22936":5,"2295":5,"229591":5,"22e":8,"23":[5,12,15],"230":5,"2300":12,"230102":5,"2305":5,"230955":5,"231":5,"231680e":18,"231704":5,"232":5,"2329":12,"233":5,"2332":5,"2333":5,"2338":5,"234":[5,8],"2348":12,"235":[5,6],"23513":5,"2352":5,"235464":5,"235689312423":8,"236":[5,18],"2365":[12,18],"237":5,"2371":5,"237203":5,"237951":5,"238":5,"2383":12,"238584":5,"23894":5,"239":5,"239197":5,"239704":5,"24":[5,8,12],"240":5,"2400":12,"2403e":15,"2406":5,"24098":5,"241":5,"2413":5,"24165":5,"242":5,"2421":5,"242151":5,"2423":12,"242309":5,"2424":11,"243":[5,6],"243214":5,"243583":5,"2437":5,"2438":12,"2439":5,"244":[5,16],"2444":16,"244645":5,"245":5,"245209":5,"245223":5,"2454":12,"246":5,"2466":12,"246604":5,"246625":5,"246671":6,"247":5,"2472":5,"2477":[5,12],"248":[5,8],"248871":5,"249":5,"249106":5,"2492":12,"2493":5,"249848":5,"24e":12,"25":[0,5,8,12,18],"250":5,"25014bc73b334765a1c09a4e4a97ed66":12,"251":[5,8],"2514":5,"2516":12,"25164":5,"252":5,"2528":5,"252877":5,"2529":5,"253":5,"2537":12,"253705":5,"254":5,"2544031669784":15,"255":[0,5,7],"2551":5,"2552":5,"2554":12,"2556":5,"256":[5,6,21],"256488":5,"256783":5,"25694":5,"257":[5,40],"2570":12,"2572":15,"257278":5,"257437":5,"2576084265970895":15,"258":[5,8],"2583":5,"259":5,"2590":12,"25msun":[0,7],"26":[5,12],"260":5,"26051":5,"260676":5,"261":5,"2613":5,"261343":5,"26171201413c43f5b91552a374879940":6,"2618":5,"262":5,"2622":[5,12],"2626":5,"2629":5,"263":5,"263079":5,"2632":5,"263235":5,"2636":12,"264":5,"26416":5,"26441":5,"26456":5,"2646":18,"265":5,"2652":12,"266":5,"2663":5,"26637":5,"2664":5,"266485":5,"2666":12,"267":[5,8],"2670":5,"2671":5,"2672":5,"2673":5,"2674":5,"2676":5,"2677":5,"2678":5,"2679":5,"268":5,"2680":5,"2681":5,"2682":5,"2683":5,"2684":5,"2685":5,"2686":5,"2687":5,"2688":5,"2689":5,"269":5,"2690":5,"2691":[5,12],"2692":5,"2693":5,"2694":5,"2695":5,"2696":5,"2697":5,"2698":5,"2699":5,"27":[5,8,12,15],"270":5,"2700":5,"2701":5,"2702":5,"27025":5,"2703":5,"2704":5,"2705":5,"2706":5,"2707":5,"2708":5,"2709":5,"271":5,"2710":5,"2711":5,"2712":5,"2713":5,"2714":5,"27143e":15,"2715":5,"2716":5,"2717":5,"2718":5,"2719":5,"272":5,"2720":5,"2721":5,"2722":5,"2723":5,"2724":5,"2725":5,"2726":5,"2727":5,"2728":5,"2729":5,"272943":5,"273":5,"2730":5,"2731":5,"2732":5,"2733":[5,12],"2734":5,"274":5,"274206":5,"274445":5,"2746":12,"274854":5,"275":5,"2754":5,"27569e":5,"2757":12,"276":5,"2767":5,"277":5,"2773":5,"27734":5,"2775":12,"27767":5,"278":5,"27829":5,"279":5,"2791":5,"2795":12,"28":[5,7,8,9,11,12,21],"280":5,"2800":5,"2801":5,"2802":5,"28060251":30,"280723":5,"280749":5,"281":[5,40],"281309":5,"28134439269236855":15,"2816":5,"2819":5,"282":5,"282234":5,"2823":5,"282623":5,"283":5,"2831":12,"2834":5,"2835":5,"2836":5,"28369":5,"283972":5,"284":5,"2845":12,"2846":5,"285":5,"286":5,"2861":12,"287":5,"2871":5,"2873":5,"2875":12,"2878":5,"288":5,"2881":5,"288353":5,"28867":5,"289":5,"2891":12,"2898":5,"28984":5,"28e":8,"29":[5,8,12,15],"290":5,"290684":5,"291":5,"29136":5,"2914":5,"292":5,"2921":5,"2924":5,"292641":5,"2927":5,"293":5,"2930":12,"2934e":18,"293512":5,"294":[5,6],"29427":15,"29448":15,"29457":15,"2947":[12,15],"295":5,"295543":5,"296":5,"2961":5,"2965":12,"296544":5,"2967":5,"2969346":30,"297":5,"297187":5,"297506":5,"298":5,"29816":5,"298194":5,"2982":12,"299":5,"2991":5,"2996":5,"29e":12,"2b66f805db424c48a1d29c45092b6e3c":8,"2d":[0,7],"2e":[9,12,18],"2f":18,"2m":[8,12],"2mb":[8,12],"2msun":[0,7],"2s":12,"3":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,18,19,21,22,28,30,34,35,37],"30":[1,5,6,8,9,11,12,13,14,15,16,18],"300":[5,35],"3000":[0,7,16],"3002":5,"3008":5,"301":5,"3010":12,"301129":5,"301483":5,"3017":5,"302":[5,18],"3025":5,"302750e":18,"303":5,"3034":5,"3035":12,"303533":5,"3038":5,"30388e":5,"304":5,"3042":5,"30441":5,"3046":5,"3048":5,"305":5,"305334":5,"3059":12,"306":5,"30642":15,"3065":5,"306619":5,"3069":5,"307199":5,"3078":12,"308":5,"3081e":18,"3082":5,"308203":5,"3084":5,"309":5,"30902":15,"309361":5,"309461":5,"3096":5,"30975":5,"30e4":[0,7],"31":[0,5,7,8,12,18],"310":5,"3100":[5,12],"310029":5,"3101":5,"311":5,"312":[5,6],"3124":12,"312637":5,"3127":5,"313":5,"313623":12,"314":5,"31408":5,"314533":5,"3148":12,"315":5,"315124":5,"315223":5,"3154":5,"315404":5,"315903":5,"315973":5,"316":[5,8],"316118":5,"317":5,"3171":5,"3172":5,"3174":12,"3176":5,"317663":5,"317921":5,"318":5,"3185":5,"318753":5,"319":5,"3192":5,"3193":5,"31958":5,"3197":12,"31e":12,"32":[5,8,12,15,19,21],"320":5,"3205":15,"32076":5,"321":5,"321082":5,"3211":5,"32118":5,"3216":5,"321643":5,"322":5,"3223":5,"3228":[5,15],"32282":5,"323":5,"3231":[5,12],"323359":8,"3235":5,"324":5,"3243":5,"3244":5,"3245144":15,"3246":5,"3247":5,"3248":5,"325":5,"325197":5,"3256":12,"325743":5,"325965":5,"326":5,"326147":5,"32620":5,"32631":5,"3264":5,"326601":5,"32684":5,"327":5,"3273":[5,12],"328":5,"328066":5,"3282":5,"328512":5,"329":[5,8],"3294":12,"32e":12,"33":[0,5,12],"330":5,"331":5,"331680e":18,"332":5,"332091":5,"3321":12,"332251":5,"332777":5,"33295":5,"333":5,"333032":5,"3331":5,"334":5,"33451":5,"33469":9,"3348":12,"335":5,"335153":5,"3352":5,"335342":5,"335428":5,"33552":5,"335642":5,"335847":5,"336":5,"336295":5,"3368":5,"33699":15,"337":5,"33719":5,"337249":5,"3373":12,"338":[5,9],"33817":18,"33879":5,"339":5,"3394":12,"339587":5,"3396":5,"34":[5,6,7,8,9,11,12,13,15,16],"340":5,"34018":5,"340477":5,"34081":5,"341":5,"3412":5,"34126":5,"34175":5,"3419":5,"342":[5,12],"34213":9,"342134":5,"3422":12,"342474":5,"3429":5,"343":5,"3438":5,"344":5,"34421":18,"3445":12,"344772":5,"3448":5,"345":5,"34537":5,"345842":12,"346":5,"3461":5,"3462":5,"3464":12,"3469":5,"347":5,"3471":5,"347169":5,"347405":5,"347623":5,"348":[5,8],"3483":12,"34870":5,"349":5,"3495":5,"3497":5,"34e":8,"35":[5,8,12,30],"350":[5,12],"3502":5,"35051":5,"3507":5,"3509":12,"351":5,"351532":5,"3518":5,"352":5,"3529":5,"353":5,"3533":12,"353432":5,"3536":5,"354":5,"3540":18,"354576":5,"35487":5,"354981":5,"355":5,"3550":12,"35505":5,"355513":5,"3559":5,"356":5,"3563":5,"3568":12,"356812":5,"357":5,"358":5,"3583":5,"3588":12,"3589":5,"35895":5,"359":5,"3591":5,"359784":5,"359881":5,"3599":5,"36":[5,8,12,15],"360":5,"360093":5,"36016":5,"361":5,"3616":5,"362":5,"3622":12,"362601":5,"36298":5,"363":5,"3630":18,"3631":18,"36314":5,"3632":18,"36323":5,"3633":18,"3634":18,"3635":18,"364":5,"3640":12,"364017":5,"36403":5,"364747":5,"3649":5,"365":5,"3657":12,"365763":5,"365949":5,"366":5,"366259":5,"366392":5,"367":5,"367065497322e":15,"367268":5,"3674":5,"36747":5,"3676":12,"367793":5,"368":5,"368345":5,"3688":5,"369":5,"3695":5,"36957":5,"3698":5,"36e":12,"37":[5,8,12],"370":5,"3702e":18,"3706":12,"371":5,"371427":5,"371458":5,"371625":5,"3719":5,"372":5,"3726":[5,12],"3729":5,"373":5,"373282":5,"374":5,"37409":5,"3746":12,"374905":5,"375":5,"3752":5,"375537":5,"3757":5,"375712":5,"3758":5,"376":5,"376059":5,"3763":12,"376604":5,"3767":5,"377":5,"3771":5,"378":5,"3781":5,"3786":12,"37874":5,"379":5,"379292":5,"37e":12,"38":[0,5,8,12],"380":5,"38009":5,"380393":5,"380887":5,"381":5,"3811":12,"382":5,"382144":5,"382472":5,"383":5,"38316":5,"3832":12,"384":5,"3849":12,"385":5,"386":5,"387":5,"3875":12,"38788e":15,"388":5,"388321":5,"389":5,"38908":5,"389208":5,"38921":5,"389749":5,"38m":12,"39":[5,6,7,8,10,11,12,13,14,15,16,17],"390":5,"3905":12,"391":5,"3914":18,"39152e":5,"391798":5,"392":[5,18],"39205":15,"392194":5,"392487":5,"3927":18,"3928":[5,18],"3929":18,"393":5,"3930":[12,18],"3931":[12,18],"3932":18,"393886":5,"394":5,"394722435913e":15,"395":5,"39521":5,"3954":12,"3957":5,"3959":5,"396":5,"396133472739e":15,"396288708628e":15,"3963":5,"396675941641e":15,"3967":5,"397":5,"3971":5,"39754":15,"3977":12,"397754":5,"3978":5,"398":5,"39831":5,"39834":5,"398381":5,"398419":5,"398927":5,"399":5,"3995":5,"3999999999996":14,"3d":[0,7],"3e":18,"3m":12,"3mb":[8,12],"3msun":30,"3s":[8,12],"4":[0,1,5,6,7,8,9,10,11,12,13,14,15,16,18,20,29,30,35],"40":[5,8,12,13,14],"400":5,"4000":[0,12],"40049":5,"401":5,"4011":5,"401263":5,"4013":5,"401728":5,"4018":5,"402":5,"40238":5,"402750e":18,"402961":5,"403":5,"40339":5,"404":5,"4046":5,"404641347602e":15,"4048":5,"404962":5,"405":5,"405068":5,"405577":5,"406":[5,12],"407":5,"40735":5,"4076":5,"408":5,"409":5,"4098":5,"40e":12,"41":[5,12],"410":[5,18],"4101":5,"4102":5,"4108":5,"410828":5,"411":5,"411151":5,"412":5,"41238":5,"413":[5,6],"413467":5,"414":5,"41457":5,"4146":5,"41485":5,"414875":5,"415":5,"416":5,"416141":6,"4162":5,"417":5,"41726":5,"4176":5,"418":5,"418029":5,"4182":5,"4183":5,"4184":5,"4186":5,"41862":5,"418757":5,"4188":5,"419":5,"4192":5,"4197":5,"41996":5,"41e":12,"42":[0,5,8,12],"420":5,"420182":5,"4202":5,"420316":5,"4205":5,"42052":5,"42097":5,"421":5,"421365":5,"421436":5,"421475":5,"4218":5,"4219":5,"422":5,"422436":5,"42266":5,"4229":5,"423":5,"42362":5,"424":[5,6],"4243":5,"424712":5,"424924":5,"425":5,"4251":5,"4256":5,"425788":5,"426":5,"427":5,"427601421985e":15,"42785":5,"428":5,"428699":5,"429":[5,12],"429122":5,"429398":5,"42e":12,"42msun":[0,7],"43":[5,12],"430":5,"4304":5,"430936289925951":15,"431":5,"4311":5,"431313":5,"431680e":18,"43173":5,"432":5,"4321":5,"432729":5,"433":[5,15],"4330":5,"433207":12,"4333":5,"433477":5,"434":5,"43422e":15,"435":5,"4357":5,"435809":5,"436":5,"43618":5,"4365":5,"4369":5,"437":[5,12,15],"43711":15,"4379":5,"438":5,"4380":5,"4385":5,"438686":5,"4387":5,"438861":5,"439":5,"4397":15,"44":[5,12],"440":5,"441":5,"441158":5,"44170":5,"442":5,"44211":5,"4422":5,"44223e":5,"443":5,"4433":5,"4438":5,"444":[5,18],"444217227690e":15,"445":5,"4454":5,"4455":5,"44558":5,"445821":5,"446":5,"447":5,"447918":5,"448":5,"448242":5,"448401":5,"44852":5,"449":[5,12],"4493":5,"44e":12,"44msun":[0,7],"45":[5,6,8,12,15],"450":5,"4500":7,"45000000080":15,"4501":5,"4504":15,"450629":5,"4507":5,"450818":5,"450828476487e":15,"4509":5,"451":[5,8],"45114":5,"451192744924e":15,"451732":5,"452":5,"453":5,"4530":[9,11,18],"453059":12,"453317880232e":15,"453348":5,"453412":5,"453932":5,"454":5,"4540":5,"454013":5,"45407":15,"454268":5,"454409":5,"455":5,"45534":5,"455552":5,"456":12,"456313":5,"456519":5,"457":5,"45757":5,"457987":5,"458":5,"458064":5,"458272":18,"4588":5,"45889":5,"459":5,"459382":5,"45msun":[0,7],"46":[5,8,12,15],"460":5,"460081":5,"46057":5,"46089":5,"462":[5,18],"4621":15,"4622":5,"46220":5,"4623":5,"462779538274e":15,"463":5,"463455":5,"464":5,"464494":5,"465":5,"465133":5,"46573":15,"465867":5,"46607":5,"4666":5,"4670":5,"4673":5,"467851":5,"468":5,"4680":8,"46822":5,"4683":5,"469":5,"46901":5,"469056":5,"469524":5,"47":[5,8,12],"470":5,"471":5,"4710":5,"471379":5,"4714":5,"472":[14,18],"472105":5,"472318":5,"4734":5,"473762":5,"474":5,"47419":5,"475":5,"4752":5,"475287":5,"47534":5,"4755":5,"4759":5,"476":5,"4764":5,"476589":5,"477":5,"477089":5,"4773":5,"47745":15,"477535":5,"477791":5,"478":5,"478253":5,"478315":5,"4788":5,"478807":5,"479":5,"47946":5,"4797":5,"479973":5,"48":[5,12],"480":5,"480045":5,"48046":5,"4807":5,"4809":5,"481":5,"482":5,"4822":5,"4825":5,"482668":5,"483":5,"48336":5,"4838":[7,9,11],"484":5,"4845":5,"485":5,"48586":5,"486":5,"4862":5,"4865":5,"4867":5,"4872":5,"48749":5,"4877":5,"488":5,"48809":5,"489":5,"489077":5,"48926":5,"48e":[8,12],"49":[5,6,12],"490":5,"491":5,"491811":5,"492":5,"492242":5,"492302":5,"492484":5,"492707":5,"492818":5,"493":5,"493648":5,"493975":5,"494":5,"4945":5,"4949":5,"495":5,"4957":5,"4959":5,"495924":5,"496":5,"4961":5,"496312":5,"4966016":14,"497":5,"497008":5,"497294":5,"498":5,"4981":5,"498232":5,"499":5,"49e":12,"4b8c7f4a86e445099d73f27dffaad94b":14,"4e":[0,7,18],"4e3":[0,7],"4m":12,"4mb":[8,12],"4s":[8,12],"5":[0,1,5,6,7,8,9,10,11,12,13,14,15,16,18,27,29,30,32],"50":[0,5,7,8,12,14],"500":[0,5,7],"500000e":18,"501":5,"5017":5,"502":5,"502451":5,"502775":5,"502841":5,"503":5,"503726":5,"504":5,"5043":5,"5046":5,"505":5,"5051":5,"50537":5,"506":5,"5064":5,"50652":5,"5066257":14,"50682":5,"50687":5,"507":5,"507104":5,"507443":5,"508":[5,15],"5089":5,"509":5,"5094":5,"50973":5,"50e":12,"50fb66cc659c46c8bbc29fe0c8651c2f":15,"51":[5,8,12],"510":5,"511":5,"511114":5,"5112":5,"5114":5,"5117":5,"512":5,"512561":5,"512617":5,"512mb":21,"513":5,"514":5,"514087":5,"51478":5,"514898":5,"514916":5,"515":12,"515062":5,"5164":5,"517":5,"51742":5,"517454":5,"5175":5,"518":5,"51803":9,"51809":5,"51819":5,"518397":5,"518757914":13,"518851":5,"519":5,"51e":12,"52":[5,6,8,12],"52058":5,"5208":5,"520903":5,"5217":5,"522":5,"5221":5,"523":5,"523485":5,"523561":5,"524":5,"52414":15,"52415":15,"5244":5,"524629":18,"524755":5,"525":5,"526":5,"527":5,"528":5,"528102":5,"5286":5,"529":5,"5294":15,"52e":12,"53":[5,6,8,12],"530":5,"5301":5,"5309":5,"531":5,"531293":5,"531411":5,"5317":5,"532":5,"5324":5,"533":5,"5333":5,"534":5,"534699":5,"535":5,"5358":5,"536":5,"5366":5,"53715":5,"5374":5,"537743":5,"538":5,"53854":5,"539":5,"539343":5,"539941":5,"53e":12,"54":[5,12],"54027":5,"5403":5,"541":5,"541792":5,"542":5,"5423":5,"542419":5,"543":5,"54307":5,"54371":5,"544":5,"54439":5,"544482":5,"545":5,"5456":5,"545743":5,"546":5,"5462":5,"547002":5,"547729":5,"548":5,"5483":15,"548589":5,"548740826516e":15,"548864":5,"549":5,"5493":5,"54949":5,"55":[5,6,8,12,14,15,30],"550575":5,"551":[5,6],"551072":5,"552":5,"552711":5,"5528":5,"553":5,"5532":5,"554":5,"55458":9,"55473":5,"555":[5,8],"5556":5,"5557":5,"557":5,"558":5,"559":5,"5593":5,"55982":5,"559889":5,"55e":12,"56":[5,8,12,15],"560118":5,"5603":5,"561":5,"5612":5,"5619":5,"562":5,"562029":18,"56228":5,"564":5,"565":5,"56518":5,"5652":5,"566":[5,18],"566263":5,"56631":5,"566495":5,"567":5,"567303":5,"567898":5,"568":5,"5681":5,"56865":5,"569":5,"569581":5,"5696":5,"56e":12,"57":[5,6,8,12],"570":5,"570222":5,"5703":5,"57062":5,"57093":5,"571":5,"5712":5,"57141":5,"5717":15,"572":5,"573":5,"5734":5,"5735":5,"573703":5,"5738":5,"573874":5,"574":5,"57443":9,"574826":5,"575":5,"57538":5,"57571":15,"576":5,"577":5,"57739":5,"5775":5,"577826":5,"578":5,"57878":5,"579":5,"579099761269e":15,"5791":5,"5794":5,"5795":5,"5796":5,"5798":5,"58":[5,12],"581":5,"5812":5,"581558":5,"58166":5,"582":5,"582318":5,"583":5,"58332":5,"583346":5,"5834":0,"583436":5,"584622":5,"585":5,"58504":5,"58518":15,"585985":5,"586":5,"587":[5,14],"588":5,"588396":5,"5885":5,"589":5,"58e":8,"59":[5,6,12],"590":5,"5904":5,"590877":5,"591":5,"5919":5,"592":5,"592309":5,"592733":5,"593":5,"594":5,"59429":5,"59452":9,"595":5,"596":[5,12],"59616":5,"596161":5,"597":5,"5977":5,"598":5,"5982":5,"59867":5,"59e":12,"5dex":[8,12,13,14],"5e":12,"5m":12,"5mb":[8,12],"5msun":[0,7],"5s":12,"6":[0,1,5,6,7,8,9,10,11,12,13,14,15,18,22,37],"60":[5,12,15,29],"600":5,"6000":[0,7],"600000":0,"60007":15,"600258":5,"600593":5,"6008":5,"601":5,"60101":5,"602":5,"603":[5,12],"6032":5,"604":5,"60468":5,"605":5,"60547":5,"6058":5,"606":[5,12],"606169":5,"60636":5,"607":12,"608":[5,12],"608269":5,"608402":18,"608485":5,"608655":5,"60876":5,"609":5,"6094":5,"61":[5,12],"610184":5,"610285":5,"611":[5,12],"61117":5,"611632":5,"611763":5,"611785":5,"612":[5,12],"612281":5,"613":[5,12],"613167":5,"614":[5,12],"6145":5,"615":5,"615165":5,"61521":5,"616":[5,12],"6161":5,"616737":5,"61679":5,"617":[5,12],"617224":5,"6179":5,"618":5,"6181":5,"6182":5,"618382":5,"618445":5,"6185":5,"618705":5,"619":[5,12],"619099":5,"61e":12,"62":[0,5,12],"620":12,"621":14,"6212":5,"62124":18,"621375":5,"6215":5,"62172":11,"622":5,"62200":5,"622081":5,"622494":5,"6225":5,"623":12,"623052":5,"623232":5,"623354":5,"62366":5,"624":[5,12],"624125":5,"6249793":15,"625":[0,5],"62549":5,"626":[5,12],"627748":18,"628":[5,12],"628169":5,"629":[5,12],"63":[5,8,12],"630":12,"631":[5,8],"63153":5,"632":[5,12],"6328":5,"633":5,"633148":5,"633684":5,"634":[5,12],"634261":5,"6344":5,"634667":18,"635":[0,7,12],"63566e":5,"635703":5,"636":12,"636985":5,"637":[5,12],"637666":5,"637754":5,"6379":5,"638":[5,12],"63818":5,"6384":5,"6388":5,"639":[5,12,18],"63923":5,"639951":5,"63e":12,"64":[5,12],"640":[5,12],"6409":5,"641":12,"6413":5,"64137":5,"642":12,"64207":5,"64265":5,"6429":5,"643":12,"64359":5,"6438124832773024":12,"644":[5,12],"644553":11,"64463":5,"645":[5,11,12,18],"645286":5,"645339":5,"645763":5,"646":5,"64611":5,"646273":5,"647":5,"647161":5,"64724":5,"6474":5,"6475":5,"648":5,"648549":5,"6485656144116352":12,"648566":12,"6489":5,"6492":5,"6493":5,"64932":5,"649327":5,"64e":12,"65":[5,12,35],"651":5,"6514":5,"6515":5,"65262":5,"652638":12,"652755":5,"653":[5,15],"6548":5,"6550":5,"6552":5,"655371":5,"6556":5,"6559":5,"656":5,"6562":5,"657":5,"6571":5,"6579":5,"658":5,"6588":5,"659":5,"659393":5,"659448":5,"659469":5,"659526":5,"659581":5,"659743":5,"65976":5,"65e":12,"66":[5,12],"66003":15,"66016":5,"66025":5,"6602514":12,"6604":5,"660415":5,"661":5,"661725":5,"662":5,"6626":5,"663":5,"663251":5,"663976":5,"664":5,"664546":5,"6649":5,"665406":5,"66554":5,"665969":5,"666661":5,"667":5,"6674":5,"668":5,"668328":5,"669":5,"66915":5,"669442":5,"66e":12,"67":[5,12],"670":5,"67023":5,"670337":5,"670413":5,"670422":5,"67059":5,"671":5,"671001":5,"671551":5,"67179":5,"672":5,"67245":5,"673":5,"674":5,"674063083432e":15,"6745":5,"674645":5,"6747":5,"6749":5,"675":5,"675689":5,"6758":5,"67586e":15,"676":5,"676181":5,"676215":5,"6764":5,"6765":5,"677":5,"6771":5,"677623":5,"678":5,"679":[5,8],"679223":5,"6797":5,"67e":12,"68":[5,8,12],"681":5,"681473":5,"681487":5,"6816":5,"682":[5,8],"6822":5,"683":5,"6831":5,"6832":5,"6834":5,"683467":5,"68376":5,"684":[5,8,15],"684890":12,"685":[8,12],"685255":5,"685872":5,"686":5,"686591":5,"687":[5,8],"68746":5,"68748":15,"688":[5,8],"6883":5,"6885":5,"689":5,"689781":5,"689835":5,"68e":12,"69":[5,12],"690":12,"690194":12,"690203":5,"6905":5,"690746":5,"6908":5,"6909":5,"691":[5,8],"691586":5,"692":5,"693":[5,8],"693128":5,"693321":5,"6934":5,"693944":5,"694":[5,8,12],"6944":0,"694517":12,"695":[5,15],"6952":5,"695505":5,"69569":5,"696":5,"696003":18,"696284":5,"697":5,"6975":5,"697827":5,"698":[5,12],"69808":5,"698517":5,"6989":5,"699":5,"6e":[8,12],"6e1":30,"6e5":[0,7],"6m":12,"6mb":[8,12],"6msun":[0,7],"6s":[8,12],"7":[0,1,5,6,7,8,9,11,12,13,14,15,17,18,22,30,37],"70":[5,8,12,15,30],"700":[5,18],"70005":5,"700359":5,"70043":5,"70052":5,"70054":5,"701":5,"702":5,"70235":5,"7028":5,"703":5,"703545":5,"70365":5,"704":5,"70429":5,"7046":5,"705":[5,18],"7052":5,"705715":5,"706":5,"7060":5,"706029":5,"706126":5,"706483":5,"706780":12,"7069":5,"706984":5,"707":[5,12],"708":5,"7085":5,"7087":18,"709":5,"7093":5,"709965":5,"70e":12,"71":[5,12],"710":5,"71025":15,"7106":18,"7107":5,"7108":5,"711":5,"7114":5,"71196":15,"712":5,"712414":5,"7128":15,"713946":5,"714712":5,"716":[5,11],"71617":11,"71662":9,"71746":5,"71818":5,"7184":5,"718549":5,"7188":5,"719058":5,"71e":12,"72":[5,12],"720749":5,"721":5,"7210":5,"7214":5,"7219":5,"722":5,"72386":5,"724":[5,9],"72498e":[9,15],"725":5,"725718":5,"726":18,"726002":5,"72611":5,"72617":5,"7267":5,"7269":5,"727":5,"727196":5,"72764":5,"728":[5,8],"7282":5,"728237":5,"72832e":5,"728797":5,"729":5,"729193":5,"7292":5,"7296":5,"72983":5,"72e":12,"73":[5,12,15],"730":5,"731":5,"7315":5,"7319":5,"732":5,"7322":5,"732244":8,"7324":5,"7326":5,"732818":5,"732953":5,"732983":5,"7335":5,"734":5,"7342":5,"734534":5,"735":5,"7354":5,"7359":5,"736":[5,8],"736112":5,"7365":5,"737":5,"7370":5,"737411":5,"738":5,"7380":5,"7381":5,"738399":5,"7384":5,"7385":5,"738524":5,"7386":5,"739":5,"7390":5,"739962":5,"73e":12,"74":[5,12],"740":5,"740494":5,"740929":5,"7413":5,"741346":5,"741448":5,"7418":5,"7419":5,"742":5,"7420":5,"7421":5,"7422":5,"7423":5,"7424":5,"7425":5,"7426":5,"7427":5,"7428":5,"7429":5,"743":5,"7430":5,"7431":5,"743118":5,"7432":5,"7433":5,"7434":5,"7435":5,"7436":5,"7437":5,"7438":5,"743837":5,"7439":5,"744":5,"7440":5,"7446":5,"7447":5,"7448":5,"7449":5,"745":5,"7450":5,"7451":5,"7452":5,"7453":5,"7454":5,"7455":5,"7456":5,"7457":5,"7458":5,"74583":5,"7459":5,"746":5,"7460":5,"7461":5,"7462":5,"747":5,"7472":5,"748":[5,18],"748832":5,"749":5,"75":[0,5,8,12],"750":[5,6],"7500":5,"75005":5,"750149":5,"750806":5,"7509":18,"751305":5,"752":5,"752134":5,"752438":5,"7527":5,"753":5,"7530":5,"7536":5,"7537":5,"754":5,"754141":5,"7544":5,"755":5,"75508":5,"755323":5,"7554":5,"7557":5,"756":5,"7561":15,"7564":5,"7566":5,"756795":5,"757":[5,8],"757025":5,"7572":5,"758":[5,18],"7582":5,"7589":5,"759":5,"75921":5,"75931":5,"7595":5,"7598":5,"75e":12,"76":[5,12],"760064":5,"760389":5,"7605":5,"7607":5,"761":5,"7612":5,"7613":5,"76134":5,"761478":5,"7617":5,"7619":0,"7620":5,"7622":5,"7626":5,"7629":5,"763":[5,30],"7631":5,"7633":5,"7635":5,"764":5,"76416e":5,"7644":5,"7645":5,"764629":5,"7647":5,"7647737053496777":15,"764989":5,"765":5,"7650":5,"7657":5,"7659":5,"766":5,"766094":5,"7666":5,"7669":5,"767":5,"7671":5,"7675":5,"7677":5,"7678":5,"7679":5,"768":5,"7683":5,"768339":5,"7684":5,"768655":5,"7689":5,"769":5,"7690":5,"7691":5,"769195":5,"7695":18,"76e":8,"77":[5,12,14],"7705":5,"770532":5,"7706":5,"7709":5,"7714":5,"7717":5,"7718":5,"772":5,"7720":5,"7721":5,"772169325355e":15,"7722":5,"7727":5,"7728":5,"77287":15,"773":5,"7730":5,"7731":5,"773166":5,"7734":5,"7735":5,"7736":5,"7737":5,"774":5,"7741":5,"77416":5,"7742":5,"7743":5,"7745":5,"77455":5,"7748":5,"774954":5,"774969":5,"775":[5,18],"7750":5,"77505":5,"7751":5,"7752":5,"77541":5,"7757":5,"7759":5,"776":[5,18],"7761":5,"77624":5,"776263":5,"77631":5,"7764":5,"7765":5,"776523":5,"7766":5,"7767":5,"776818":5,"7769":5,"777":5,"7772":5,"7773":[5,18],"7774":5,"77766":5,"7779":5,"778":5,"7781":5,"7782":5,"7785":5,"7789":5,"779":5,"7790":5,"779197348711e":15,"7792":5,"7795":5,"7797":5,"78":[5,12],"78012":5,"7803":5,"7806":5,"7809":15,"781":5,"781046":5,"78125":0,"7813":5,"7817":5,"7819":5,"782":5,"7823":5,"7825":5,"7826":5,"7827":5,"7828":5,"783":[5,11],"7831":5,"7836":5,"783746":5,"783792":5,"784":5,"7840":5,"7842":5,"7843":5,"7844":5,"7845":5,"7848":5,"78488":5,"784972":5,"785":5,"7852":5,"785539":5,"7856":5,"7858":5,"786":5,"786062":5,"7861":5,"7863":5,"7864":5,"7868":5,"786e":18,"787":5,"7871":5,"787102":5,"787368":5,"7874":5,"7875":5,"7877":5,"787705":5,"7879":5,"788":5,"78817":18,"7882":5,"7883":5,"7886":5,"7887":5,"789":5,"789064":5,"7891":5,"789188":5,"7893":5,"7898":5,"789859":5,"7899":5,"78e":12,"79":[5,12],"7901":5,"7902":5,"7903":5,"7905":5,"7907":5,"7909":5,"79092":15,"790941":5,"791":5,"7911":5,"7912":5,"791274":5,"7913":5,"791478":5,"7916":5,"7918":5,"7919":5,"791991":5,"792":5,"7920":5,"7925":5,"7926":5,"79264":5,"7927":5,"792721":5,"792744":5,"7928":5,"7933":5,"7934":5,"7936":5,"793832":5,"7941":5,"79412":5,"7942":5,"7943":5,"7944":5,"79487":15,"795":[5,30],"795024":5,"7958":5,"796":5,"7960":5,"7962":5,"7964":5,"796455":18,"7965":5,"7967":5,"7968":5,"7969":5,"797":5,"7973":5,"7974":5,"7975":5,"7979":5,"798":5,"7980":5,"7982":5,"7988":5,"799":5,"7990":5,"79911":5,"7996":5,"7997":5,"799889":5,"79e":12,"7a2e4301f5224b2cb8939d2297df0aad":14,"7e":12,"7m":12,"7mb":12,"7s":8,"8":[0,3,5,6,7,8,9,11,12,13,14,15,18,29,30],"80":[5,12,30,35],"800":6,"8000":5,"8001":5,"8003":5,"8004":5,"8008":5,"8009":5,"801":5,"8010":5,"8012":5,"8013":5,"802":5,"802706":6,"802986496151e":15,"803":5,"8031":5,"8034":5,"8039":5,"804":5,"80402":5,"8043":5,"8044":5,"8047":5,"8048":5,"804961":5,"805":5,"8050":5,"8053":5,"8055":5,"805733":5,"8058":5,"8059":5,"80592":15,"806":5,"8060":5,"80602":18,"8062":5,"806431":5,"8065":5,"8066":5,"8067":5,"806722":5,"807":5,"8071":5,"8073":5,"807331":5,"807361":5,"8074":5,"807403":5,"8076":5,"8079":5,"808":5,"808134":5,"809":[5,6],"8091":5,"8095":5,"80954":5,"809662":5,"80e":12,"80msol":30,"81":[5,8,12],"810":8,"8101":5,"8104":5,"8105":5,"81066":15,"8107":5,"8108":5,"8109":5,"811":5,"8111":5,"8115":5,"812":5,"8121":5,"8123":5,"8124797":6,"813":5,"81352":5,"8138":5,"81395":9,"814":5,"8140":5,"8141":5,"814387":5,"81495":15,"81499":15,"815":5,"8151":5,"81529":15,"81536":15,"8155":5,"81562":5,"81563":15,"8158":5,"816":5,"8163":5,"81636":15,"81689":15,"816958":5,"817":[5,11],"81705":5,"817432":5,"817620e":18,"81762e":18,"817843":5,"817888":5,"818":5,"8182":5,"818294":5,"819":5,"8194":5,"8195":5,"81957":15,"8196":5,"819715":5,"8199":5,"81e":12,"82":[5,12],"8200":5,"8202":5,"8205":5,"82061":15,"82064":5,"82074":15,"82088":15,"821":5,"82123":15,"821301":5,"821367":5,"8216":15,"822":5,"82224":5,"8224":5,"82245":5,"82255":15,"823":5,"823059079115e":15,"82325":5,"8234":5,"823767":5,"824494":5,"8245":5,"8247":5,"824848":5,"82486":5,"8249":5,"825":5,"8250":5,"825086":5,"8251":5,"8252":5,"8254":5,"82563":12,"825648":5,"826":5,"8261":5,"8263":5,"82642":5,"826771":5,"8268":5,"826831":5,"827":5,"8271":5,"8276":5,"82797":5,"828":5,"8280":5,"828241":5,"828858":5,"829":5,"829017":5,"8292":5,"8293":5,"8295":5,"829668":5,"829726":5,"829757":5,"8299":5,"82e":12,"83":[5,8,12],"830":[5,18],"8300":5,"8303":5,"830541":5,"831236":5,"832":5,"832981":5,"833":5,"8339":5,"834303":5,"834483":5,"835":5,"8354":5,"836":[5,6],"836621":5,"83672":5,"836783":5,"837":5,"8372":5,"83762":5,"8377":5,"837816":5,"8379":5,"838":[5,6],"838411":6,"838423":5,"83843":5,"839":5,"8399":5,"83e":12,"84":[5,8,12],"840":5,"84029":5,"84071":5,"840796":5,"840994":5,"841":5,"841284":5,"841718":5,"8427e":18,"8429":5,"843":5,"8435":5,"8435e":18,"844":[5,6],"8441":5,"84428":5,"8443":5,"845":5,"84502":5,"8452":5,"845387":5,"845641":5,"846":[5,6],"846045":6,"847":5,"847153":5,"84827":5,"848380621869e":9,"848866":5,"8493":5,"85":[5,8,12,35],"850":5,"850309":5,"851":5,"851646":5,"852":5,"852252":5,"8523":5,"852712":5,"853":5,"8533":5,"854":5,"85406e":5,"8544":5,"8545":5,"854649":5,"855":5,"856":[5,12],"85661":18,"8569":5,"857":5,"8573":5,"857699":5,"8577":5,"858":[5,6],"8585":5,"859":5,"8596":5,"859753":5,"8598":5,"859977":5,"86":[5,8,12],"860402":5,"8605":5,"861":5,"861368":5,"863":[5,8],"86323":5,"86334":5,"8635":5,"8638":5,"865":5,"8653":5,"8654":5,"865806":5,"866":5,"8664":5,"867":5,"86728":5,"8674":5,"8678":5,"86794":5,"868":5,"8683":5,"86878":5,"869":5,"86918":5,"8694":5,"869544":5,"87":[5,12,15],"870":5,"8704":5,"8706":5,"8708":5,"871":5,"872":[5,15],"872312":5,"872316":5,"873":5,"8731":5,"873639":5,"874":5,"874638":5,"875":5,"876":5,"876084":5,"876382":5,"877":5,"877963":5,"878":5,"87813":5,"878253":5,"879":5,"8791":5,"87e":12,"88":[5,12],"880":5,"8805":5,"880528":5,"881":5,"8813":5,"882017":5,"8828":5,"883":5,"883252":5,"88343":5,"8837":5,"884":5,"8840":5,"8843":5,"88441":5,"884461":5,"8846":5,"8848":5,"885":5,"8851":5,"8853":5,"8855":5,"885537":5,"8856":5,"8858":5,"88581":5,"886":5,"8860":5,"8862":[5,15],"8864":5,"8866":5,"8867":5,"8868":5,"8869":5,"887":5,"8870":5,"8871":5,"8872":5,"8873":5,"8874":5,"8875":5,"8876":5,"8877":5,"8878":5,"888":5,"8880":5,"8881":5,"888123":5,"8882":5,"8884":5,"8886":5,"888613":5,"8887":5,"8889":5,"889":5,"8891":5,"8892":5,"8893":5,"8894":5,"8896":5,"8897":5,"8898":5,"8899":5,"89":[5,6,12,14],"890":5,"8901":5,"8902":5,"8903":5,"8904":5,"8906":5,"8907":5,"8908":5,"8909":5,"891":5,"8910":5,"891056":5,"8911":5,"8912":5,"8917":5,"892":5,"89211":18,"8924":5,"8926":5,"893":5,"8934":5,"8935":5,"8939":5,"893941":5,"894":5,"894041":5,"8941":5,"8949":5,"895":5,"895821":5,"896":5,"8961":5,"896110e":18,"896196":5,"896286":5,"8972":5,"8975":5,"897612":5,"898":5,"8982":5,"898786":5,"899":5,"8992":5,"899464":5,"8a7d52edc59346ce991063d9e05e9ba7":6,"8bc1eafea1c34b05894c1618639d8c37":15,"8e":[0,7],"8m":[8,12],"8mb":12,"8s":[8,12],"9":[0,5,6,7,8,9,11,12,14,15,18],"90":[5,8,12],"900":5,"901":5,"901988":5,"902":5,"903":5,"9032":5,"9036":5,"9038":5,"904":5,"9043":5,"9046":5,"9047":5,"905":5,"905335716621e":15,"9057":5,"906":5,"906059":5,"906299":5,"90695":5,"907":5,"9071":5,"90716":5,"9073":5,"9074":5,"908":5,"9087":5,"909":5,"9093":5,"9098":5,"90e":12,"91":[5,8,12],"910419":5,"9105":5,"910817":5,"910981":5,"911":5,"9110":5,"911093":5,"9113":5,"912":5,"912238":5,"912283":5,"912289":5,"912327":5,"9127":5,"912919":5,"913":5,"9139":5,"914":5,"9147":5,"9148":5,"915":[5,8],"915148":5,"915221":5,"9153":5,"91548":5,"916":5,"916093":5,"916207":5,"917":5,"917439":5,"9179":5,"918":5,"918543":5,"9189":5,"919":5,"9196":5,"91e":12,"92":[5,12],"920":5,"9203":5,"9206":5,"920832":5,"921":5,"9214":5,"922":5,"922199":5,"923":5,"92382":5,"924":5,"924056":18,"925":5,"9253":5,"9255":5,"9256":5,"925761":5,"926":5,"9263":5,"9264":5,"927":5,"929":5,"929511":5,"92995":5,"92e":12,"93":[5,12,15],"930":[5,14],"930282":5,"9304":5,"93044":5,"9308":5,"9309":5,"930943":5,"931":5,"9310":5,"932":5,"9323":5,"932839":5,"933":5,"9339":5,"934":5,"9342":5,"935":5,"935069":5,"9351":5,"9357":5,"935816":5,"935920339886e":15,"936":5,"936532":5,"936762":5,"937":5,"9373e":18,"938":5,"938568":5,"938576":5,"93898":5,"939":5,"939376":5,"939378":5,"939757":5,"93e":12,"94":[5,6,8,12,19],"941":[5,8],"9411":5,"941478":5,"942":5,"942154":5,"9423":5,"9427":5,"942854":5,"943":5,"9436":15,"944":5,"9445":5,"94464":5,"945":5,"9452":5,"946":5,"946468":5,"946757":5,"947":5,"9471":5,"947719":5,"947774":5,"94797":5,"948":5,"949":5,"95":[5,12,14],"950":5,"9505":5,"950733":5,"951":5,"951344":5,"951597":5,"952":5,"9524":5,"952496":5,"953":5,"953182":5,"9537":5,"953738":5,"953798":5,"954":5,"954624":5,"9548":5,"954848":5,"955":5,"9557":5,"956":5,"9561":5,"956619":5,"957":5,"9573":5,"95783":5,"957894":5,"958":5,"959":5,"959422":5,"959492":5,"9595":5,"9598":5,"95e":8,"96":[5,6,8,12],"960":5,"9603":5,"9606":5,"960734":5,"961":5,"9610":5,"96112":5,"96161":5,"962":5,"962482":5,"962876":5,"963":[5,8],"963621764679e":15,"964":5,"9648":5,"965":5,"9650":5,"965167":5,"96557e":5,"966":5,"966681":5,"967":5,"968":5,"969":5,"96963":5,"96e":12,"97":[5,12],"970":5,"97008":15,"970206":5,"970505":5,"970783":5,"971":5,"971686":5,"971941":5,"972":5,"9725":5,"973":[5,12],"973135":5,"97316":5,"9739":5,"9739752":8,"974":5,"9743":5,"9749":5,"975":5,"9757":5,"9758":5,"975864":5,"976":5,"976041":5,"977":5,"9779":5,"97797":5,"978":5,"979":5,"97923e":15,"9794":5,"9797":5,"97e":[8,12],"98":[5,12,14],"98061":5,"98081":5,"98096":5,"981":5,"981292":5,"9814":5,"981555":5,"9816":5,"982":5,"9825":5,"983":5,"983229":5,"984":[5,14],"9841":5,"9842":5,"985":5,"9851":5,"985359":5,"9859":5,"986":[5,8],"9869":5,"987":5,"988":5,"988755":5,"989":5,"98e":12,"99":[5,12,14],"990":5,"9900":5,"9902":5,"991":5,"9912":5,"991224":5,"991657":8,"99191":9,"99192":9,"99194":9,"992":5,"99203":5,"9927":[5,11],"993":5,"994":5,"994118":5,"995":5,"995631":14,"995687":5,"995824":5,"996":[5,8],"996798":5,"997":5,"9977":5,"997751":5,"998":5,"998023":5,"99808":5,"9983":11,"998563":5,"999":5,"999122":5,"9999999999999998":14,"99e":12,"9e":8,"9m":12,"9mb":[8,12],"9s":[8,12],"abstract":38,"boolean":[0,2,7,19,20,21,24,36,40],"break":[0,7],"case":[0,2,4,7,15,19,21,22,25,29,35],"catch":[6,8,11,12,13,14,15,18,19,21],"char":21,"class":[2,3,19,20,25,26,27,28,29,30,31,32,33,34,35,36],"const":[2,6,8,12,13,14,15],"default":[0,1,2,3,6,7,9,10,12,13,14,15,18,19,20,21,25,27,28,29,30,31,34,35,36,38],"do":[0,1,2,5,6,7,8,9,12,13,14,15,18,20,21,22,24,25,29,30,31,35,37,40],"export":[3,15,19,20,29],"final":[5,8,12,13,14,18],"float":[0,2,3,5,7,10,11,16,19,30,35,40],"function":[0,1,4,5,6,8,9,17,20,21,22,23,24,37,38,40],"import":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,32],"int":[0,1,2,5,7,12,15,19,20,21,25,30,31,32,35,40],"krtickov\u00e1":[0,7],"kub\u00e1t":[0,7],"long":[0,6,7,8,15,21,26,29,32,36,39],"new":[0,2,6,7,8,11,12,13,14,15,20,25,29,30,32],"null":[0,6,7,8,15,19],"paczy\u0144ski":[0,7],"public":[12,13,14,15,22],"return":[1,2,3,5,6,7,8,10,11,12,13,14,15,18,19,20,21,24,25,26,27,28,29,30,31,32,34,35,36,38,40],"short":[0,6,7,8,12,13,14,39],"super":[0,7],"switch":[0,7],"throw":[22,37],"true":[0,2,3,5,6,7,8,10,12,13,14,15,17,18,19,20,21,24,25,26,28,29,31,32,34,35,36],"try":[0,5,7,8,11,12,13,14,15,22,25,29,32,37],"void":9,"while":[0,5,6,7,8,12],A:[0,2,4,7,15,27,40],And:[22,31,37,40],As:[0,6,7,8,11,12,13,14,15,25],At:[6,15],But:11,By:[0,6,7,12,13,14,15,18,21],For:[0,2,7,9,11,12,13,14,24],If:[0,2,6,7,8,12,13,14,15,20,21,22,24,25,26,28,29,30,32,34,37,38,40],In:[0,2,6,7,8,9,10,11,12,13,14,15,18,21,29,35],It:[0,6,7,8,11,12,13,14,15,16,18,21,22,29,31,37],Its:21,NO:21,NOT:[0,7,32,35,38],No:[5,7,21,22,37],Not:[6,8],OR:[2,18],On:[0,7,15,19,29],One:[0,7,21],Or:[15,18],Such:8,That:[0,6,7],The:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,24,25,26,27,28,29,30,32,34,35,37,38],Then:[2,6,19,22,37],There:[6,7,8,9,10,11,12,13,14,15,16,18,20,21,24,30,31],These:[6,7,12,13,14,15,19,21,24,25],To:[0,7,11,12,13,14,15,21,22,29,30,37],Will:[0,7,19,21,38],With:31,_1:[12,13,14],_:[6,8,12,13,14,21,31],__:15,__arg_begin:7,__attribute__:9,__delitem__:27,__enter__:19,__exit__:19,__getitem__:[2,27],__iadd__:2,__setitem__:27,_actually_evolve_system:21,_binary_c_bind:[7,9,11,16,36,40],_binary_c_config_execut:21,_binary_c_dir:21,_binary_c_execut:21,_binary_c_shared_librari:21,_commandline_input:21,_count:21,_custom_logging_shared_library_fil:21,_end_time_evolut:21,_errors_exceed:21,_errors_found:21,_evolution_type_opt:21,_failed_count:21,_failed_prob:21,_failed_systems_error_cod:21,_generate_grid_cod:21,_grid_vari:[13,14,21,32],_kill:21,_loaded_moe2017_data:21,_main_pid:21,_moe2017_json_data:21,_population_id:21,_pre_run_setup:20,_probtot:21,_process_run_population_grid:21,_queue_don:21,_repeat:21,_restart_dir:25,_set:20,_set_moe2017_grid:21,_start_time_evolut:21,_store_memaddr:21,_system_gener:21,_total_mass_run:21,_total_probability_weighted_mass_run:21,_total_starcount:21,_zero_prob_stars_skip:21,a173:[0,7],a3146490:0,a_in:5,a_out:5,abat:[0,7],abbrevi:39,abl:7,about:[4,6,8,12,13,14,15,19,20,21,25,29,31,40],abov:[0,6,7,9,11,13,14,15,19,20,30],abridg:[7,9],absolut:[0,7,19,35],abund:[0,7],ac:[6,15],acceler:[0,7],accept:[15,19],access:[2,9,11,12,13,14,15,21,25,29],accord:[0,6,7,29,30,35],accordingli:[11,13,14,15],account:[0,7,21,30],accret:[0,5,7],accretion_limit_dynamical_multipli:[0,7],accretion_limit_eddington_lmms_multipli:[0,7],accretion_limit_eddington_steady_multipli:[0,7],accretion_limit_eddington_wd_to_remnant_multipli:[0,7],accretion_limit_thermal_multipli:[0,7],accretor:[0,5,7,40],accur:[12,13,14],acquir:5,act:[0,7,13,14,15,21],activ:[0,7,21],actual:[0,3,6,7,8,9,11,12,13,14,15,20,21,22,24,25,28,30,35,37],ad:[2,4,6,8,11,29,32],adam:[0,7],adapt:[0,7,13,14],add:[0,2,6,7,8,9,11,12,13,14,15,20,21,24,30,32,33,35],add_ensemble_metadata:33,add_grid_valu:35,add_grid_vari:[6,8,12,13,14,15,32],add_system_metadata:33,addit:0,address:[1,7,9,21,40],admittedli:24,adress:[7,9,40],advis:9,af:5,affect:[0,6,7],after:[0,6,7,8,9,12,13,14,15,20,21,29,32,35],ag89:[0,7],ag:[0,4,5,6,7,8,14,22,35],again:[2,3,6,10,11,19,21],against:24,agb:[0,6,7],agb_3dup_algorithm:[0,7],agb_core_algorithm:[0,7],agb_core_algorithm_default:0,agb_core_algorithm_hurlei:0,agb_core_algorithm_karaka:0,agb_luminosity_algorithm:[0,7],agb_luminosity_algorithm_default:0,agb_luminosity_algorithm_hurlei:0,agb_luminosity_algorithm_karaka:0,agb_radius_algorithm:[0,7],agb_radius_algorithm_default:0,agb_radius_algorithm_hurlei:0,agb_radius_algorithm_karaka:0,agb_third_dredge_up_algorithm_default:0,agb_third_dredge_up_algorithm_hurlei:0,agb_third_dredge_up_algorithm_karaka:0,agb_third_dredge_up_algorithm_stancliff:0,ago:6,al:[0,7,30,40],albedo:[0,7],algorithm:[7,22],algothim:[0,7],all:[0,1,2,3,6,7,8,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,29,30,31,35,36,37,38],all_info:20,alloc:[7,35],allow:[0,2,7,9,17,18,21,27,30],allow_nan:3,almost:21,along:[0,21,22,31,37],alpha:[0,5,7],alpha_:8,alpha_c:[0,5,6,7,8],alpha_ej:5,alphacb:[0,7],alreadi:[6,15,16,25,29,32],also:[0,4,5,6,7,8,9,12,13,14,15,18,19,20,21,22,25,26,29,31,36,37,40],alter:[8,12,32],altern:[0,7,21],although:16,alwai:[0,7,21,30,35],amanda:[0,7],amax:30,amin:30,amount:[0,7],amp:[6,7,8],an:[0,2,3,6,7,8,10,11,12,13,14,15,18,19,21,22,25,28,29,30,31,32,33,34,35,38],analys:38,analyt:[6,8,12,13,14,15,20,26],analyz:11,andrew:[22,37],andronov:[0,7],angelou_lithium_cheb_decay_tim:[0,7],angelou_lithium_cheb_massfrac:[0,7],angelou_lithium_cheb_tim:[0,7],angelou_lithium_decay_funct:[0,7],angelou_lithium_decay_tim:[0,7],angelou_lithium_eagb_decay_tim:[0,7],angelou_lithium_eagb_massfrac:[0,7],angelou_lithium_eagb_tim:[0,7],angelou_lithium_gb_decay_tim:[0,7],angelou_lithium_gb_massfrac:[0,7],angelou_lithium_gb_tim:[0,7],angelou_lithium_hg_decay_tim:[0,7],angelou_lithium_hg_massfrac:[0,7],angelou_lithium_hg_tim:[0,7],angelou_lithium_lmms_decay_tim:[0,7],angelou_lithium_lmms_massfrac:[0,7],angelou_lithium_lmms_tim:[0,7],angelou_lithium_ms_decay_tim:[0,7],angelou_lithium_ms_massfrac:[0,7],angelou_lithium_ms_tim:[0,7],angelou_lithium_tpagb_decay_tim:[0,7],angelou_lithium_tpagb_massfrac:[0,7],angelou_lithium_tpagb_tim:[0,7],angelou_lithium_vrot_trigg:[0,7],angelou_lithium_vrotfrac_trigg:[0,7],angular:[0,7,16,24],ani:[0,3,7,11,15,19,20,22,25,30,32,36,37],anoth:[0,7,25],ansi:[0,7,19],ansi_colour:[0,7],anyth:[0,7,12,13,14,15,19,21,25,35],anywai:[11,15,30,32],api:[0,4,19,22,25],api_log_filename_prefix:[0,5,7,11,16],appear:21,append:[1,2,6,11,12,13,14,16],appli:[0,7],apply_darwin_radau_correct:[0,7],appropri:[0,7,15,21,25,27,28,29,32,34],approxim:[0,6,7,8],ar:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,24,27,28,29,30,31,32,34,35,36,37,40],arang:18,aren:[21,30],arenou2010_binary_fract:30,arg:[5,7,15,19,27,30],arg_dict:[2,19],argh:16,argopt:[0,7],argpair:[10,36],argstr:[7,9,11,16,18],argument:[0,2,7,11,13,15,16,17,18,19,20,21,25,30,36,38],argument_of_periastron:[0,7],argument_of_periastron_quadrupl:[0,7],argument_of_periastron_tripl:[0,7],aritif:8,around:[0,7,9,11,17,18],arrai:[11,15,18,19,21,30,32,35],arrow:[0,7],artefact:[13,14],artifici:[0,7],artificial_accretion_end_tim:[0,7],artificial_accretion_ignor:0,artificial_accretion_start_tim:[0,7],artificial_angular_momentum_accretion_r:[0,7],artificial_mass_accretion_r:[0,7],artificial_mass_accretion_rate_by_stellar_typ:[0,7],artificial_orbital_angular_momentum_accretion_r:[0,7],arxiv:[0,7,30],ask:[0,7,40],asplund:[0,7],assign:[12,13,14,15,32],associ:[6,8,12,13,14,28,34],assum:[0,6,7,8,12,16,24,35],ast871:[0,7],astronomi:[0,7],astrophys:[8,13,14],astropi:[22,24,37],asymptot:6,atom:36,attempt:[3,20],au:16,auto:[1,23],autogen_c_logging_cod:[1,9,18],autogener:18,automat:[0,1,7,9,15,17,18,21,22,27,29,31,32,37],autoviv:2,autovivif:2,autovivificationdict:2,avaibl:[22,37],avail:[0,7,8,9,12,13,14,15,19,21,22,26,37],avoid:[6,7,8],awai:[0,7,12],ax:18,axessubplot:17,axi:[0,7,24],b6213f2eb7f94d3196cf966b7b76b9f9:14,b:[21,29],b_1:[0,7],b_2:[0,7],b_3:[0,7],b_4:[0,7],b_inclination1:[0,7],b_inclination2:[0,7],b_inclination3:[0,7],b_inclination4:[0,7],back:[0,2,5,7],background:18,backward:[0,7],bagb:[0,7],bar:[13,14],barn:[0,7],base:[0,2,3,7,8,12,13,14,15,19,20,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,40],base_filenam:[15,20],bash:21,basic:[15,29],batch:21,batchmod:[0,7],batchnam:21,bb:[0,7],bbox_inch:18,beasor:[0,7],becaus:[0,2,6,7,8,11,12,13,14,16,18,20,21,22,27,29,30,37],becom:[0,1,2,5,7,9,13,14,16,19,21],been:[0,7,10,20,21,25,26,28,34],befor:[0,5,6,7,8,12,13,14,15,20,21,22,29,30,37],beg_bss:5,beg_rch:5,beg_symb:5,begin:6,behaviour:[2,6,12,13,14,15,38],behind:18,being:[28,34],belczynski:[0,7],below:[0,4,6,7,8,9,12,13,14,15,21,30],berro:[0,7],bertolami:[0,7],best:[5,20,21],beta:[0,7],beta_reverse_nova:[0,7],beta_reverse_novae_geometri:0,better:[0,2,4,7,15,29,40],between:[0,7,21,30,35],bewar:[15,29,32],beyond:16,bh:[0,5,8],bh_belczynski:[0,5,7],bh_bh:5,bh_fryer12_delai:[0,7],bh_fryer12_rapid:[0,5,7],bh_fryer12_startrack:[0,7],bh_hurley2002:[0,7],bh_prescript:[0,5,7],bh_spera2015:[0,7],bhbh:5,big:[0,7,21],biinari:15,bin:[0,7,8,12,13,14,19,21,22,35,37],bin_data:[8,12,13,14,19],binari:[4,7,8,11,13,14,15,21,22,24,30,32,37,40],binary_c2:[22,37],binary_c:[1,2,3,4,6,8,12,13,14,16,19,20,21,24,27,29,30,32,36,38],binary_c_api_funct:9,binary_c_cal:[15,29],binary_c_default:15,binary_c_grid:[6,8,12,15],binary_c_grid_25014bc73b334765a1c09a4e4a97ed66:12,binary_c_grid_26171201413c43f5b91552a374879940:6,binary_c_grid_2b66f805db424c48a1d29c45092b6e3c:8,binary_c_grid_50fb66cc659c46c8bbc29fe0c8651c2f:15,binary_c_grid_8a7d52edc59346ce991063d9e05e9ba7:6,binary_c_grid_f4e5925effeb42e69b5be956f400ae41:6,binary_c_inline_config:1,binary_c_log_cod:[1,9,11,17,18],binary_c_macro:[0,7],binary_c_output:3,binary_c_paramet:[0,6,12,13,14,15],binary_c_python:[6,7,8,11,12,13,14,15,19],binary_c_python_api:18,binary_c_task_:[0,7],binary_c_write_log_cod:1,binary_grid:[0,7],binary_star:40,binaryc:[1,19,38],binaryc_config:1,binaryc_json_seri:3,binarycdecod:3,binarycencod:3,binarycpython:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40],binarygrid:[12,13,14,15],bind:[0,7,9,11,16],binned_log_luminos:[12,13,14],binned_post_period:8,binned_pre_period:8,binwidth:[8,12,13,14,19],birth:[0,7],bit:[6,12],bivari:[0,7],black:[0,4,6,7,22],black_hol:0,block:[15,32],bloecker:[0,7],blog:1,boltzman:24,boltzmann:[0,7],bondi:[0,7],bondi_hoyle_accretion_factor:[0,7],bool:[2,15,19,20,24,29,31,32,36],born:[0,6,7,12,13,14],bosswissam:19,both:[0,2,7,12,13,14,15],bottom:[0,7,15,32],bottomcod:[6,8,15,32],bound:[5,30,35],boundari:30,brake:[0,7],branch:[0,6,7,19,36],branch_david:0,branchcod:[6,8,15,32],branchpoint:[6,8,15,32],breakup:[0,7],brighten:[13,14],broken:[0,7],bse:[0,7,9,15,30],bse_opt:[6,8,11,12,13,14,15,20,35],bsf:[0,7],buffer:[0,7,29],build:[0,1,4,7,19,25,30],build_q_tabl:30,built:[0,1,10,19,22,37],burn:[0,7],busso:[0,7],bye:[0,7],bz2:29,c13_eff:[0,7],c2:30,c:[0,1,5,7,9,11,15,38],c_auto_log:21,c_log:0,c_logging_cod:[6,8,9,11,12,13,14,15,21],cach:[20,21,26,27,31,35],cache_dir:[21,35],cachedir:35,cachetool:[21,27],cachetyp:27,calc_e_integr:30,calc_p_integr:30,calc_period_from_sep:40,calc_sep_from_period:[8,12,15,40],calc_total_probden:30,calcul:[0,2,6,7,8,12,13,14,15,19,21,26,30,32,40],calculate_constants_three_part_powerlaw:30,call:[0,1,2,7,11,13,14,15,16,19,20,21,24,25,28,29,32,34,35,36,38],call_binary_c_config:19,calls_filenam:15,can:[0,1,2,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,24,25,29,30,32,37,38,40],candid:8,cannot:[6,9,27,29,31],canon:21,cap:[0,7],capit:[12,13,14],capsul:[1,7,19],captur:[0,7,19],carbon:[0,5,6,7],carbon_oxygen_white_dwarf:0,care:[6,12,13,14,21],carlo:[0,7,21],carrasco:[0,7],carri:[0,7],carriag:[19,21],cast:[18,19],catchtim:19,categor:7,categori:[7,15],categoris:19,caught:[11,19,36],caus:[5,12,40],cbdisc:[0,7],cbdisc_albedo:[0,7],cbdisc_alpha:[0,7],cbdisc_eccentricity_pumping_dermin:0,cbdisc_eccentricity_pumping_method:[0,7],cbdisc_eccentricity_pumping_non:0,cbdisc_end_evolution_after_disc:[0,7],cbdisc_fail_ring_inside_separ:[0,7],cbdisc_gamma:[0,7],cbdisc_init_djdm:[0,7],cbdisc_init_dm:[0,7],cbdisc_inner_edge_strip:[0,7],cbdisc_inner_edge_stripping_timescal:[0,7],cbdisc_kappa:[0,7],cbdisc_mass_loss_constant_r:[0,7],cbdisc_mass_loss_fuv_multipli:[0,7],cbdisc_mass_loss_inner_l2_cross_multipli:[0,7],cbdisc_mass_loss_inner_viscous_accretion_method:[0,7],cbdisc_mass_loss_inner_viscous_accretion_method_equ:0,cbdisc_mass_loss_inner_viscous_accretion_method_gerosa_2015:0,cbdisc_mass_loss_inner_viscous_accretion_method_non:0,cbdisc_mass_loss_inner_viscous_accretion_method_young_clarke_2015:0,cbdisc_mass_loss_inner_viscous_angular_momentum_multipli:[0,7],cbdisc_mass_loss_inner_viscous_multipli:[0,7],cbdisc_mass_loss_ism_pressur:[0,7],cbdisc_mass_loss_ism_ram_pressure_multipli:[0,7],cbdisc_mass_loss_xray_multipli:[0,7],cbdisc_max_lifetim:[0,7],cbdisc_minimum_evaporation_timescal:[0,7],cbdisc_minimum_fr:[0,7],cbdisc_minimum_luminos:[0,7],cbdisc_minimum_mass:[0,7],cbdisc_no_wind_if_cbdisc:[0,7],cbdisc_outer_edge_strip:[0,7],cbdisc_outer_edge_stripping_timescal:[0,7],cbdisc_resonance_damp:[0,7],cbdisc_resonance_multipli:[0,7],cbdisc_torquef:[0,7],cbdisc_viscous_l2_coupl:[0,7],cbdisc_viscous_photoevaporative_coupl:[0,7],cbdisc_viscous_photoevaporative_coupling_inst:[0,7],cbdisc_viscous_photoevaporative_coupling_non:[0,7],cbdisc_viscous_photoevaporative_coupling_visc:[0,7],ce:[0,7,8],cee:[0,7,8],cell:[7,12,13,14,15],cemp:[0,7],cemp_cfe_minimum:[0,7],centr:[8,15,32],central:16,central_object:[0,7],centralis:38,certain:[21,22,37],certainli:21,cf:[0,7],cf_amanda_log:[0,7],cflag:[22,37],chabrier:30,challeng:[13,14],chandrasekhar:[0,7],chandrasekhar_mass:[0,7],chang:[0,1,2,5,6,7,8,9,12,13,14,15,18,19,20,21,22,31,32,37],chapter:[0,21,23],charact:[19,21,29],cheb:[0,7],check:[0,6,7,8,12,13,14,15,18,19,20,21,25,28,29,30,31,34,38,40],check_circular:3,check_if_in_shel:19,chemic:[0,7,35],chen:[0,7],child:19,choic:[0,7,24,30],choos:[0,6,7,8,9,12,18,24,25,29],chose:11,chosen:[12,13,14,15,32],chunk:[28,34],ci:16,circular:[0,5,7],circumbinari:[0,7],circumstanti:[0,7],cl:3,claei:[0,7],clark:[0,7],clean:[1,6,11,13,14,20],clean_up_custom_logging_fil:20,clear:[13,14,36],clearli:[13,14],clock:19,close:[0,5,7,8,13,14,16,29],closedir:29,closefd:29,closer:5,cloud:[0,7],clusterid:[21,28],co2:[13,14],co:[0,5,7],coalesc:5,code:[0,1,6,7,8,9,11,12,13,14,15,17,18,20,22,24,28,29,30,31,32,34,35,37,38,40],collaps:[0,7],collapsar:[0,7],collect:40,collid:40,color:[19,24],color_by_index:24,colour:[0,7],colour_log:[0,7],column:[6,8,11,15,16,18,24],column_nam:11,com:[1,19,30],combin:[1,2,9,19,20,21],combine_ensemble_with_thread_join:21,combined_output_dict:33,come:[2,22,35,37],comenv:[5,8],comenv_bs:0,comenv_count:8,comenv_disc_angmom_fract:[0,7],comenv_disc_mass_fract:[0,7],comenv_ejection_spin_method:[0,7],comenv_ejection_spin_method_do_noth:[0,7],comenv_ejection_spin_method_sychron:[0,7],comenv_ejection_spin_method_synchron:0,comenv_merger_spin_method:[0,7],comenv_merger_spin_method_breakup:0,comenv_merger_spin_method_conserve_angmom:[0,7],comenv_merger_spin_method_conserve_omega:[0,7],comenv_merger_spin_method_specif:[0,7],comenv_ms_accret:[0,7],comenv_ms_accretion_fract:[0,7],comenv_ms_accretion_mass:[0,7],comenv_nandez2016:0,comenv_nelemans_tout:0,comenv_ns_accret:[0,7],comenv_ns_accretion_fract:[0,7],comenv_ns_accretion_mass:[0,7],comenv_post_eccentr:[0,7],comenv_prescript:[0,7],comenv_splitmass:[0,7],comenv_undef:0,comma:35,command:[0,1,7,15,20,21,22,29,37],command_lin:21,commandlin:15,comment:15,common:[0,4,5,6,7,9,11,12,13,14,15,22],compact:[8,15],companion:[0,5,7,18,29],compar:[0,7,8,12,15,21],compens:[13,14],compil:[1,9,15,18,22,37],compile_shared_lib:1,complaint:29,complet:[6,8,12,13,14,15],complex:[8,9,15,17,18,21],compon:[19,24],compress:[3,29],compress_pickl:29,compression_typ:29,compresslevel:29,comput:[0,6,7,12,13,14],concaten:2,conceptu:12,concurr:21,condit:[6,8,9,12,13,14,15,17,18,32],condor:[21,25,28],condor_bash:21,condor_batchnam:21,condor_check_requir:28,condor_clusterid:[21,28],condor_d:21,condor_dir:[21,25,28,34],condor_env:21,condor_extra_set:21,condor_getenv:21,condor_grid:28,condor_initial_dir:21,condor_kill_sig:21,condor_memori:21,condor_njob:21,condor_outfil:28,condor_postpone_join:21,condor_postpone_submit:21,condor_process:[21,28],condor_pwd:21,condor_q:21,condor_queue_stat:28,condor_requir:21,condor_should_transfer_fil:21,condor_snapshot_on_kil:21,condor_status_fil:28,condor_stream_error:21,condor_stream_output:21,condor_submit:21,condor_univers:21,condor_warn_max_memori:21,condor_when_to_transfer_output:21,condorid:28,condorpath:28,config:[1,19,21,22,37],config_fil:1,configur:[6,11,12,13,14,15,18,21,30],confirm:29,conjunct:10,conserv:[0,7],consid:[0,1,2,7,12,13,14,20,21,24,31,35],const_distribut:30,const_dt:35,const_dt_cach:35,const_int:35,const_linear:[32,35],const_rang:35,constant:[0,2,7,13,14,24,30,35],construct:[0,1,6,7,8,11,12,13,14,16,18,21],contact:5,contain:[0,1,2,3,7,10,11,12,13,14,15,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],content:[2,3,7,19,20,25],context:19,continu:[15,28,32,34],contribut:[22,37],control:[0,6,7,12,13,14,15,21],conv_time_unit:19,convect:[0,7],conveni:19,converg:[0,7],convers:2,convert:[2,3,6,8,16,19,20,29,30,35],convert_byt:19,convert_float_kei:3,convfloat:19,convfrac:5,cool:[0,6,7],copi:[0,7,8,13,14,21,40],core:[0,6,7,8,12,13,14,15,21,24],core_co:9,core_h:9,core_helium_burn:0,core_mass:[0,7,9],correct:[0,7,11,20,24,30,40],correctli:[11,18,22,37],correspon:[28,34],correspond:[15,24,28,32,34],corretor:[0,7],cosmic:30,cosmic_sfh_madau_dickinson2014:30,cost:[12,13,14],could:[0,3,7,13,14,15,18,19,36],count:[2,5,6,18,19,21],count_keys_recurs:2,counter:21,coupl:[0,4,7],cours:[6,24],cover:[10,12,13,14],coverag:[22,37],cowd:[0,7],cpu:[0,6,7,8,12,13,14,15,21,26],cpu_tim:26,cpython:7,crap_paramet:[0,7],creat:[3,6,8,9,11,12,13,14,15,19,20,26,29,30,32,34],create_and_load_logging_funct:[1,9,18],create_arg_str:19,create_hdf5:19,creation:7,critic:[0,7],cross:[0,7],crunch:[6,8,12,13,14],cs1:16,ctype:1,cube:12,cubic:12,cuntz:[0,7],current:[0,2,7,8,9,12,13,14,19,22,25,29,37],curv:[8,13,14],custom:[0,1,2,3,4,6,7,8,11,12,13,14,15,19,20,21,22,24,30,38],custom_format:2,custom_gener:21,custom_log:[11,18,20,21],custom_logging_cod:[1,9,11,17,18,38],custom_logging_func_memaddr:[7,9,21],custom_logging_funct:[9,11,15,17,18,21,22,23],custom_logging_info:20,custom_logging_memaddr:9,custom_logging_print_stat:11,custom_logging_stat:[6,8,12,13,14,15],custom_opt:[6,11,12,13,14,15,20,29],custom_output_funct:9,custom_sort_dict:2,custom_tmp_dir:1,customis:24,cut:18,cvode:[0,7],d48r:18,d:[0,1,2,5,6,7,8,9,11,12,15,16,19,35],d_:19,dai:[0,5,7,8,9,11,12,15,18,30,40],damp:[0,7],darwin:[0,7],dat:[0,15,19],data:[0,3,5,6,7,8,11,12,13,14,15,16,18,19,21,25,29,30,32,38,40],data_dict:30,data_dir:[15,19,20,21,29],datadir:[15,29],datafram:[6,8,11,12,13,14,16,17,18,24],dataio:[20,29],datalinedict:[6,8,12,13,14,19],datamodel:2,dataset:[15,21,25],date:[19,20,21],david:[0,2,18,22,37],david_logging_funct:0,dd7:[0,7],de:[0,5,7],deactiv:[0,7],deal:[3,11],dear:5,death:[0,7],debug:[0,5,6,7,8,12,13,14,15,21],dec:0,decai:[0,7],decid:[0,2,7,9,17,18,19,20,21,25],decod:3,decompress:3,decreas:[0,7],deepcopi:8,deeper:[15,32],def:[5,6,8,11,12,13,14,15,18],default_cache_dir:[27,31],default_to_metal:[0,7],defaultdict:19,defer:[0,7],defin:[0,1,7,15,16,20,24,30,32],definit:[1,12,13,14,40],degener:[0,7],degenerate_core_helium_merger_ignit:[0,7],degenerate_core_merger_dredgeup_fract:[0,7],degenerate_core_merger_nucsyn:[0,7],degner:[0,7],degre:[0,7],del:8,delai:[0,7,21],delet:[27,32],delete_grid_vari:32,delta:[19,35],delta_mcmin:[0,7],demonstr:8,den:[0,7],densiti:[12,13,14,30],depend:[0,6,7,19,21,22,24,30,37],deprec:[0,7,20],depth:35,dermin:[0,7],describ:[0,7,18,21,30],descript:[0,7,10,19,21,30,31],design:24,desir:[0,7],destruct:[15,32],detail:[0,6,7,11,19,21],detect:[0,5,7,8,16],detector:5,determin:[0,7,9,12,13,14,15,20,30,32,40],deton:[0,7],dev:[0,7],develop:1,development_requir:[22,37],deviat:[30,35],dewi:[0,7],dex:[0,7,8,35],df2:18,df:[16,17,18,24],di:[15,22,30],diagnost:21,diagram:[0,4,7,22,24],dickonson:30,dict2:2,dict:[1,2,3,5,6,11,12,13,14,15,16,19,20,21,25,27,29,30,31,36,39],dict_1:2,dict_2:2,dict_kei:[6,10,11],dictionari:[1,2,3,4,6,8,12,13,14,15,19,20,21,24,26,29,30,31,32,36,39],did:[19,22,37],differ:[0,6,7,8,12,13,14,15,18,19,21,22,24,35,37],differenti:19,dimmer:[0,7,12],dir:[22,28,37],dir_ok:29,direct:[0,7,20],directli:[2,11,21,25,29],director:21,directori:[0,4,7,15,19,20,21,22,25,27,28,29,31,34,37],disabl:[0,7,15],disable_debug:[0,7],disable_end_log:[0,7],disable_ev:[0,7],disc:[0,7,16],disc_legacy_log:[0,7],disc_log2d:[0,7],disc_log:[0,7],disc_log_directori:[0,7],disc_log_dt:[0,7],disc_log_level_non:0,disc_log_level_norm:0,disc_log_level_normal_first_disc_onli:0,disc_log_level_subtimestep:0,disc_log_level_subtimestep_first_disc_onli:0,disc_n_monte_carlo_guess:[0,7],disc_stripping_timescale_infinit:0,disc_stripping_timescale_inst:0,disc_stripping_timescale_orbit:0,disc_stripping_timescale_visc:0,disc_timestep_factor:[0,7],discret:15,discs_circumbinary_from_comenv:[0,7],discs_circumbinary_from_wind:[0,7],disk:[0,7,20],dispers:[0,7,35],displai:[0,6,7,8,16],disrupt:[0,5,7,18],dist:19,distanc:[6,16],distant:16,distefano2017:21,distefano:[25,30],distinct:20,distribut:[0,2,4,7,8,12,15,19,25,30,35],distribution_funct:[6,8,12,13,14,15,20,30],dj:[0,7],dlnm1:[8,12,15],dlnm:[13,14],dlnm_1:[13,14,32],dlog10per:[8,12,15],dlogp:30,dlogt:35,dm1:[6,13,14],dm:[0,5,7,13,14,30,35],dm_1:[6,13,14],dn:[19,30],do_analyt:21,do_dry_run:21,doc:[2,6,12,13,14,15,19,22,31,37],doc_fetch:30,docstr:[11,22,24,37],document:[12,13,14,15,21,23,29,31],doe:[0,2,6,7,9,10,11,12,13,14,15,20,21,27,29,30,32,40],doesn:[6,21],doesnt:[18,31],doesntt:25,don:[2,6,19,21,25],done:[0,2,5,6,7,12,13,14,15,18,21,22,29,37],donor:[0,5,7,40],donor_limit_dynamical_multipli:[0,7],donor_limit_envelope_multipli:[0,7],donor_limit_thermal_multipli:[0,7],donor_rate_algorithm_bs:0,donor_rate_algorithm_claeys2014:0,dont:[7,18],doubl:[6,9,15],down:15,dp:30,dphasevol:[6,8,12,13,14,15,32],dprob:[6,8,13,14],dq:[8,12,15],dr2:[0,7],dr3:[0,7],drai:[0,7],dredg:[0,7],drop:11,dry:[6,8,12,14,15,21,32],dry_parallel:32,dry_run:[6,8,12,15],dry_run_hook:21,dry_run_num_cor:21,dstep:30,dt:[0,1,7,19,27,35],dt_limit:10,dtfac:[0,7],dtlimit:36,dtm:[1,9,15],dtype:[16,17,18],due:[22,37],dummi:[21,24,30],dump:[0,3,7,11,20,29],dumpvers:[0,7],duquennoi:30,duquennoy1991:30,dure:[0,5,7,18],dust:[0,7],dwarf:[0,6,7,13,14],dx:[0,7],dynam:[0,7],e2:[0,7],e2_hurley_2002:0,e2_izzard:0,e2_mint:0,e2_prescript:[0,7],e:[0,5,6,7,8,9,11,12,13,14,15,19,20,21,22,25,27,28,29,30,32,34,35,37,40],each:[0,2,7,8,12,13,14,15,16,19,21,25,32,35],eagb:[0,5,7],eagb_wind_beasor_etal_2020:0,eagb_wind_bs:0,eagb_wind_goldman_etal_2017:0,eagbwind:[0,7],eagbwindfac:[0,7],earli:[0,7],early_asymptotic_giant_branch:0,earth:16,easi:[3,11],easier:[15,18,19],ebindi:5,ecc2:30,ecc3:30,ecc:[5,11,15,18,29,30],eccentr:[0,7,9,11,12,13,14,15,16,18,24,30,40],eccentric_rlof_model:[0,7],eccentricity_quadrupl:[0,7],eccentricity_tripl:[0,7],echo:[0,7],eddington:[0,7],edg:[0,6,7,15,32],edit:9,edu:[0,7],eej:5,eff:6,effect:[0,5,7,9,12,21,30],effective_metal:[0,7,18],effici:[0,6,7,8],egg:[22,37],eggleton:[0,7,40],either:[0,2,3,7,12,13,14,15,18,20,21,22,25,32,36,37,38],eject:[0,7,8,16],el:[11,15],elabor:9,elaps:26,eld:[0,7],eldridg:[0,7],electon:[0,7],electron:[0,7],element:[0,1,7,10,16,21,24,36],els:[2,5,8,21],email:36,emp:[0,7],emp_feh_maximum:[0,7],emp_logg_maximum:[0,7],emp_minimum_ag:[0,7],empti:[2,11,28,31,34],enabl:[0,7],encod:[3,29],encount:21,end:[0,5,7,19,21,26,30],end_bss:5,end_index:30,end_rch:5,end_symb:5,end_timestamp:[6,8,12,14,15],energi:[0,7],enhanc:[0,7],enlarg:[0,7],enough:30,ensembl:[0,3,7,10,21,29,32,33,36],ensemble_compress:3,ensemble_def:[0,7],ensemble_dictionari:3,ensemble_dt:[0,7],ensemble_factor_in_probability_weighted_mass:21,ensemble_file_typ:3,ensemble_filt:10,ensemble_filter_:[0,7],ensemble_filters_off:[0,7],ensemble_json:3,ensemble_legacy_ensembl:[0,7],ensemble_list:20,ensemble_logdt:[0,7],ensemble_logtim:[0,7],ensemble_macro:[0,7],ensemble_output_:21,ensemble_set:3,ensemble_startlogtim:[0,7],ensemebl:3,ensure_ascii:[3,20,29],enter:[0,7,21],enthalpi:[0,7],entir:[9,11,17,18],entri:[3,19,20],env:[21,24],envelop:[0,4,5,6,7,22],environ:21,eorbf:5,eorbi:5,ep:18,equal:[0,2,7,13,14,15,19],equat:[0,7],equation_of_state_algorithm:[0,7],equation_of_state_paczynski:0,equatori:[0,7],equival:[12,21,25],errno:[22,37],error:[0,2,6,7,8,12,13,14,15,19,21,22,25,29,37],error_on_overwit:25,error_on_overwrit:25,errors_exceed:[6,8,12,14,15],errors_found:[6,8,12,14,15],esa:30,escap:[0,7],escape_fract:[0,7],escape_veloc:[0,7],estim:[6,16,19,21],et:[0,7,30,40],eta:[0,7,8,12],etal:[0,7],etc:[0,7,11,13,14,15,19,20,21,22,24,29,30,37,38],etf:[8,12],euler:[0,7],evalu:[15,30,32,35,40],evan:[0,7],evapor:[0,7],evaporate_escaped_orbiting_object:[0,7],even:[3,10,13,14],event:[0,5,6,7],everi:[0,7,8,19,21,22,37],everyth:[11,15,20,21],everytim:[22,37],evid:[0,7],evolut:[0,1,4,5,6,7,11,12,13,14,15,18,21,22,24,35],evolution_split:[0,7],evolution_splitting_maxdepth:[0,7],evolution_splitting_sn_eccentricity_threshold:[0,7],evolution_splitting_sn_n:[0,7],evolution_stop:8,evolution_typ:[6,8,12,14,15,21],evolutionari:[0,7,11],evolv:[0,4,7,9,20,21],evolve_popul:15,evolve_singl:[9,11,20],exact:[1,2,21],exactli:[0,7,13,14],exampl:[1,2,11,19,30,32,35,38],example_compact_object:15,example_dco:15,example_df:11,example_head:19,example_header_1:18,example_header_2:18,example_log:38,example_log_co:[1,9],example_logging_string_co:9,example_logging_string_post_m:9,example_massloss:[9,11],example_output:11,example_parse_output:[17,19],example_pop:[11,15],example_pop_set:15,example_post_m:9,example_python_population_result:15,example_sn:9,exc_tb:19,exc_typ:19,exc_val:19,exce:[0,7,12],except:[2,5,6,7,12,13,14,15,21,24,31],excess:21,excit:8,execut:[0,7,15,21,32],exist:[0,2,6,7,15,18,21,25,29,31,32],exist_ok:[15,19],exists_ok:29,exit:[0,7,19,20,21,25,28,29,34],exit_after_dry_run:21,exit_cod:21,exp:[8,12,13,14,15,32],expand:15,expect:[6,7,8,12,13,14,21,22,37],experiment:[0,7,19],explain:[4,36],explicitli:[0,1,7],explod:[0,5,7],explor:16,explos:[0,5,6,7,18],expoenti:[0,7],expon:[0,7,19],export_all_info:[15,20],express:[0,7,19],extend:[0,7,8,22,36,37],extens:[3,7,25,26,27,28,29,30,31,32,33,34,35],extern:[0,7],extra:[0,4,7,15,21,22,32,38],extra_text:31,extract:[3,15],extract_ensemble_json_from_str:3,extrapol:[21,30],f4e5925effeb42e69b5be956f400ae41:6,f:[0,5,7,11,15,18,30],fa:30,fabian:[0,7],fabian_imf_log:[0,7],fabian_imf_log_tim:[0,7],fabian_imf_log_timestep:[0,7],factor:[0,2,7,21,35],fade:[0,7],fail:[0,6,7,8,12,19,21,22,29,37],fail_sil:19,failed_count:[6,8,12,14,15],failed_prob:[6,8,12,14,15],failed_system:21,failed_system_log:21,failed_systems_error_cod:[6,8,12,14,15],failed_systems_threshold:21,failsaf:11,failur:[0,7,19,25],fallback:[0,7],fals:[0,3,5,6,7,8,12,14,15,16,19,20,21,24,25,26,27,28,29,32,34,35,36],fancy_parsing_funct:38,far:[0,5,6,7,13,14,16],farmer:0,fase:15,fast:[0,7],faster:[2,12,13,14,15],fatal_open_error:29,favorit:11,fe:[0,7],featur:[2,4,15,22],feed:21,ferguson:[0,7],fetch:11,few:[0,7,8],fewer:11,field:[0,7],fifocach:21,fig:[0,7,18,30],figsiz:[6,8,12,13,14,16,18],figur:[6,8,12,13,14,16,24],file:[0,1,3,5,7,11,15,19,20,21,22,24,25,27,28,29,31,32,34,36,37,38],file_log:[0,7],file_object:29,filehandl:31,filenam:[0,1,3,5,7,11,15,19,20,21,25,28,29,34,38],filenotfounderror:[22,37],filepath:1,fill:[11,19],fill_data:30,filter:[0,2,7,19],filter_arg_dict:19,filter_dict:2,filter_dict_through_valu:2,filter_list:2,filter_valu:19,fin:[0,7],final_mass:18,final_tim:18,find:[2,5,8,15,19,21,27,31],finish:[6,8,12,14,15,19,24,29,34],finit:[6,8,12,13,14],first:[0,2,6,7,8,11,12,13,14,15,16,19,22,25,29,30,37,40],first_giant_branch:0,fishlock:[0,7],fit:[0,2,7,11,30,40],fix:[0,5,7,11,15,19,20,24,29,30],flag:[0,1,20,21,29,35,36],flash:[0,7],flat:[21,30],flatsect:[8,12,15,30],flaw:20,float64:[17,18],float_overflow_check:[0,7],flto:[22,37],flufl:29,flush:[3,20,29],fo:21,focu:8,fold:30,follow:[0,7,9,18,19,21,22,24,30,35,37],font_scal:[6,8,12,13,14,16],fontsiz:18,forc:[0,5,7,21,26],force_circularization_on_rlof:[0,7],force_corotation_of_primary_and_orbit:[0,7],foreach_star:[6,12],form:[0,6,7,8,12,13,14,15,20,25,29,31,36],formal:[0,7],format:[0,2,3,5,7,8,9,11,12,13,14,15,16,18,19,21,28,29,30,32,35],format_ensemble_result:3,format_numb:19,format_stat:29,former:5,formula:[0,7],forward:[0,7],found:[5,6,8,12,14,15,28,30,34],four:[0,7],fourth:16,fraction:[0,7,12,18,21,30],fractions_z0002:18,fractions_z001:18,fractions_z002:18,framework:7,free:[6,8,12],free_persistent_data_memaddr_and_return_json_output:7,free_store_memaddr:7,frequenc:[0,7,16],friction:[0,7],fring:[0,7],from:[0,2,3,5,6,8,10,11,12,13,14,15,16,17,18,19,20,21,24,25,28,29,30,32,34,36,40],from_binary_c_config:1,from_dict:[8,12,13,14,17,18],fryer:[0,7],fsampl:35,ftz:[22,37],full:[4,9,16,19,21,28,34],full_path:19,func:27,func_memaddr:18,function_cach:21,function_cache_default_maxs:21,function_cache_default_typ:21,function_cache_funct:[21,27],function_cache_s:27,function_cache_ttl:21,further:15,futur:16,fuv:[0,7],g:[0,1,2,5,6,7,8,9,11,12,13,14,15,17,18,19,21,22,25,27,28,29,30,34,35,37],ga:[0,7],gaia:[0,7,30],gaia_colour_transform_method:[0,7],gaia_conversion_ubvri_bivariate_jordi2010:[0,7],gaia_conversion_ubvri_riello2020:[0,7],gaia_conversion_ubvri_univariate_evans2018:[0,7],gaia_conversion_ubvri_univariate_jordi2010:[0,7],gaia_conversion_ugriz_bivariate_jordi2010:[0,7],gaia_conversion_ugriz_riello2020:[0,7],gaia_conversion_ugriz_univariate_evans2018:[0,7],gaia_conversion_ugriz_univariate_jordi2010:[0,7],gaia_l_binwidth:[0,7],gaia_teff_binwidth:[0,7],galact:[0,7,35],gallino:[0,7],gamma:[0,7],gap:[0,7],garcia:[0,7],gauss:[0,7],gaussian:[30,35],gaussian_func:30,gaussian_normalizing_const:30,gaussian_zoom:35,gb:[0,7],gb_reimers_eta:[0,7],gb_wind_beasor_etal_2020:0,gb_wind_goldman_etal_2017:0,gb_wind_reim:0,gb_wind_schroeder_cuntz_2005:0,gbwind:[0,7],gbwindfac:[0,7],gcc:[1,22,37],gce:[0,7],gener:[0,1,6,7,8,9,11,12,14,15,17,18,19,20,21,24,25,29,30,31,32,35],general_info:2,generalis:30,geometr:[0,7],geq:6,gerosa:[0,7],get:[0,2,3,4,6,9,11,12,13,14,15,16,18,19,20,22,25,28,30,31,32,34,37,38,40],get_ansi_colour:19,get_arg_kei:19,get_condor_statu:28,get_default:[10,19],get_grid_options_defaults_dict:31,get_grid_options_descript:31,get_help:[10,19],get_help_al:[10,19,20],get_help_sup:[10,19],get_integration_constant_q:30,get_max_multipl:30,get_siz:19,get_slurm_statu:34,get_usernam:19,getitem:2,gettempdir:18,getter:27,giant:[0,6,7,16],giant_branch:0,git:[0,12,13,14,15,19],git_branch:36,git_build:36,github:[19,29],gitlab:22,give:[0,5,7,8,19,20,30,40],given:[0,1,3,7,12,13,14,17,18,19,20,21,25,27,28,29,30,32,34,35,38,40],global:[0,2,7,12,13,14,19,30,35],global_dict:2,gmax:30,gmin:30,gnu:7,go:[0,6,7,10,12,15,20,22,24,37],goal:30,goe:[0,2,7,9,11,24],gogo:[0,7],goldman:[0,7],gonna:30,good:[0,7,11,12,13,14,15,21,40],got:[13,14],gov:[0,7],gravit:[0,6,7,8,15],gravitational_const:6,gravitational_radiation_bs:0,gravitational_radiation_bse_when_no_rlof:0,gravitational_radiation_landau_lifshitz:0,gravitational_radiation_landau_lifshitz_when_no_rlof:0,gravitational_radiation_model:[0,7],gravitational_radiation_modulator_:[0,7],gravitational_radiation_modulator_j:[0,7],gravitational_radiation_non:0,grb:[0,7],great:[0,7,13,14,21],greater:[0,7],grevess:[0,7],grid:[0,4,7,9,11,19,20,22,25,28,29,30,31,32,33,34,35,40],grid_class:[22,23],grid_cod:20,grid_ensemble_result:[29,33],grid_log:20,grid_opt:[6,8,11,12,13,14,15,20,25,27,28,29,32,33,34,35],grid_options_default:[20,27,31],grid_options_defaults_dict:31,grid_options_descript:[6,15,31],grid_options_description_check:31,grid_options_help:31,grid_result:[6,8,12,13,14,21],grid_vari:[15,21],grid_variable_numb:[6,8,15,32],gridcod:[20,32],gridcode_filenam:21,gridtyp:[6,8,15,32],group:[6,12,16,36],grvitation:5,gsl:[22,37],gsl_dir:[22,37],gt:[5,6,7,8,9,11,13,15,16,17,18],guess:[0,7,30],gyr:[5,6,8],gz:29,gzip:29,h5py:[22,37],h:[0,5,7,9,19],ha:[0,1,2,5,6,7,8,9,10,12,13,14,15,18,19,21,26,29,32],hachisu:[0,7],hachisu_disk_wind:[0,7],hachisu_ignore_qcrit:0,hachisu_qcrit:[0,7],hack:31,had:[6,8,12,13,14,20],half:[0,7,30],hall:[0,7],handi:[0,7],handl:[0,2,3,4,7,11,19,20,21,25,32,33,36,38,40],handle_ensemble_string_to_json:3,happen:[0,6,7,8],hardcod:[9,12,13,14,15],hardli:36,have:[0,2,3,4,5,6,7,8,9,11,12,13,14,15,18,19,20,21,22,24,25,28,29,31,34,37,38],haven:6,hbb:[0,7],hbbtfac:[0,7],hd:24,hdf5:19,hdf5file:19,he:[0,5,7],head:16,header:[1,6,8,9,11,12,13,14,15,18,19],headerlin:15,headlin:21,hegb:[0,5],hehg:0,height:[8,12,15,30],held:[28,34],helium:[0,6,7],helium_flash_mass_loss:[0,7],helium_white_dwarf:0,help:[0,4,5,7,11,12,13,14,15,19,31],help_al:[0,7],hem:0,henc:[0,7,8,13,14,16],hendrik:[0,18,22,37],here:[1,6,7,9,11,12,13,14,16,18,19,20,21,24,30,38],hertzsprung:[0,4,7,22],hertzsprung_gap:0,hertzstrpung:[0,7],heuvel:[0,7],hewd:[0,7],hewd_hewd_ignition_mass:[0,7],hex:21,hg:[0,7],hi:30,high:[0,7,13,14,30],higher:[0,6,7,8,12,13,14,15,19,21,22,30,37],highlight:2,histogram:8,histori:30,hole:[0,4,6,7,22],home:7,homogen:[0,7],hood:11,hook:21,hopefulli:[0,7],hot:[0,7],hour:19,how:[0,2,5,6,7,8,9,11,12,13,14,15,18,21,26,30,32],howev:[0,7,9,12,13,14,15],hoyl:[0,7],hpc:[20,21,25,28,34],hpc_can_join:25,hpc_check_requir:25,hpc_dir:25,hpc_dump_statu:25,hpc_force_join:21,hpc_get_statu:25,hpc_grid:25,hpc_id_filenam:25,hpc_id_from_dir:25,hpc_job:25,hpc_job_task:25,hpc_job_typ:25,hpc_jobid:[20,25],hpc_jobid_tupl:25,hpc_join_from_fil:25,hpc_join_previ:25,hpc_joinlist:25,hpc_load_joinfiles_list:25,hpc_make_joiningfil:25,hpc_njob:25,hpc_path:25,hpc_queue_stat:25,hpc_rebuild_joinlist:[21,25],hpc_restor:25,hpc_set_statu:25,hpc_snapshot_filenam:25,hpc_statu:25,hpc_task:25,hpc_touch:25,hr:24,hr_diagram:24,hrd:[0,6,7,8],hrdiag:[0,7],hrdiag_output:[0,7],htcondor:21,html:[2,6,15,22,29,37],http:[0,1,2,6,7,15,19,29,30],human:19,hurlei:[0,7],hut:[0,7],hybrid:[0,7],hydro:[0,7],hydrogen:[0,6,7],i:[1,2,5,6,7,8,9,11,12,13,14,15,16,19,20,21,22,25,30,32,36,37,40],ia:[0,7,8],iadd:2,ib:[0,5,7],ibc:[0,7],id:[20,21,25,28,29,30,34],id_cor:9,idea:[15,24],ident:2,idum:[0,7],ignit:[0,6,7],ignor:[0,2,7,9,11,15,18,21,30,32],ii:[0,7,18],iia:[0,7],iloc:[11,18],images:21,imf:[0,7,13,14,30],imf_chabrier2003:30,imf_scalo1986:30,imf_scalo1998:30,imf_tinsley1980:30,immedi:[0,6,7,21],implement:[0,2,7,21],impli:[0,7],implic:[13,14],impos:[6,8,12,13,14,15],imposs:8,improv:[30,35],inclin:[0,7],inclination1:[0,7],inclination2:[0,7],inclination3:[0,7],inclination4:[0,7],inclini:[0,7],incliniation_quadrupl:[0,7],incliniation_tripl:[0,7],includ:[0,1,2,6,7,9,11,13,14,15,16,19,20,22,24,29,30,37],include_binary_c_default:[15,20],include_binary_c_help_al:[15,20],include_binary_c_version_info:[15,20],include_default:[15,29],include_popul:15,include_population_set:20,incom:[0,7],increas:[0,5,7,8,12,13,14],inde:[0,7,13,14],indent:[2,3,11,20,29],independ:30,index:[0,7,10,11,16,21,22,25,30,32],indic:[0,7,30],individu:[4,12,22],individual_nova:[0,7],induc:[0,7],inertia:[0,7],info:[7,10,15,19,20,22,24,36,37],inform:[0,1,3,4,6,9,11,12,13,14,15,19,20,21,24,25,30,31,33,36],init:20,init_abund:[0,7],init_abund_dex:[0,7],init_abund_mult:[0,7],init_abunds_onli:[0,7],initi:[0,4,5,7,10,11,18,20,30],initial_abundance_hash:20,initial_abundance_mix:[0,7],initial_abunds_onli:[0,7],initial_grid:18,initial_mass:[11,18],initial_tim:18,inlin:18,inner:[0,7,16],input:[1,3,7,10,11,19,20,21,22,24,29,30,31,38,40],input_dict:2,insert:[15,32],insid:[0,7],inspect:[2,11,24],inspect_dict:2,inspir:[1,24,40],instabl:[0,7],instal:[21,40],install_without_depend:[22,37],instanc:[2,11,12,13,14,15,30],instant:[0,7],instantli:[0,7],instead:[0,5,7,13,14,19,21],integ:[0,6,7,21,35,40],integr:[12,13,14,30,35],integrals_str:30,intens:[13,14],interact:[0,3,5,6,7,8,16,18,31],interfac:[7,16,19,22,25,37],interfer:[22,37],intermedi:8,intern:[0,7,10,21],internal_buff:[0,7],internal_buffering_off:0,internal_buffering_print:0,internal_buffering_stor:0,interpol:[30,35],interpolate_in_mass_izzard2012:30,interpolator_nam:30,intershel:[0,7],interstellar:[0,7],intger:[0,7],intro:[0,7],introduc:5,introduct:6,inv:[5,18],invers:40,invert_xaxi:6,involv:[0,7],inward:[0,7],io:29,ipykernel_216542:16,ipykernel_519112:13,ipynb:[12,13,14,15],is_capsul:19,isfil:15,isfloat:19,isint:19,isn:[13,14,19],isnt:15,isotop:[0,7,10,36],isotope_hash:20,isotope_list:20,issu:25,item:[1,2,6,8,12,13,14],iter:19,its:[0,2,3,7,12,13,14,15,16,19,21,22,24,25,29,31,35,36,37,38],itself:[3,6,9,11,21,22,30,37],iwamoto:[0,7],izzard2012_period_distribut:30,izzard:[0,6,7,8,11,12,13,14,15,22,37],jager:[0,7],jaschek:30,jeff:[22,37],jej:5,jerki:6,jf:5,jia:[0,7],job:[20,21,25,28,34],job_id:25,job_index:25,jobarrayindex:[21,34],jobid:[20,21,34],john:[0,7],join:[7,9,11,15,18,21,25],joinfil:25,joiningfil:25,joinlist:[21,25],jorb_in:5,jorb_out:5,jordi:[0,7],json:[3,7,11,15,20,21,29],json_data:2,jsondecod:3,jsonencod:3,jtot_in:5,jupit:16,jupyt:[22,37],just:[0,2,6,7,8,15,18,19,20,21,22,29,36,37,40],k1:[5,11,18],k2:[5,11,18],k:[0,6,7,16,30],kap:[0,7],kappa:[0,7],kaps_rentrop:[0,7],karaka:[0,7],keep:[8,15,29],kei:[1,2,3,6,10,11,15,16,18,19,20,21,24,27,29,30,31,32,36],kelvin:[0,7],keplerian:[0,7],keys_to_float:2,keyword:[13,24,38],kick:[0,5,7,18,21],kick_backward:0,kick_forward:0,kick_inward:0,kick_outward:0,kick_random:0,kick_straight_up:0,kick_velocity_custom:0,kick_velocity_fix:0,kick_velocity_maxwellian:0,kill:[1,9,15,20],kilonova:6,kim:[0,7],kind:[0,7],kippenhahn:[0,7],klencki:[0,7],km:[0,7],know:[0,1,7,10,11,13,14,21,29,31],known:[0,6,7,11,12,13,14,15,20,30,38],kroupa2001:[15,30,32],kroupa:[13,14,30],krticka:[0,7],ktg93:30,kwarg:[18,20,24,25,26,27,28,29,30,31,32,33,34,35,36,38],l1:5,l2:[0,7],l:[0,6,7,12,13,14],l_:[12,13,14],label:[6,18,30],lambda:[0,5,7,8],lambda_:8,lambda_c:[0,5,7,8],lambda_ce_dewi_tauri:[0,7],lambda_ce_klencki_2020:[0,7],lambda_ce_polytrop:[0,7],lambda_ce_wang_2016:[0,7],lambda_enthalpi:[0,7],lambda_ion:5,lambda_ionis:[0,7],lambda_min:[0,7],lambda_mult:[0,7],lambda_multipli:[0,7],lambda_v:30,lamer:[0,7],landau:[0,7],langer:[0,7],languag:6,larger:[0,6,7],last:[4,13,16,18,19,30],last_st:18,last_stellar_type_change_time_1:18,lastli:[7,11],late:18,later:[12,13,14,21],latest0:[6,8,12],latest1:[6,8,12],latest2:[6,15],latest3:6,latest4:6,latest5:6,latest:[22,37],latter:[0,7],launch:[21,28,34],law:[13,14,30],law_const:30,lbv:[0,7],ld_library_path:[22,37],ldist:[13,14],lead:[0,6,7,12,13,14,15,29,30,40],learn:[9,21],least:[22,37],leav:[0,7,21],left:[0,7],legaci:[0,7],legacy_yield:[0,7],legend:[16,18],len:[5,6,11,15,18],length:[5,19],lengthen:[0,7],leq:6,less:[0,1,4,5,7,29,30],let:[5,8,11,12,13,14,15,16,20],level:[1,6,19],lfucach:21,li7:[0,7],li:[0,7],lib:[7,11,17,18,22,37],libbinary_c:21,libcustom_logging_0639ee205c7d4782b4a27378f5d890bd:11,libcustom_logging_dafa15d2b1e64e19972ac0e9eb5c9a55:11,libgsl:[22,37],libmemo:[22,37],librari:[0,1,6,7,9,18,20,21,38],library_path:[22,37],librinterpol:[22,37],life:8,lifetim:[0,7,8,12,13,14,15,35],lifshitz:[0,7],like:[0,1,6,7,8,12,13,14,15,18,19,21,22,24,29,35,37],limit:[0,6,7,8,12,13,14,15,21,24],line:[1,5,6,8,9,11,12,13,14,15,16,17,19,20,21,22,24,29,35,37],linear2:21,linear:[0,7,12,13,14,21,30,35],linear_extrapolation_q:30,linearli:[13,14,35],linedata:[6,8,12,13,14],lineplot:[6,8,12,13,14,16],linewidth:[6,8,12,13,14,16],linker:1,linspac:35,linux:7,list:[0,1,2,3,6,7,8,11,12,13,14,15,16,19,21,25,27,30,32,35,38],list_arg:[0,7],list_of_sub_kei:2,lit:[0,7],lithium:[0,7],lithium_gb_post_1dup:[0,7],lithium_gb_post_heflash:[0,7],lithium_hbb_multipli:[0,7],lithium_t:[0,7],littl:[5,6,8,12,16,27],littleton:[0,7],liu:[0,7],ll:[9,10,13,14,16,29],llnl:[0,7],ln:30,lnm1:[8,12,13,14,15],lnm_1:[13,14,32],load:[0,1,3,6,7,8,9,11,12,13,14,15,18,19,20,21,24,25,29,32],load_ensembl:3,load_logfil:19,load_population_object:29,load_snapshot:29,lobe:[0,5,7,8,40],loc:16,local:[7,21,30],locat:[0,7,21,22,30,35,37],lock:[5,29],lock_lifetim:29,lock_object:29,lock_suffix:29,lock_timeout:29,locked_clos:29,locked_open_for_writ:29,lockfil:29,lodder:[0,7],log10:[0,6,7,8,12,13,14,15,30,35],log10m1:21,log10mass:35,log10p:30,log10per:[8,12,15],log10pmin:30,log:[0,1,4,5,7,11,16,17,19,21,22,24,29,30,32,35,37,38,40],log_:[6,8,12,13,14],log_arg:21,log_args_dir:21,log_arrow:[0,7],log_dt:[8,21],log_every_timestep:[9,11],log_fil:[5,21],log_filenam:[0,5,7,11,18,38],log_newlin:21,log_runtime_system:21,logarithm:[13,14,30,35],logensembletim:[0,7],logfil:[11,19,22,37],logg:[0,6,7],logger:15,logging_dict:1,logging_lin:[9,17,18],loggrav:6,logi:17,logic:[1,2,9,20,21],logl:6,logmass:[30,35],logp:30,logper:[8,30],logperiod:30,logperrang:[8,12],logspac:35,logteff:6,long_spectral_typ:30,longer:[0,6,7,8],longnam:[6,8,12,13,14,15,32],look:[1,3,6,8,12,13,14,15,18,22,30,37],lookback:[0,7],loon:[0,7],loop:[6,8,11,12,13,14,15,29,32],loos:24,lose:[0,7,18],loss:[0,5,7,11,12,16],lost:[0,7,8,18],lot:[6,12,13,14,15,16,21,36,38],lovegrov:0,low:[0,6,7,8,13,14,30],low_mass_m:0,low_mass_main_sequ:0,lower:[0,7,12,15,30,32,35],lowest:30,lru:27,lru_:27,lrucach:21,lsoda:[0,7],lsun:[0,7,24],lt:[6,7,8,11,13,15,16,17],lucianopaz:29,lugaro:[0,7],luminos:[0,4,6,7,22,24],luminosity_1:24,luminosity_2:24,luminosu:6,lw:[0,7],lynnett:[0,7],m01:5,m0:30,m1:[0,5,7,8,9,11,12,13,14,15,18,29,30,40],m2:[5,8,9,11,12,15,18,29,30,40],m3:30,m4:30,m:[0,5,6,7,8,12,13,14,16,18,19,30,40],m_1:[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,32,38],m_2:[0,5,6,7,8,9,11,12,15,17,18],m_3:[0,7],m_4:[0,7],m_:18,m_max:[15,30,32],m_min:[15,32],m_sun:6,maccretor:[0,5,7],machin:[8,21,22,37],macro:[0,7,10,19,36],madau:30,made:[6,22,25,37],maeder:[0,7],magellan:[0,7],magnet:[0,7],magnetic_braking_algorithm:[0,7],magnetic_braking_algorithm_andronov_2003:0,magnetic_braking_algorithm_barnes_2010:0,magnetic_braking_algorithm_hurley_2002:0,magnetic_braking_algorithm_rappaport_1983:0,magnetic_braking_factor:[0,7],magnetic_braking_gamma:[0,7],magnitud:19,mai:[0,7,8,12,29],main:[0,1,6,7,9,12,13,14,15,18,21,22,37],main_sequ:[0,7,12,13,14,18],mainprocess:[6,8,12],major:[0,7],make:[0,1,2,3,5,6,7,8,11,12,13,14,15,16,18,19,20,21,22,24,25,28,29,30,37,38,40],make_analytics_dict:26,make_build_text:19,make_condor_dir:28,make_slurm_dir:34,makedir:[15,19],makejoiningfil:25,manag:[19,22,37],mani:[0,6,7,8,10,12,13,14,15,21,28],manual:[9,21],manufactur:[0,7],map:21,mar:16,maria:[0,7],mass:[0,1,2,4,5,6,7,8,10,11,12,15,16,18,19,21,24,30,32,35,36,38,40],mass_1:[15,18,24],mass_2:[15,18,24],mass_accretion_for_eld:[0,7],mass_accretor:40,mass_donor:40,mass_evolut:24,mass_for_hestar_ia_low:[0,7],mass_for_hestar_ia_upp:[0,7],mass_loss_m:18,mass_lost:18,mass_of_pmz:[0,7],mass_rang:18,mass_str:30,massiv:[0,4,5,6,7,8,12,16,22,30],massless:[0,7],massless_remn:0,massloss:0,massrang:[6,8,12,13,14],master:[21,24],match:[0,2,6,7,11,12,15,16,21,24,27],materi:[0,6,7],math:[6,8,12,13,14,15,16,32,35],mathieu:30,mathrm:[6,8,12,13,14],matplotlib:[6,8,13,14,16,18,22,24,37],matter:[0,7],mattsson:[0,7],mattsson_mass_loss:[0,7],mattsson_orich_tpagbwind:[0,7],max:[0,7,8,9,12,13,14,15,21,30],max_bound:[30,35],max_column:[6,8,16],max_evolution_tim:[0,1,6,7,8,9,11,12,13,14,15,16,18,35],max_hewd_mass:[0,7],max_logp:30,max_model_numb:[0,7],max_multipl:30,max_neutron_star_mass:[0,7],max_queue_s:21,max_row:[6,8,16],max_stellar_angmom_chang:[0,7],max_stellar_type_1:[0,7],max_stellar_type_2:[0,7],max_stellar_type_3:[0,7],max_stellar_type_4:[0,7],max_tim:[5,11,18],max_val:30,maxcount:5,maxdm:35,maximum:[0,6,7,8,9,12,13,14,15,21,30,35,40],maximum_mass_ratio_for_instant_rlof:[0,7],maximum_mass_ratio_for_rlof:40,maximum_mcbagb_for_degenerate_carbon_ignit:[0,7],maximum_nuclear_burning_timestep:[0,7],maximum_timestep:[0,7],maximum_timestep_factor:[0,7],maxmimum:[0,7],maxsiz:21,maxwellian:[0,7],mayb:24,mayor:30,mb:[6,8,12,14,15,19,21],mc13_pocket_multipli:[0,7],mc1:5,mc:[0,5,7,15,18,29],mch:[0,7],mcmin:[0,7],mdonor:[0,5,7],mean:[0,5,7,19,21,22,28,30,34,35,37],meant:21,measur:19,medium:[0,7],mega:30,megabyt:21,mem:[8,12],mem_us:19,memaddr:[7,9],memori:[1,6,7,8,9,12,14,15,18,19,20,21,29,40],menv:[0,5,7],mer:5,mercuri:16,merg:[0,2,5,6,7,8,21,25,29,30],merge_dict:[2,10],merge_multipl:30,merge_popul:29,merge_populations_from_fil:29,merger:[0,5,7],merger_angular_momentum_factor:[0,7],merger_mass_loss_fract:[0,7],mesa:[22,37],mesasdk_init:[22,37],mesasdk_root:[22,37],mess:16,messag:[19,20],messi:6,mestel:[0,7],met:[15,20,25,32],metadata:[20,32,33],metal:[0,5,6,7,8,9,11,12,13,14,15,16,17,18,30,40],metallicity_0002:18,metallicity_001:18,metallicity_002:18,method:[0,7,9,11,12,13,14,15,18,20,21,29,31,32,36],meynet:[0,7],mf1:5,mf2:5,might:[2,3,8,12,15,16,19,21,22,29,37],milki:[0,7],miller:[0,7],min:[8,9,12,13,14,15,30],min_bound:[30,35],min_logp:30,min_per:30,min_val:30,mind:18,mindm:35,minimal_verbos:19,minimum:[0,7,19,21,30,35,36,40],minimum_co_core_mass_for_carbon_ignit:[0,7],minimum_co_core_mass_for_neon_ignit:[0,7],minimum_donor_menv_for_comenv:[0,7],minimum_envelope_mass_for_third_dredgeup:[0,7],minimum_helium_ignition_core_mass:[0,7],minimum_mcbagb_for_nondegenerate_carbon_ignit:[0,7],minimum_orbital_period_for_instant_rlof:[0,7],minimum_period_for_rlof:40,minimum_separation_for_instant_rlof:[0,7],minimum_separation_for_rlof:40,minimum_stellar_mass:36,minimum_time_between_pn:[0,7],minimum_timestep:[0,7],mint:[0,7],mint_data_cleanup:[0,7],mint_dir:[0,7],mint_disable_grid_load_warn:[0,7],mint_fallback_to_test_data:[0,7],mint_hard_max_nshel:[0,7],mint_hard_min_nshel:[0,7],mint_kippenhahn:[0,7],mint_kippenhahn_companion_stellar_typ:[0,7],mint_kippenhahn_stellar_typ:[0,7],mint_maximum_nshel:[0,7],mint_maximum_shell_mass:[0,7],mint_metal:[0,7],mint_minimum_nshel:[0,7],mint_minimum_shell_mass:[0,7],mint_ms_rejuven:[0,7],mint_nshel:[0,7],mint_nuclear_burn:[0,7],mint_remesh:[0,7],mint_use_zams_profil:[0,7],minut:[8,19],mira:[0,7],misc:[7,22],miscellan:[10,36],miss:[0,7,12,13,14,19,31],mistak:21,mix:[0,2,7,21],mixtur:[0,7,12],mmax:[13,14,30,35],mmin:[13,14,21,30,35],mnra:40,mode:29,model:[0,1,6,7,8,9,11,12,13,14,15,16,17,18,21],model_numb:[12,13,14],modif:4,modifi:[0,2,7,9,22,37],modul:[0,7,8,10,12,13,14,15,16,21,23],modulo:21,moe2017_opt:21,moe:[15,22,25,30],moe_di_stefano_2017:20,moe_di_stefano_2017_multiplicity_fract:30,moe_di_stefano_2017_pdf:30,moment:[0,6,7,9,15,18,35],momenta:[0,7,24],momentum:[0,7,16],monoton:[13,14],mont:[0,7,21],monte_carlo_kick:[0,7],more:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,35,37],most:[6,7,8,13,14,16,19],mostli:[6,8,12,13,14,15,18,19,21,24,31,38],mount:29,move:[0,6,7],mrucach:21,ms:[0,5,7,9,12],msgpack:29,mstart:5,msun:[0,6,7,9,11,12,13,14,16,18,30,35,36],mu:[0,7],much:[0,6,7,8,12,15,18,19,26],multipl:[0,2,6,7,21,30],multiplc:[0,7],multipli:[0,2,7,13,14,21,35],multiplicity_arrai:30,multiplicity_fraction_funct:21,multiplicity_model:21,multiplicity_modul:21,multiply_float_valu:2,multiply_values_dict:[2,10],multiprocess:21,must:[0,2,6,7,8,11,12,13,14,15,16,29,32,35],mw:[0,7],my:11,my_stellar_data:[1,9,15,17,18],myr:[0,6,7,8,11,12,13,14,16,35],n100:[0,7],n100_z0:[0,7],n100h:[0,7],n100l:[0,7],n10:[0,7],n150:[0,7],n1600:[0,7],n1600c:[0,7],n1:[0,7],n200:[0,7],n20:[0,7],n300c:[0,7],n3:[0,7],n40:[0,7],n5:[0,7],n:[0,1,5,6,7,8,9,11,12,13,14,15,17,18,19,21,25,30],n_logging_stat:21,naked_helium_star_giant_branch:0,naked_helium_star_hertzsprung_gap:0,naked_main_sequence_helium_star:0,name:[1,2,5,6,7,8,12,13,14,15,16,18,19,21,28,29,31,32,38,39],nameerror:16,narrow:[13,14],natur:[0,7,13,14],nauenberg:[0,7],nazehdin:0,nb:[0,7],nbinary_c:18,ncol:18,nearer:[0,7],nearest:[8,12,13,14],nebula:[0,7],necessari:[8,15,16,18,19,20,34],need:[0,2,7,9,11,12,13,14,15,16,18,21,22,25,30,37,40],neg:[0,2,7,35],neither:[0,7,20],neleman:[0,7],nelemans_gamma:[0,7],nelemans_max_frac_j_chang:[0,7],nelemans_minq:[0,7],nelemans_n_comenv:[0,7],nelemans_recalc_eccentr:[0,7],nemp:[0,7],nemp_cfe_minimum:[0,7],nemp_nfe_minimum:[0,7],nenamg:[0,7],neon:[0,6,7],neptun:16,nest:[2,15,32,36],network:[0,7,10],neutrn:[0,7],neutron:[0,6,7,15],neutron_star:0,never:[0,6,7,13,14,21,27],newdict:2,newer:[0,2,7],newli:[0,7],newlin:[19,21,29],newnam:32,newobj:25,newopt:[2,30],newpop:29,newton:[0,7],next:[12,13,14,15,19],nf:[21,29],nfs_flush_hack:29,nfspath:29,nice:[20,24],nieuwenhuijzen:[0,7],nieuwenhuijzen_windfac:[0,7],nine:6,nmax:30,no_thermohaline_mix:[0,7],nocach:21,node:21,noecho:[0,7],noechonow:[0,7],noel:[0,7],nolowq:21,nomin:[0,7],non:[0,2,7,13,14,21,29],nonconservative_angmom_gamma:[0,7],none:[0,1,2,3,5,6,7,8,12,14,15,16,18,19,20,21,25,27,28,29,30,31,32,34,35,40],nonetyp:2,nonzero:21,nor:[0,7],norm:21,normal:[0,2,7,20,25,35,36],normalis:[2,21,30],normalize_dict:2,normalize_multipl:21,nospac:19,notabl:15,notat:19,note:[0,5,6,7,12,13,14,15,18,19,21,25,29,32,35,36],notebook:[5,6,7,8,9,10,11,12,13,14,15,16,22,37],notebook_api_funct:11,notebook_bhbh:5,notebook_comenv:8,notebook_custom_log:[11,12,13,14,15],notebook_hrd:6,notebook_individual_system:[9,11,12,13,14,15],notebook_luminos:[13,14],notebook_luminosity_funct:12,notebook_luminosity_function_binari:[13,14],notebook_popul:[11,15],notebook_solar_system:16,noteworthi:4,noth:[2,21,25,29],notic:[13,14],notifi:38,nov:18,nova:[0,6,7,8],nova_faml_multipli:[0,7],nova_irradiation_multipli:[0,7],nova_retention_algorithm_claeys2014:0,nova_retention_algorithm_const:0,nova_retention_algorithm_hillman2015:0,nova_retention_fract:[0,7],nova_retention_method:[0,7],nova_timestep_accelerator_index:[0,7],nova_timestep_accelerator_max:[0,7],nova_timestep_accelerator_num:[0,7],now:[0,2,5,6,7,8,9,11,12,13,14,15,16,18,19,30],now_object:19,np:[11,17,18,35],nre:[12,35],nrow:18,ns:[0,1,7,8,9,15],nsep:8,nsep_max:8,nsep_min:8,nstar:[6,12],nuclear:[0,7],nuclear_mass_hash:20,nuclear_mass_list:20,nucleosynthesi:[0,7,36],nucleosynthesis_sourc:[10,36],nucreacmult:[0,7],nucsyn:[7,22],nucsyn_angelou_lithium:[0,7],nucsyn_gce_outflow_check:[0,7],nucsyn_hbb:[0,7],nucsyn_metal:[0,7],nucsyn_network:[0,7],nucsyn_network_error:[0,7],nucsyn_s_process:[0,7],nucsyn_solv:[0,7],nucsyn_third_dredge_up:[0,7],nugi:[0,7],nullcach:[21,27],num_ansi_colour:[0,7],num_cor:[6,8,12,13,14,15,21],num_cores_avail:21,number:[0,2,3,5,6,7,8,12,13,14,15,16,18,19,20,21,22,25,29,30,31,32,35,37],numer:2,numpi:[11,15,17,18,19,22,32,35,37],o:[3,7,19,22,30],obj:[3,19],object:[0,2,3,4,7,16,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,38],object_hook:3,object_pairs_hook:3,object_parse_funct:11,observ:[12,13,14],obtain:[0,6,8,12,13,14,29],obvious:9,occur:[0,7,40],odot:[6,8,18],off:[0,5,7,15,18,21],off_m:[5,11,18],offset:[0,7],oh:5,ohio:[0,7],ok:[25,29],old:[13,14,21,32],oldnam:32,omega:[0,5,7,18],on_exit_or_evict:21,onc:[0,7,35],one:[0,2,7,10,13,14,15,16,17,18,21,24,27,29,31,35,38],onewd:0,onli:[0,2,6,7,9,12,13,14,15,16,18,19,21,25,29,35,40],onset:[0,7],onto:[0,7,30],oop:5,opac:[0,7],opacity_algorithm:[0,7],opacity_algorithm_ferguson_op:0,opacity_algorithm_paczynski:0,opacity_algorithm_star:0,opal:[0,7],open:[3,5,11,15,18,29],open_ensembl:3,opendir:29,oper:[2,29],opm:30,opt:[2,5,7,30],option:[0,1,2,6,7,8,12,13,14,15,16,17,18,19,20,22,25,27,29,30,31,32,35,37,40],orb:[8,15,29],orbit:[0,5,7,8,12,16,24,30,40],orbit_evolut:24,orbital_eccentr:16,orbital_inclin:[0,7],orbital_inclinationi:[0,7],orbital_period:[0,5,7,8,9,11,12,15,17,18,40],orbital_period_quadrupl:[0,7],orbital_period_tripl:[0,7],orbital_phas:[0,7],orbital_phase_quadrupl:[0,7],orbital_phase_tripl:[0,7],orbital_separ:16,orbiting_object:[0,7,16],orbiting_objects_close_pc_threshold:[0,7],orbiting_objects_log:[0,7,16],orbiting_objects_tides_multipli:[0,7],orbiting_objects_wind_accretion_multipli:[0,7],order:[2,4,15,19,32],ordereddict:2,org:[0,2,7,30],orient:8,origin:[16,22,29,37],original_command_lin:21,original_submission_tim:21,original_working_diretori:21,os:[5,6,8,11,12,13,14,15,16,18,19],other:[0,1,2,6,7,10,11,12,13,14,15,19,21,22,24,25,30,31,37],otherwis:[0,7,19,20,21,25,26,28,29,31,34],our:[6,8,12,13,14,21,30],out:[2,3,6,8,9,12,13,14,16,19,21,30,31],outcom:[0,7],outer:[0,6,7],outermost_core_mass:6,outfil:[15,20],outfile_nam:1,outfilenam:15,output:[1,2,3,4,5,7,9,10,11,16,17,18,19,20,21,22,24,29,36,37,38,40],output_dict:[6,8,11,12],output_dir:[11,15,29],output_fil:[11,19,29,31],output_filenam:[15,29],output_lin:19,outsid:[0,7,30],outward:[0,7],over:[2,6,8,10,11,12,13,14,15,19,20,29],overflow:[0,5,7,8],overhead:21,overlap:2,overrid:[2,18,21,30,32,35],overriden:15,overshoot:[0,7],overspin_algorithm:[0,7],overspin_bs:[0,7],overspin_massloss:[0,7],overview:7,overwrit:[21,25],own:[9,11,15,17,18,21,22,32,37],oxygen:[0,6,7],oxygen_neon_white_dwarf:0,p0:30,p1:30,p2:30,p3:30,p:[6,8,12,13,14,16,30,31],p_:8,p_in:5,p_out:5,packag:[3,7,15,19,22,32,33,34,35,37],paczynski:[0,7],pad:[8,12,13,14],pad_output_distribut:[6,8,12,13,14,19],page:[0,6,7,15,22,37],pair:[0,2,5,19,32,36],panda:[6,8,11,12,13,14,16,17,18,19,22,24,37],pane:24,panel:[0,7],paper:[0,7],parallel:32,param:19,param_nam:19,paramet:[1,2,3,4,6,7,8,9,11,12,13,14,15,19,20,21,22,24,25,27,28,29,30,31,32,34,35,36,38,40],parameter_nam:[3,6,7,8,10,12,13,14,15,19,32],parameter_value_input_typ:[10,19],pars:[3,4,6,8,11,12,13,14,15,18,19,20,24,36,38],parse_binary_c_version_info:36,parse_cmdlin:20,parse_const:3,parse_data:8,parse_float:3,parse_funct:[6,8,11,12,13,14,15,20,21,38],parse_function_hr_diagram:24,parse_function_mass:24,parse_function_orbit:24,parse_int:3,parse_output:18,parsec:30,part:[6,7,11,12,13,14,15,18,20,30,32,40],partial:[0,7],particularli:[0,7],partit:21,partner:29,pasp:30,pass:[7,9,11,15,16,18,19,20,21,22,24,25,28,29,34,35,37,38],path:[11,15,18,19,21,22,25,27,28,29,31,34,37],patho:[22,37],pd:[6,8,11,12,13,14,16,17,18],pdf:[0,7,18,22,30,37],peak:[8,13,14,35],peak_normalized_gaussian_func:35,pend:[0,5,7],per:[0,5,7,8,11,12,15,19,21,29,40],percentag:[0,7],peret:[0,7],perfect:[13,14],perfectli:[12,13,14],perform:[0,7,29],perhap:[0,6,7,8,20],periastron:[0,7],pericent:40,period:[0,5,7,8,9,11,12,13,14,15,16,18,24,30,40],period_str:30,perl:[1,2,12,13,14,15,28],persist:7,persistent_data:7,pgo:[0,7],phase:[0,6,7,8,12,13,14],phasevol:[0,7,15],phdi:0,phi:[5,18],photoevapor:[0,7],php:30,physic:[6,12,13,14,15,21],pick:24,pickl:29,pid:20,piec:[15,18,32],pinnsonneault:[0,7],pisn:0,pkg:[22,37],pl:20,place:[0,7,12,19,21],placehold:[24,27,28,29],plai:[0,7,13,14],plan:21,planet:16,planetari:[0,7],plaw2:21,pleas:[0,6,7,12,13,14,15,19,21,27],plot:[0,6,7,8,11,12,13,14,16,17,18,24],plot_data:[8,12,13,14],plot_funct:[22,23],plot_hr_diagram:24,plot_hr_diagram_singl:24,plot_mass:24,plot_orbit:24,plot_system:24,plot_typ:24,plt:[6,8,13,14,16,18],plu:[0,7],pluto:16,pm:24,pms_mass_1:24,pms_mass_2:24,pn:[0,7],pn_comenv_transition_tim:[0,7],pn_fast_wind:[0,7],pn_fast_wind_dm_agb:[0,7],pn_fast_wind_dm_gb:[0,7],pn_fast_wind_mdot_agb:[0,7],pn_fast_wind_mdot_gb:[0,7],pn_hall_fading_time_algorithm:[0,7],pn_hall_fading_time_algorithm_maximum:[0,7],pn_hall_fading_time_algorithm_minimum:[0,7],pn_resolv:[0,7],pn_resolve_maximum_envelope_mass:[0,7],pn_resolve_minimum_effective_temperatur:[0,7],pn_resolve_minimum_luminos:[0,7],pne:[0,7],png:18,pogg:[0,7],point:[0,3,6,7,19,20,21,22,29,30,35,37],poisson:[21,30],pol:[0,7],polytrop:[0,7],poor:[13,14],pop:[5,9,16,27],pop_macro:9,popitem:27,popul:[0,3,4,7,20,22,25,26,27,28,29,30,31,32,33,34,35,36,37,38],population_extens:[20,25,26,27,28,29,30,31,32,33,34,35,36],population_id:21,population_nam:[6,8,12,14,15],population_object:29,population_set:20,posit:[0,7,8,30],possibl:[0,1,2,6,7,11,16,19,21,22,27,30,31,37],post:[0,5,6,7,8,9,20],post_ce_adaptive_menv:[0,7],post_ce_envelope_dm_eagb:[0,7],post_ce_envelope_dm_gb:[0,7],post_ce_envelope_dm_tpagb:[0,7],post_ce_objects_have_envelop:[0,7],post_comenv_period:8,post_sn_orbit_bs:0,post_sn_orbit_method:[0,7],post_sn_orbit_tt98:0,postagb_legacy_log:[0,7],postagb_wind_gi:0,postagb_wind_krticka2020:[0,7],postagb_wind_non:[0,7],postagb_wind_use_gi:[0,7],postagbwind:[0,7],postcod:[6,8,15,32],potenti:[0,7],pow2:6,power:[0,7,8,13,14,21,30],powerlaw:30,powerlaw_const:30,powerlaw_constant_nocach:30,powerlaw_extrapolation_q:30,ppisn:0,ppisn_additional_massloss:0,ppisn_core_mass_range_shift:0,ppisn_farmer19:0,ppisn_new_fit_21:0,ppisn_non:0,ppisn_prescript:0,ppn_envelope_mass:[0,7],pragma:9,pre:[0,5,7,8,18,24],pre_comenv_period:8,pre_events_stardata:[0,7],pre_main_sequ:[0,7],pre_main_sequence_fit_lob:[0,7],precis:3,precod:[6,8,12,13,14,15,32],predefin:[12,13,14,15,30],predict:21,predictor:[0,7],prefer:[0,7,20],prefix:[0,7],preloaded_popul:29,prep:0,prepar:2,prepare_dict:2,presc:5,prescrib:[0,7],prescript:[0,5,7,15],prescrit:[0,7],present:[2,3,6,12,13,14,15,18,20,29,30],preserv:[0,7],preset:24,pressur:[0,7],prev_stellar_type_1:15,prev_stellar_type_2:15,prevent:[0,5,6,7,21],previou:[8,13,14,19,21,36],previous:[11,15,25],previous_stardata:[1,8,9,11,15],primari:[1,6,8,12,13,14,15,30,32,40],prime:8,pringl:[0,7],print:[2,5,6,7,8,9,10,11,12,13,14,15,16,18,19,21,25,31],print_help:[10,19],print_info:31,print_option_descript:31,print_stack_on_exit:21,print_structur:2,printf:[1,6,8,9,11,12,13,14,15,17,18],prior:[0,6,7],privat:[20,22],prob_dict:30,probability_weighted_mass:21,probabl:[0,1,2,6,7,8,9,12,13,14,15,18,20,21,24,29,30,31,32],probdist:[6,8,12,13,14,15,32],problem:[0,7,12],probtot:[13,14],process:[0,6,7,8,12,13,14,15,17,18,19,20,21,25,28],process_:29,processor:[6,8,12],produc:6,profil:[0,7],progenitor:[0,7,15],program:[6,22,37],progress:19,project:[0,7],proper:[6,9,31],properli:[0,7],properti:[0,19,21,24,32],proport:8,prot1:[0,7],prot2:[0,7],prot3:[0,7],prot4:[0,7],provid:[0,7,15,20,21,25,30,38],pseudorandom:[0,7],publicli:9,puls:[0,6,7,40],pulsat:0,pump:[0,7],purpos:[12,13,14,15,21,24],push:16,push_macro:9,put:[1,6,8,12,13,14,15,18,19,21,24,25,31,32,33],pwd:21,py:[6,8,12,13,14,15,16,21,22,27,37],py_rinterpol:[22,37],pyenv:[22,37],pyplot:[6,8,13,14,16,18],pysiz:19,pytest:[22,37],python3:[7,22,37],python:[2,3,4,6,8,12,13,14,19,21,27,29,30,32],q:[0,5,7,8,12,15,18,21,30,40],q_high_extrapolation_method:21,q_interpol:30,q_low_extrapolation_method:21,q_min:30,qc:5,qcrit_bh:[0,7],qcrit_bs:0,qcrit_cheb:[0,7],qcrit_chen_han_formula:0,qcrit_chen_han_t:0,qcrit_cowd:[0,7],qcrit_degenerate_bh:[0,7],qcrit_degenerate_cheb:[0,7],qcrit_degenerate_cowd:[0,7],qcrit_degenerate_eagb:[0,7],qcrit_degenerate_gb:[0,7],qcrit_degenerate_hegb:[0,7],qcrit_degenerate_hehg:[0,7],qcrit_degenerate_hem:[0,7],qcrit_degenerate_hewd:[0,7],qcrit_degenerate_hg:[0,7],qcrit_degenerate_lmm:[0,7],qcrit_degenerate_m:[0,7],qcrit_degenerate_n:[0,7],qcrit_degenerate_onewd:[0,7],qcrit_degenerate_tpagb:[0,7],qcrit_eagb:[0,7],qcrit_gb:[0,7],qcrit_gb_bs:0,qcrit_gb_chen_han_formula:0,qcrit_gb_chen_han_t:0,qcrit_gb_ge2015:0,qcrit_gb_hjellming_webbink:0,qcrit_gb_q_no_comenv:0,qcrit_gb_temmink2021:0,qcrit_gb_vos2018:0,qcrit_ge2015:0,qcrit_hegb:[0,7],qcrit_hehg:[0,7],qcrit_hem:[0,7],qcrit_hewd:[0,7],qcrit_hg:[0,7],qcrit_hjellming_webbink:0,qcrit_lmm:[0,7],qcrit_m:[0,7],qcrit_n:[0,7],qcrit_onewd:[0,7],qcrit_q_no_comenv:0,qcrit_temmink2021:0,qcrit_tpagb:[0,7],qcrit_vos2018:0,qcrits_:[0,7],qcrits_degenerate_:[0,7],qdata:30,qlimit:30,qmin:30,qs:30,quad:21,quadrat:[0,7],quadrulpl:[0,7],quadrupl:[0,7,21,30],quantiti:24,queri:[11,25],queue:[6,8,12,21,25,28],quickli:11,quit:[0,6,7,19,30],r1:[5,11,18],r2:[5,11,18],r:[0,1,5,6,7,11,15,18,22,29,37],r_l:40,r_sun:6,radau:[0,7],radi:[0,7],radiat:[0,7],radii:[0,7,40],radiu:[0,1,6,7,9,15,17,24,40],radius_1:24,radius_2:24,ragb:40,raghavan2010_binary_fract:30,raghavan:30,rai:[0,7],railton:[0,7],rais:[0,2,7,15,19,21],ram:[0,7,21],ran:[6,8,12,21],randbuf:[5,18],random:[0,5,7,18,21],random_count:[5,11,18],random_se:[0,5,7,11,18],random_skip:[0,7],random_system:[0,7],random_systems_se:[0,7],rang:[0,6,7,8,11,12,13,14,15,21,30,32,35],rapid:[0,7],rapidli:[0,7],rappaport:[0,7],rate:[0,7,13,14,30],rather:[0,2,7,9,11,15,19,21,22,25,36,37],ratio:[0,6,7,8,12,13,14,15,30,40],raw:[3,7,18,19,20,21,24,36,38],raw_output:3,rc:[5,6,8,12,13,14,16,24],re:[0,1,6,7,8,12,13,14,16,25,31],reach:[0,5,6,7,8],reaction:[0,7],read:[3,4,5,11,15,18,19,21,29],readabl:19,readlin:5,real:[6,12,15,32],realist:[13,14],realiti:[13,14],realli:[0,6,7,15,20,21,31,32],reason:[0,7,13,14],rebuild:[0,7,21,22,25,37],rebuilt:[22,37],recalcul:[0,7],receiv:19,recent:[13,16],recogn:15,recognis:29,recombin:[0,7],recommend:[1,4,22,37],recompil:[12,13,14,15,22,37],reconsid:31,recurs:[2,19],recursive_change_key_to_float:2,recursive_change_key_to_str:2,red:[0,6,7,13,14,16],redhat:1,redshift:30,reduc:[0,5,7],reduct:21,refer:[2,21,29],refpop:29,regardless:24,region:[0,7,35],regist:15,reignit:[0,7],reimer:[0,7],reinstal:[22,37],reject:[0,7],rejects_in_log:[0,7],rejuven:[0,7,12],rel:[0,7],relat:[0,7],releas:[19,22,37],relev:20,reliabl:7,remain:[0,7,19,21],rememb:[5,6,13,14],remesh:[0,7],remnant:[0,6,7],remov:[0,2,7,8,11,15,16,19,20],remove_fil:19,renam:[13,14,32],rename_grid_vari:[13,14,32],renormalis:30,rentrop:[0,7],repeat:[0,7,21],replac:28,repo:22,report:[0,6,7,8,12,13,14,15],repositori:4,repres:21,represent:[3,15,32],reproduc:[0,7],requir:[0,3,7,8,11,12,13,14,15,16,18,19,21,24,25,30,38],rerun:[6,21],reset:[0,7],reset_pref:[0,7],reset_star:[0,7],reset_stars_default:[0,7],resolut:[0,6,7,8,12,13,14,15,21,32,35],resolv:[0,7,12,29],reson:[0,7],resourc:[13,14,25],respect:[0,7,28,30,34],rest:[15,30,32],restor:25,restore_from_snapshot_dir:21,restore_from_snapshot_fil:[21,25],restructuredtext:19,result:[0,1,2,3,6,7,8,11,12,13,14,15,18,19,21,22,25,29,30,35,37],result_arrai:30,result_dict:2,result_example_head:18,result_example_header_1:18,result_example_header_2:18,results_dictionari:[6,8,12,13,14],retain:[0,7],rethink:19,return_after_dry_run:21,return_all_info:20,return_arglin:7,return_binary_c_default:20,return_binary_c_version_info:[10,20,36],return_compilation_dict:1,return_help:7,return_help_al:[7,19],return_maximum_mass_ratio_for_rlof:[7,40],return_minimum_orbit_for_rlof:[7,40],return_persistent_data_memaddr:7,return_population_set:20,return_store_memaddr:7,return_version_info:[7,36],reus:20,revap_in:[0,7],revap_out:[0,7],revers:[0,7,24],reverse_tim:[0,7],revis:[0,36],rewrit:20,rgb:6,rhagavan:21,ri0005:[6,15],rich:[0,7],riello:[0,7],rin:[0,7],ring:[0,7],risk:[15,32],ritter:[0,7],rk2:[0,7],rk4:[0,7],rl1:5,rl2:5,rl:[0,5,7],rlof:[0,5,7,40],rlof_angular_momentum_transfer_model:[0,7],rlof_angular_momentum_transfer_model_bs:0,rlof_angular_momentum_transfer_model_conserv:0,rlof_eccentric_as_circular:[0,7],rlof_entry_threshold:[0,7],rlof_f:[0,7],rlof_interpolation_binary_c:0,rlof_interpolation_bs:0,rlof_interpolation_method:[0,7],rlof_mdot_factor:[0,7],rlof_mdot_modul:[0,7],rlof_method:[0,7],rlof_method_adapt:0,rlof_method_adaptive2:0,rlof_method_bs:0,rlof_method_claei:0,rlof_method_ritt:0,rlof_nonconservative_gamma_donor:0,rlof_nonconservative_gamma_isotrop:0,rlof_radiation_correct:[0,7],rlof_transition_objects_escap:[0,7],rob:[0,7,30,40],robert:[22,37],roch:[0,5,7,8,40],roche_lob:40,rochelob:40,rol1:[5,11,18],rol2:[5,11,18],room:[15,32],root:[22,37],rotat:[0,7,30],rotation:[0,7],rotationally_enhanced_expon:[0,7],rotationally_enhanced_mass_loss:[0,7],rotationally_enhanced_massloss:[0,7],rotationally_enhanced_massloss_angmom:0,rotationally_enhanced_massloss_langer_formula:[0,7],rotationally_enhanced_massloss_langer_formula_and_angmom:0,rotationally_enhanced_massloss_non:0,rough:6,rout:[0,7],routin:[0,2,4,7,22,24,38],row:[11,18,24],rrcach:21,rring:[0,7],rssd:30,rst:[19,31],rsun:[6,24],rubric:32,run:[0,1,4,5,6,7,8,12,13,14,17,19,20,21,22,25,26,28,30,32,34,37,38,40],run_and_calc_mass:18,run_binary_custom_log:18,run_popul:7,run_system:[5,7,9,10,11,16,17,24,38],run_system_wrapp:[4,5,9,17,22,23],run_zero_probability_system:21,runawai:[5,18],rungrid:21,runtim:[1,21],russel:[0,4,7,22],rzam:[5,40],s:[0,2,3,5,6,7,8,11,13,14,15,16,18,19,20,21,25,26,27,29,30,33,40],safe:[15,29],sai:[0,6,7],said:[0,7],same:[0,2,7,11,15,21,22,30,32,37,38],sampl:[0,4,7,12,15,30,32,35],sample_valu:30,sampler:22,samplerfunc:[6,8,12,13,14,15,21,32,35],sana12:[8,12,15,30],sana:30,sander:0,saturn:16,save:[0,1,6,7,8,9,12,13,14,15,21,25,29,30,35],save_ensemble_chunk:21,save_loop:18,save_population_object:[21,29],save_pre_events_stardata:[0,7],save_snapshot:[20,21,29],sbatch:21,scalar:19,scalo:30,scandir:29,scanf:0,scene:18,scheme:[0,7],schneider:[0,7],schroeder:[0,7],scientif:19,script:[4,9,19,21,22,25,28,34,37],sdb:[0,7],sdo:[0,7],seaborn:[6,8,12,13,14,16],search:[6,12,16,22],search_for_bhbh:5,second:[0,2,7,8,16,19,24,29,30],secondari:[5,6,12,30,40],section:[7,15,19,22,30,37],see:[0,5,6,7,8,9,10,11,12,13,14,15,18,20,21,22,24,27,29,30,32,36,37],seed:[0,7],seem:[22,24,31,37],seen:19,segment:35,seitenzahl2013_model:[0,7],seitenzahl:[0,7],select:[0,3,7,11,12,16,18,19],select_kei:3,selected_head:[18,19],selector:[0,7],self:[6,8,11,12,13,14,15,20,21,25,27,28,29,30,32,34,35,36],semi:[0,7],sent:[0,7],sentenc:1,sep:[5,8,11,12,15,18,29,30,40],sep_max:[8,12,15],sep_min:[8,12,15],separ:[0,3,5,6,7,9,11,15,16,17,18,24,29,30,40],separation_quadrupl:[0,7],separation_tripl:[0,7],separta:[0,7],seper:15,sepf:5,sequenc:[0,6,7,9,12,13,14,18],sequnec:[12,13,14],seri:[0,7,35],serialis:3,serv:[18,19],server:18,set:[0,1,2,3,4,5,9,10,11,16,18,19,20,21,22,24,25,26,27,28,29,30,31,32,34,35,36,37],set_condor_statu:28,set_context:[6,8,12,13,14,16],set_opt:[2,6,8,16],set_slurm_statu:34,set_statu:29,set_tim:26,set_titl:18,set_xlabel:[6,8,12,13,14,16,18],set_ylabel:[6,8,12,13,14,16,18],set_yscal:18,setter:27,setup:[6,15,38],setup_function_cach:27,sever:[10,15,18,21,24,31,38],sfh:30,sh:[22,37],shannon:35,shara:[0,7],share:[1,11,17,18,21,29,38],shared_lib_filenam:9,shared_memori:29,shell:[0,7,19],shellular:[0,7],shift:0,shorten:[0,5,7],shorter:5,shortli:6,should:[0,1,5,6,7,8,11,12,13,14,15,18,19,21,22,24,25,28,29,30,31,34,35,37,38],shouldn:[0,7,19],show:[0,4,5,6,7,8,11,12,13,14,15,18,21,24,35],show_plot:24,show_stellar_typ:24,showlist:35,shown:[0,7,24,35],showtabl:35,shrink:[5,8],shrinkagb:11,side:[12,13,14,15],siess:[0,7],sigint:21,sigkil:21,sigma:[30,35],signal:[6,8,12,21],silent:19,sill:[0,7],sim10:8,sim:6,similar:35,simpl:[6,8,12,16],simplest:11,simpli:[0,7,13,14],simul:[0,1,6,7,8,9,12,13,14,15,34],simulation_:20,sinc:[19,24,30],singl:[0,4,5,6,7,12,13,14,15,18,20,21,24,25,30],single_star_lifetim:[7,9,11],sit:[0,7],site:7,situat:7,size:[19,21,27],skip:[0,2,6,7,8,12,21],skipkei:3,slice:18,sliced_df:18,slightli:7,slope:30,slow:[0,6,7,8,12,13,14],slower:[0,7],slurm:[21,25,34],slurm_arrai:21,slurm_array_max_job:21,slurm_bash:21,slurm_check_requir:34,slurm_dat:21,slurm_dir:[21,25,28,34],slurm_env:21,slurm_extra_set:21,slurm_grid:34,slurm_jobarrayindex:[21,34],slurm_jobid:[21,34],slurm_jobnam:21,slurm_memori:21,slurm_njob:21,slurm_ntask:21,slurm_outfil:34,slurm_partit:21,slurm_postpone_join:21,slurm_postpone_sbatch:21,slurm_pwd:21,slurm_queue_stat:[25,34],slurm_sbatch:21,slurm_status_fil:34,slurm_tim:21,slurm_warn_max_memori:21,slurmid:34,slurmpath:34,small:[0,5,7,13,14],small_envelope_method:[0,7],small_envelope_method_bs:0,small_envelope_method_miller_bertolami:0,smaller:[0,7,35],smarter:[13,14],smooth:[6,13,14],smoother:[8,13,14],sn:[0,5,6,7,8,12,13,14,16,18],sn_impulse_liu2015:0,sn_impulse_non:0,sn_impulse_wheeler1975:0,sn_kick_companion_a:[0,7],sn_kick_companion_aic_bh:[0,7],sn_kick_companion_bh_bh:[0,7],sn_kick_companion_bh_n:[0,7],sn_kick_companion_ecap:[0,7],sn_kick_companion_grb_collapsar:[0,7],sn_kick_companion_hestaria:[0,7],sn_kick_companion_ia_chand:[0,7],sn_kick_companion_ia_chand_co:[0,7],sn_kick_companion_ia_eld:[0,7],sn_kick_companion_ia_h:[0,7],sn_kick_companion_ia_he_co:[0,7],sn_kick_companion_ia_hybrid_hecowd:[0,7],sn_kick_companion_ia_hybrid_hecowd_sublumin:[0,7],sn_kick_companion_ibc:[0,7],sn_kick_companion_ii:[0,7],sn_kick_companion_iia:[0,7],sn_kick_companion_ns_n:[0,7],sn_kick_companion_phdi:0,sn_kick_companion_pisn:0,sn_kick_companion_ppisn:0,sn_kick_companion_tz:[0,7],sn_kick_companion_wdkick:[0,7],sn_kick_dispersion_aic_bh:[0,7],sn_kick_dispersion_bh_bh:[0,7],sn_kick_dispersion_bh_n:[0,7],sn_kick_dispersion_ecap:[0,7],sn_kick_dispersion_grb_collapsar:[0,5,7],sn_kick_dispersion_ia_hybrid_hecowd:[0,7],sn_kick_dispersion_ia_hybrid_hecowd_sublumin:[0,7],sn_kick_dispersion_ibc:[0,5,7],sn_kick_dispersion_ii:[0,5,7],sn_kick_dispersion_ns_n:[0,7],sn_kick_dispersion_phdi:0,sn_kick_dispersion_pisn:0,sn_kick_dispersion_ppisn:0,sn_kick_dispersion_tz:[0,7],sn_kick_distribution_aic_bh:[0,7],sn_kick_distribution_bh_bh:[0,7],sn_kick_distribution_bh_n:[0,7],sn_kick_distribution_ecap:[0,7],sn_kick_distribution_grb_collapsar:[0,7],sn_kick_distribution_ia_hybrid_hecowd:[0,7],sn_kick_distribution_ia_hybrid_hecowd_sublumin:[0,7],sn_kick_distribution_ibc:[0,7],sn_kick_distribution_ii:[0,7],sn_kick_distribution_ns_n:[0,7],sn_kick_distribution_phdi:0,sn_kick_distribution_pisn:0,sn_kick_distribution_ppisn:0,sn_kick_distribution_tz:[0,7],sn_none:9,sn_type:9,snapshot:[21,25,29],snapshot_filenam:29,sneia:[0,7],snia:[0,7],snippet:[7,11],so:[0,2,5,6,7,8,9,11,12,13,14,15,20,21,24,25,29],solar:[0,4,6,7,8,10,22,30,40],solver:[0,7],solver_forward_eul:0,solver_predictor_corrector:0,solver_rk2:0,solver_rk4:0,some:[0,1,6,7,8,9,10,11,12,13,14,15,18,21,22,24,30,32,33,37],someth:[0,6,7,8,11,12,13,14,21,40],sometim:10,somewhat:[12,13,14,15,16],soon:35,sort:[2,6,12,13,14,16,19,29],sort_kei:[3,29],sourc:[1,2,3,8,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,40],source_file_filenam:21,source_list:20,sourcecod:[7,9,22,37],sourcefile_nam:1,sp:30,space:[0,6,7,12,13,14,15,29,32,35],spacing_funct:[20,35],spawn:19,special:[0,7,15],specif:[0,7,10,11,24,28,34],specifi:[0,7,19,21,25,35],spectral:30,speed:[0,7,27],speedtest:[0,7],spent:19,spera:[0,7],spheric:[0,7],spiki:[13,14],spin:[0,7,16],spinrat:[0,7],split:[0,5,7,11,15,16,18,21],split_lin:11,splitlin:[6,7,8,9,11,12,13,14,15,16],splitpoint:[0,7],spread:20,sqrt:[0,7],src:[0,7,9,22,37],st1:18,st2:18,st:5,stabil:[0,7],stabl:[0,7,22,37],stack:21,stackoverflow:30,stacktrac:20,stage:25,stancliff:[0,7],standard:[0,7,12,13,14,28,30,34,35],star1:16,star:[1,4,5,7,8,9,10,11,12,13,15,16,17,18,21,22,24,28,30,34,35,40],star_with_no_mass:0,starcount:[6,8,12,14,15],stardata:[0,1,6,7,8,9,11,12,13,14,15,17,18],stardata_dump_filenam:[0,7],stardata_load_filenam:[0,7],stardata_t:9,starnum:[6,12],start:[0,1,5,6,7,8,11,12,13,14,15,18,19,21,26,31,32],start_at:21,start_tim:[0,7,21],start_timestamp:[6,8,12,14,15],startrack:[0,7],startswith:11,stat:25,state:[0,7,29],statement:[1,9,11,12,13,14,15,16,17,18,21],statist:[0,7,21,28],statu:[0,1,6,7,8,12,13,14,15,21,25,28,29,34],status_dir:21,stderr:[0,7,21],stdout:[19,21,35],steadi:[0,7],stefan:24,stefano:[15,22,30],stellar:[0,4,5,7,14,21,22,24,30,35,36,39],stellar_structure_algorithm:[0,7],stellar_structure_algorithm_external_funct:0,stellar_structure_algorithm_mint:0,stellar_structure_algorithm_modified_bs:0,stellar_structure_algorithm_non:0,stellar_typ:[1,6,9,11,12,13,14,15,22,23,24],stellar_type1:5,stellar_type2:5,stellar_type_1:[0,7,15,24],stellar_type_2:[0,7,15,24],stellar_type_3:[0,7],stellar_type_4:[0,7],stellar_type_dict:39,stellar_type_dict_short:39,step:[3,6,8,9,11,12,13,14,15,24,32,35],stepsiz:[15,32],stick:21,stiff:[0,7],still:[1,9,16,21,40],stop:[0,6,7,8,12,18,19,21],stop_queu:21,stopfil:[0,7],storag:[0,7],store:[0,2,4,6,8,11,12,13,14,15,19,20,21,22,29,35,37,40],store_capsul:7,store_memaddr:[7,40],str:[1,3,5,6,15,19,20,24,29,31,32,36],straightforward:[6,12,13,14,15],straniero:[0,7],stream:21,strength:[0,7],strict:3,strictli:[12,13,14],string:[0,1,2,3,4,7,11,12,13,14,15,16,19,20,21,24,25,28,29,31,32,34,36,38],strip:[0,7,11,16],strong:6,stronger:[0,6,7],struct:[0,7,9],structur:[0,2,7,8,19,21,24],studi:6,stuff:[11,15,21],style:[0,7,19],sub:[0,2,7,19],subdict:2,subject:[0,7],sublumin:[0,7],submiss:21,submit:[21,22],subplot:18,subsequ:[0,7],subtract:2,subtract_dict:2,succe:[0,7],suddenli:6,suffer:6,suffici:6,suggest:[0,7,22,37],suit:[22,37],suitabl:35,sum:[0,7],sun:16,sundial:[0,7],supercrit:[0,7],superflu:16,supernova:[0,5,7,8,21],superwind:[0,7],superwind_mira_switchon:[0,7],support:29,sure:[2,11,12,13,14,15,22,25,29,30,37,38],surfac:[0,7],surrei:[6,15],surviv:[0,7,16],survivor:[0,7],sview:21,swallow:16,switcher:[0,7],sy:20,symlink:[6,8,12,15],symlink_latest_gridcod:21,symmetr:[0,7],synchron:[0,7],synonym:[0,7],synthesi:[12,13,14,15,21,22,37],system:[0,4,6,7,8,9,12,13,14,15,17,18,19,20,21,22,24,30,33,37,38,40],system_gener:[15,29],system_queue_fil:[6,8,12],t:[0,1,2,5,6,7,11,13,14,15,19,21,25,29,35],t_:6,tabl:[0,7,30,35],take:[0,2,7,8,12,15,18,19,21,29,30,32,38],taken:[0,2,7,9,30],talk:6,target:[1,31],task:[0,7,15,18,19,20,24,25,27,30,35,38,40],tauri:[0,7],tbse:[0,7],te:21,technic:[6,8,9,12,13,14,15],teff:[0,5,7,30],teff_1:24,teff_2:24,teff_from_star_struct:6,teff_postagb_max:[0,7],teff_postagb_min:[0,7],tell:[19,25],temp_dir:[5,6,8,11,13,14,15,16,19],temperatur:[0,7,16,24,30],tempfil:18,termin:[1,6,9,15,22,37],test:[0,7,11,15,19,21,22,27,29,37],test_cach:27,test_data:[0,7],test_func:7,test_log:18,test_logfil:11,test_pop:15,text:[6,8,16,19,31],than:[0,2,6,7,8,12,13,14,15,19,21,22,25,29,30,36,37],thats:15,thei:[0,2,5,6,7,8,12,15,16,20,21,24,25,28,34,35],thelog:[0,7],them:[2,6,7,8,15,17,18,19,28,29,30,31,38],themselv:[3,30],theoret:[12,13,14],thermal:[0,6,7,30,40],thermally_pulsing_asymptotic_giant_branch:0,thermohalin:[0,7],thermonuclear:6,thesi:[0,7],thi:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,40],thick:[0,7],thick_disc_end_ag:[0,7],thick_disc_logg_max:[0,7],thick_disc_logg_min:[0,7],thick_disc_start_ag:[0,7],thin:[0,7],thing:[0,3,6,7,8,12,13,14,15,18,19,20,30,38],think:[0,7,19,20],third:[0,7,16,30,35],third_dup:[0,7],third_dup_multipli:[0,7],thorn:[0,7],those:[2,6,8,12,13,14,15,18,20,22,30,36,37],thread:[6,8,12,13,14,19,21],thread_id:21,three:[0,7,13,14,15,30],three_part_powerlaw:[8,12,13,14,15,30],threshold:[0,7,19,21],through:[6,7,11,12,13,14,15,24,25,32,38],throughout:[12,13,14,15,32],thu:35,tidal:[0,5,7],tidal_strength_factor:[0,7],tide:[0,7,16],tides_convective_damp:[0,7],tides_diagnosis_log:[0,7],tides_hurley2002:[0,7],tides_zahn1989:[0,7],tight:18,time:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,24,26,29,30,35,37],time_elaps:26,timedelta:19,timescal:[0,7],timestamp:[21,26],timestep:[0,7,8,9,11,12,13,14],timestep_limit:[0,7],timestep_log:[0,7],timestep_modul:[0,7],timestep_multipli:[0,7],timestep_solver_factor:[0,7],tini:6,tinslei:30,tip:[6,30],titl:[12,31],tmax:35,tmin:35,tmp:[0,6,7,8,11,12,13,14,15,16,19,22,37],tmp_dir:[5,6,8,11,13,14,15,16,21,32],tmp_tabl:30,toasti:16,todo:[0,1,2,5,7,10,15,19,20,21,24,25,28,29,30,31,34,35,36,38,40],toler:[0,7],too:[0,2,6,7,13,14,16,21,22,37,38],took:[6,8,12,14,15,18],tool:21,top:[0,15,32],topcod:[6,8,15,32],topic:[0,7],torqu:[0,7],total:[0,2,6,7,8,12,13,14,15,18,19,21,24,30,32],total_count:[6,8,12,14,15],total_mass_run:[6,8,12,14,15],total_prob:[6,8,12,13,14,15],total_probability_weighted_mass_run:[6,8,12,14,15],touch:[25,29],tout:[0,7,40],tout_pringle_1992_multipli:[0,7],tp:[0,7],tpagb:[0,6,7],tpagb_reimers_eta:[0,7],tpagb_wind_beasor_etal_2020:0,tpagb_wind_bloeck:0,tpagb_wind_goldman_etal_2017:0,tpagb_wind_mattsson:0,tpagb_wind_reim:0,tpagb_wind_rob_cwind:0,tpagb_wind_van_loon:0,tpagb_wind_vw93_karaka:0,tpagb_wind_vw93_karakas_carbon_star:0,tpagb_wind_vw93_orig:0,tpagb_wind_vw93_orig_carbon_star:0,tpagbwind:[0,7],tpagbwindfac:[0,7],tpr:[8,12],trace:21,traceback:[13,16],track:[6,21,24],trade:[0,7],trail:[19,35],transfer:[0,6,7,21],transform:[0,3,7],transit:[0,7],treat:[0,7,35],trem:19,trigger:[0,7],trio:[12,13,14,15],tripl:[0,7,21,30],truli:[0,7],ttlcach:21,tupl:[1,6,19,25,29,35],turn:[0,3,5,7,11,15],tutori:[4,22],two:[0,2,6,7,9,19,29,39,40],txt:[11,15,18,22,29,37,38],type:[0,1,2,3,5,7,8,11,12,13,14,15,18,19,20,21,24,25,29,30,31,32,35,36,39,40],type_chng:[5,11,18],type_ia_mch_supernova_algorithm:[0,7],type_ia_sub_mch_supernova_algorithm:[0,7],typeerror:13,typic:[0,7],ubvri:[0,7],ugriv:[0,7],uk:[6,15],unavail:[0,7],unbound:5,unclos:29,uncom:[11,12,13,14,15,16],unction:7,undef:9,under:[11,35],undergo:[0,8],understand:21,undescrib:31,unexpect:13,uniform:30,union:[15,30,32,35,36,40],uniqu:[2,15,18,21],unit:[0,6,7,10,19,40],univari:[0,7],univers:[6,8,21],unknown:38,unless:[1,20,21],unlik:[13,14],unload:20,unlock:29,unmerg:8,unnecessari:31,unpars:7,unphys:[5,8,12],unrecogn:[22,37],unresolv:12,unsign:0,unstabl:[0,5,7],until:[0,2,6,7,29,30],unus:[0,7,21],unweight:15,up:[0,1,4,9,11,16,19,20,25,27,28,30,34],updat:[2,13,14,15,20,22,32,37],update_dict:[2,10],update_grid_vari:[13,14,32],upon:40,upper:[0,7,30,35],uranu:16,us:[0,1,2,3,4,10,11,15,19,20,21,22,24,25,26,27,28,29,30,31,32,34,35,36,37,38,40],usag:[0,4],use_astropy_valu:24,use_datadir:[15,20],use_fixed_timestep_:[0,7],use_lwn_fallback:0,use_periastron_roche_radiu:[0,7],use_tabular_intershell_abundances_karakas_2012:[0,7],usecach:35,usecas:4,useful_func:[22,23],user:[1,9,19,20,21,30,31,38],usernam:19,usr:21,usual:[0,5,6,7,12,13,14,15,19,21,29,30],utf:[3,29],util:[1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,24,25,26,27,28,29,30,31,32,33,34,35,36,38,40],v:[5,18,22,37],val:30,valid:[0,7,9,19,30],valu:[0,1,2,3,6,7,10,11,12,13,14,15,18,19,20,21,24,26,27,30,31,32,35],value_lin:11,valueerror:15,valuerang:[6,8,12,13,14,15,32],values_arrai:11,van:[0,7],vandenheuvel_log:[0,7],vanilla:21,vari:[0,6,7,8,15],variabl:[0,4,6,7,8,19,21,28,29,32],variant:[0,7],variou:[0,7],vassiliadi:[0,7],vb:[5,25,27,29,35],ve:26,veloc:[0,7,30],venu:16,verbos:[1,6,8,11,12,13,14,15,17,19,21,22,29,30,35,37],verbose_print:19,veri:[0,5,6,7,8,9,11,13,14,15,29,32,35],versa:40,version:[0,2,7,10,15,19,20,22,36,37],version_info:[20,36],version_info_dict:10,version_info_str:36,version_onli:[0,7],via:[4,6,7,9,12,13,14,15,20,21,24],vice:40,vink:[0,7],virtual:[22,37],virtualenviron:[22,37],viscos:[0,7],viscou:[0,7],visibl:9,visit:22,vk:[5,18],vn:[5,18],volum:[0,7],vr:[5,18],vrot1:[0,7],vrot2:[0,7],vrot3:[0,7],vrot4:[0,7],vrot_breakup:0,vrot_bs:0,vrot_non_rot:0,vrot_sync:0,vs:[16,24],vw93:[0,7],vw93_eagb_wind_spe:[0,7],vw93_mira_shift:[0,7],vw93_multipli:[0,7],vw93_tpagb_wind_spe:[0,7],vwind:[0,7],vwind_beta:[0,7],vwind_multipli:[0,7],w:[1,11,15,20,29],wa:[0,6,7,10,11,13,14,15,20,21,22,25,29,30,37],wai:[0,2,7,11,13,14,20,21,25],wait:29,wait_for_unlock:29,wang:[0,7],want:[0,2,3,5,7,8,9,10,12,13,14,15,18,19,21,22,24,25,29,30,31,32,37],warmup_cpu:[0,7],warn:[0,7,11,15,21,25],was_kil:20,wast:[8,13,14],wave:[0,6,7,8,15],wd:[0,7],wd_accretion_rate_new_giant_envelope_lower_limit_helium_donor:[0,7],wd_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor:[0,7],wd_accretion_rate_new_giant_envelope_lower_limit_other_donor:[0,7],wd_accretion_rate_novae_upper_limit_helium_donor:[0,7],wd_accretion_rate_novae_upper_limit_hydrogen_donor:[0,7],wd_accretion_rate_novae_upper_limit_other_donor:[0,7],wd_kick:[0,7],wd_kick_at_every_puls:0,wd_kick_at_given_puls:0,wd_kick_direct:[0,7],wd_kick_end_agb:0,wd_kick_first_rlof:0,wd_kick_pulse_numb:[0,7],wd_kick_when:[0,7],wd_sigma:[0,7],wdwd_merger_algorithm:[0,7],wdwd_merger_algorithm_bs:0,wdwd_merger_algorithm_chen2016:0,wdwd_merger_algorithm_perets2019:0,we:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,25,26,27,28,29,30,31,34,35,37,40],weight:[0,7,13,14,21],weirdli:12,well:[0,3,7,9,11,12,13,14,21,22,37],went:[13,14],were:[6,8,12,14,15,19,36],what:[0,1,2,5,6,7,8,9,11,12,13,14,15,18,21,22,25,30,31,35,36,37,38],whatev:[0,7,9,18,19,20,22,25,29,37],wheeler:[0,7],when:[0,1,2,3,6,7,8,10,11,15,16,19,21,22,25,26,27,28,29,30,31,34,35,37,38],whenev:[22,37],where:[0,1,2,6,7,12,13,14,15,19,21,22,25,26,29,30,31,35,37],whether:[0,7,15,19,20,21,24,28,29,30,31,34,35,36,40],which:[0,1,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,25,28,29,30,31,32,34,35,36,37,38,40],whichev:21,white:[0,6,7],white_dwarf_cooling_carrasco2014:[0,7],white_dwarf_cooling_mestel:[0,7],white_dwarf_cooling_mestel_modifi:[0,7],white_dwarf_cooling_model:[0,7],white_dwarf_radius_carrasco2014:[0,7],white_dwarf_radius_model:[0,7],white_dwarf_radius_mu:[0,7],white_dwarf_radius_nauenberg1972:[0,7],whole:[0,7,8,9,20,21],why:8,wide:[5,12,13,14],wider:5,width:[0,7,8],wiggl:[13,14],wind:[0,5,6,7,12],wind_algorithm_binary_c_2020:[0,5],wind_algorithm_hendriks_2022:0,wind_algorithm_hurley2002:0,wind_algorithm_non:[0,5],wind_algorithm_schneider2018:0,wind_angmom_loss_bs:0,wind_angmom_loss_lw:0,wind_angmom_loss_lw_hybrid:0,wind_angmom_loss_spherically_symmetr:0,wind_angular_momentum_loss:[0,7],wind_disc_angmom_fract:[0,7],wind_disc_mass_fract:[0,7],wind_djorb_fac:[0,7],wind_gas_to_dust_ratio:[0,7],wind_lbv_luminosity_lower_limit:[0,7],wind_mass_loss:[0,5,7],wind_multiplier_:[0,7],wind_nieuwenhuijzen_luminosity_lower_limit:[0,7],wind_type_multiplier_:[0,7],wink:0,within:[0,2,7,9,10,15,19,22,30,32,37],without:[9,11,13,14,19,21,30],won:[0,7,11],wood:[0,7],wooslei:0,work:[0,2,3,7,9,11,12,13,14,18,19,21,22,25,29,37],working_diretori:21,would:[0,2,7,13,14,15,21,24],wouldn:[15,29],wr:[0,7],wr_wind:[0,7],wr_wind_bs:0,wr_wind_eldridg:0,wr_wind_fac:[0,7],wr_wind_maeder_meynet:0,wr_wind_nugis_lam:0,wrap:[1,9,27],wrapper:[3,7,9,11,20,29,40],write:[1,5,6,7,8,9,11,12,15,17,18,19,20,21,29,31,38],write_binary_c_calls_to_fil:[15,29],write_binary_c_parameter_descriptions_to_rst_fil:19,write_ensembl:29,write_grid_options_to_rst_fil:31,write_logfil:7,written:[7,11,15,21,29,31,32,38],written_data:11,wrlof_mass_transf:[0,7],wrlof_method:[0,7],wrlof_non:0,wrlof_q_depend:0,wrlof_quadrat:0,wrong:[13,14,22,37],wrt:18,wrwindfac:[0,7],wtts2:[0,7],wtts_log:[0,7],www:[0,7,30],x0:30,x0d:21,x1:30,x86_64:7,x:[0,6,7,9,11,16,18,19,20,24,25,30,35],xlabel:17,xlim:[8,16],xx:16,xxx:34,y:[5,6,16,19,20,24,25],ye:21,year:[0,7,30],year_length_in_dai:8,yet:[0,2,7,18,19,21,24],yield:[0,7,35],ylim:16,you:[0,1,2,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,24,25,29,30,31,32,35,37,40],young:[0,7],your:[9,11,17,18,21,22,37],yourself:[6,8,12,13,14,15,24],yscale:[12,13,14,16],yy:16,z:[0,6,7,8,18,20,30,40],zahn:[0,7],zam:[0,4,6,7,12,30,38,40],zams_collis:40,zams_mass:[6,12,13,14,15],zams_mass_1:15,zams_mass_2:15,zero:[0,1,4,5,6,7,8,14,19,21,22,29],zero_ag:[6,9,11,12,13,14,15],zero_age_main_sequence_star:[12,13,14],zero_age_main_sequence_starn:12,zero_prob_stars_skip:[6,8,12,14,15],zone:[0,7],zoom:[0,7,35],zoom_dispers:35,zoom_magnitud:35,zoom_magntiud:35,zoom_mean:35,zoomfac_multiplier_decreas:[0,7],zoomfac_multiplier_increas:[0,7],zsolar:30,zytkow:[0,7]},titles:["Binary_c parameters","custom_logging_functions module","functions module","functions module","Example notebooks","Example use case: Binary black hole systems","Example use case: Hertzsprung-Russell diagrams","Tutorial: Using the API functionality of binary_c-python","Example use case: Common-envelope evolution","Tutorial: Using custom logging routines with binary_c-python","Tutorial: Extra features and functionality of binary_c-python","Tutorial: Running individual systems with binary_c-python","Example use case: Zero-age stellar luminosity function in binaries","Example use case: Zero-age stellar luminosity function","Example use case: Massive star luminosity","Tutorial: Running populations with binary_c-python","Example use case: Solar system using the API functionality","<no title>","Binary_c and python example notebook","functions module","grid_class module","Population grid code options","Welcome to binary_c-python\u2019s documentation!","Binarycpython code","plot_functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","functions module","Python module for binary_c","run_system_wrapper module","stellar_types module","useful_funcs module"],titleterms:{"case":[5,6,8,12,13,14,16],"function":[2,3,7,10,11,12,13,14,15,16,18,19,25,26,27,28,29,30,31,32,33,34,35,36],"public":21,A:[13,14],about:10,ad:[12,13,14,15],after:[22,37],ag:[12,13],algorithm:0,api:[7,9,11,16,18],better:[13,14],binari:[0,5,6,12,18],binary_c:[0,7,9,10,11,15,18,22,37],binarycpython:23,black:5,build:[10,22,37],code:[21,23],common:8,compact:9,content:[4,22],core:18,custom:[9,18],custom_logging_funct:1,develop:[22,37],di:21,diagram:6,dictionari:10,directli:9,distribut:[13,14],document:[22,37],envelop:8,environ:[22,37],evolut:[8,9],evolv:[6,8,12,13,14,15],exampl:[4,5,6,7,8,9,10,12,13,14,15,16,18,22,37],extra:10,faq:[22,37],featur:10,free:7,from:[7,9,22,37],full:15,get:[7,10],grid:[6,8,12,13,14,15,21],grid_class:20,handl:[6,8,12,13,14,15],help:10,hertzsprung:6,hole:5,i:0,indic:22,individu:11,inform:[7,10],initi:[13,14],input:0,instal:[22,37],instruct:[22,37],issu:[22,37],line:18,log:[6,8,9,12,13,14,15,18],luminos:[12,13,14],mass:[9,13,14],massiv:14,misc:0,modif:10,modul:[1,2,3,19,20,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],moe:21,note:[22,37],notebook:[4,18],noteworthi:15,nucsyn:0,o:0,object:[6,8,9,11,12,13,14,15],option:21,other:18,output:[0,6,8,12,13,14,15],paramet:[0,10],pars:10,pip:[22,37],plot_funct:24,popul:[6,8,9,11,12,13,14,15,21],privat:21,python:[7,9,10,11,15,18,22,37],requir:[22,37],routin:9,run:[9,11,15,18],run_binari:18,run_binary_with_log:18,run_system:18,run_system_wrapp:[11,38],russel:6,s:22,sampl:[13,14],sampler:21,script:15,section:0,set:[6,7,8,12,13,14,15],singl:11,solar:16,sourc:[22,37],star:[0,6,14],stefano:21,stellar:[6,8,12,13],stellar_typ:39,store:7,string:9,supernova:9,system:[5,11,16],tabl:22,tutori:[7,9,10,11,15],up:[6,7,8,12,13,14,15],us:[5,6,7,8,9,12,13,14,16,18],usag:[7,9,22,37],useful_func:40,util:18,variabl:[12,13,14,15,22,37],via:[11,22,37],welcom:22,when:9,wrapper:18,zam:[13,14],zero:[12,13]}}) \ No newline at end of file diff --git a/docs/build/html/spacing_functions.html b/docs/build/html/spacing_functions.html deleted file mode 100644 index c924160f1bad1544b888b7593fa797691a7600df..0000000000000000000000000000000000000000 --- a/docs/build/html/spacing_functions.html +++ /dev/null @@ -1,257 +0,0 @@ - - -<!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> -<head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>spacing_functions module — binary_c-python documentation</title> - - - - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> - <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> - <script src="_static/jquery.js"></script> - <script src="_static/underscore.js"></script> - <script src="_static/doctools.js"></script> - <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Search" href="search.html" /> - <link rel="next" title="stellar_types module" href="stellar_types.html" /> - <link rel="prev" title="run_system_wrapper module" href="run_system_wrapper.html" /> -</head> - -<body class="wy-body-for-nav"> - - - <div class="wy-grid-for-nav"> - - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> - <div class="wy-side-scroll"> - <div class="wy-side-nav-search" > - - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - - </a> - - - - - - - -<div role="search"> - <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> - <input type="text" name="q" placeholder="Search docs" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - - <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> -<ul class="current"> -<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> -<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> -<li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2 current"><a class="current reference internal" href="#">spacing_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> -<li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li> -<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> -<li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li> -<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> -</ul> - - - - </div> - </div> - </nav> - - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - - <i data-toggle="wy-nav-top" class="fa fa-bars"></i> - <a href="index.html">binary_c-python</a> - - </nav> - - - <div class="wy-nav-content"> - - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - - <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - - <li><a href="modules.html">Binarycpython code</a> »</li> - - <li>spacing_functions module</li> - - - <li class="wy-breadcrumbs-aside"> - - - <a href="_sources/spacing_functions.rst.txt" rel="nofollow"> View page source</a> - - - </li> - - </ul> - - - <hr/> -</div> - <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> - <div itemprop="articleBody"> - - -<style> -/* CSS overrides for sphinx_rtd_theme */ - -/* 24px margin */ -.nbinput.nblast.container, -.nboutput.nblast.container { - margin-bottom: 19px; /* padding has already 5px */ -} - -/* ... except between code cells! */ -.nblast.container + .nbinput.container { - margin-top: -19px; -} - -.admonition > p:before { - margin-right: 4px; /* make room for the exclamation icon */ -} - -/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */ -.math { - text-align: unset; -} -</style> -<div class="section" id="spacing-functions-module"> -<h1>spacing_functions module<a class="headerlink" href="#spacing-functions-module" title="Permalink to this headline">¶</a></h1> -</div> - - - </div> - - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="stellar_types.html" class="btn btn-neutral float-right" title="stellar_types module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="run_system_wrapper.html" class="btn btn-neutral float-left" title="run_system_wrapper module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - - </div> - - - <hr/> - - <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> - </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. -<br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. -<br><br> -Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. - - - -</footer> - - </div> - </div> - - </section> - - </div> - - - - <script type="text/javascript"> - jQuery(function () { - SphinxRtdTheme.Navigation.enable(true); - }); - </script> - - - - - - -</body> -</html> \ No newline at end of file diff --git a/docs/build/html/stellar_types.html b/docs/build/html/stellar_types.html index 7363093fde9772bef7341ec4f3c6968f9ed91c0e..f034b74ceda66db1ad5432c3752db5ef0e924462 100644 --- a/docs/build/html/stellar_types.html +++ b/docs/build/html/stellar_types.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>stellar_types module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>stellar_types module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="useful_funcs module" href="useful_funcs.html" /> - <link rel="prev" title="spacing_functions module" href="spacing_functions.html" /> + <link rel="prev" title="run_system_wrapper module" href="run_system_wrapper.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">stellar_types module</a></li> <li class="toctree-l2"><a class="reference internal" href="useful_funcs.html">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>stellar_types module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/stellar_types.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,8 +121,8 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.stellar_types"> -<span id="stellar-types-module"></span><h1>stellar_types module<a class="headerlink" href="#module-binarycpython.utils.stellar_types" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.stellar_types"> +<span id="stellar-types-module"></span><h1>stellar_types module<a class="headerlink" href="#module-binarycpython.utils.stellar_types" title="Permalink to this headline">ïƒ</a></h1> <dl class="simple"> <dt>Module containing two stellar type dicts:</dt><dd><ul class="simple"> <li><p>STELLAR_TYPE_DICT: dictionary with long names</p></li> @@ -204,61 +130,43 @@ </ul> </dd> </dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="useful_funcs.html" class="btn btn-neutral float-right" title="useful_funcs module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="spacing_functions.html" class="btn btn-neutral float-left" title="spacing_functions module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="run_system_wrapper.html" class="btn btn-neutral float-left" title="run_system_wrapper module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="useful_funcs.html" class="btn btn-neutral float-right" title="useful_funcs module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/build/html/useful_funcs.html b/docs/build/html/useful_funcs.html index 0a84788ded038d2eecdefdb6546fc6bff0c4dcba..561456112f958c43f042169101ca613b09b2d783 100644 --- a/docs/build/html/useful_funcs.html +++ b/docs/build/html/useful_funcs.html @@ -1,70 +1,35 @@ - - <!DOCTYPE html> -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<html class="writer-html5" lang="en" > <head> - <meta charset="utf-8"> - - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - - <title>useful_funcs module — binary_c-python documentation</title> - + <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>useful_funcs module — binary_c-python documentation</title> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> - - - - - - <script type="text/javascript" src="_static/js/modernizr.min.js"></script> - - - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> - - <script type="text/javascript" src="_static/js/theme.js"></script> - - - - - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="Example notebooks" href="example_notebooks.html" /> <link rel="prev" title="stellar_types module" href="stellar_types.html" /> </head> -<body class="wy-body-for-nav"> - - +<body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> - <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > - - - <a href="index.html" class="icon icon-home"> binary_c-python - - - </a> - - - - - - - <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> @@ -72,30 +37,30 @@ <input type="hidden" name="area" value="default" /> </form> </div> - - - </div> - - <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> - - - - - - + </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">Binarycpython code</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="custom_logging_functions.html">custom_logging_functions module</a></li> -<li class="toctree-l2"><a class="reference internal" href="distribution_functions.html">distribution_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="dicts.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="ensemble.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="grid.html">grid_class module</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_defaults.html">Grid options and descriptions</a></li> -<li class="toctree-l2"><a class="reference internal" href="hpc_functions.html">hpc_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="plot_functions.html">plot_functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/analytics.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/cache.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/condor.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/dataIO.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/distribution_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/gridcode.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/grid_options_defaults.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/HPC.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/metadata.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/slurm.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/spacing_functions.html">functions module</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_extensions/version_info.html">functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="run_system_wrapper.html">run_system_wrapper module</a></li> -<li class="toctree-l2"><a class="reference internal" href="spacing_functions.html">spacing_functions module</a></li> <li class="toctree-l2"><a class="reference internal" href="stellar_types.html">stellar_types module</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">useful_funcs module</a></li> </ul> @@ -107,70 +72,31 @@ <li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li> </ul> - - </div> </div> </nav> - <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> - - - <nav class="wy-nav-top" aria-label="top navigation"> - + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">binary_c-python</a> - </nav> - <div class="wy-nav-content"> - <div class="rst-content"> - - - - - - - - - - - - - - - - - -<div role="navigation" aria-label="breadcrumbs navigation"> - + <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> - - <li><a href="index.html">Docs</a> »</li> - + <li><a href="index.html" class="icon icon-home"></a> »</li> <li><a href="modules.html">Binarycpython code</a> »</li> - <li>useful_funcs module</li> - - <li class="wy-breadcrumbs-aside"> - - <a href="_sources/useful_funcs.rst.txt" rel="nofollow"> View page source</a> - - </li> - </ul> - - <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - + <style> /* CSS overrides for sphinx_rtd_theme */ @@ -195,8 +121,8 @@ text-align: unset; } </style> -<div class="section" id="module-binarycpython.utils.useful_funcs"> -<span id="useful-funcs-module"></span><h1>useful_funcs module<a class="headerlink" href="#module-binarycpython.utils.useful_funcs" title="Permalink to this headline">¶</a></h1> +<section id="module-binarycpython.utils.useful_funcs"> +<span id="useful-funcs-module"></span><h1>useful_funcs module<a class="headerlink" href="#module-binarycpython.utils.useful_funcs" title="Permalink to this headline">ïƒ</a></h1> <p>Collection of useful functions.</p> <p>Part of this is copied/inspired by Rob’s binary_stars module</p> <dl class="simple"> @@ -206,7 +132,7 @@ <li><p>rzams(m, z) gives you the ZAMS radius of a star</p></li> <li><p>ZAMS_collision(m1, m2, e, sep, z) returns 1 if stars collide on the ZAMS</p></li> <li><p>roche_lobe(q): returns roche lobe radius in units of separation</p></li> -<li><p>ragb(m, z): radius at first thermal pulse</p></li> +<li><p>ragb(m): radius at first thermal pulse</p></li> <li><p>minimum_period_for_RLOF(M1, M2, metallicity, store_memaddr=-1): function to calculate the minimum period that leads to RLOF on ZAMS</p></li> <li><p>minimum_separation_for_RLOF(M1, M2, metallicity, store_memaddr=-1): function to calculate the minimum period that leads to RLOF on ZAMS</p></li> <li><p>maximum_mass_ratio_for_RLOF(M1, orbital_period, store_memaddr=None): Function to calculate the maximum mass ratio that leads to RLOF on ZAMS</p></li> @@ -219,7 +145,7 @@ </dl> <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.calc_period_from_sep"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">calc_period_from_sep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sep</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#calc_period_from_sep"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.calc_period_from_sep" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">calc_period_from_sep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sep</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#calc_period_from_sep"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.calc_period_from_sep" title="Permalink to this definition">ïƒ</a></dt> <dd><p>calculate period from separation</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -240,7 +166,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.calc_sep_from_period"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">calc_sep_from_period</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">period</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#calc_sep_from_period"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.calc_sep_from_period" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">calc_sep_from_period</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">period</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#calc_sep_from_period"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.calc_sep_from_period" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Calculate separation from period.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -261,7 +187,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.maximum_mass_ratio_for_RLOF"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">maximum_mass_ratio_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">orbital_period</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.02</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#maximum_mass_ratio_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.maximum_mass_ratio_for_RLOF" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">maximum_mass_ratio_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">orbital_period</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.02</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#maximum_mass_ratio_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.maximum_mass_ratio_for_RLOF" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Wrapper function for _binary_c_bindings.return_maximum_mass_ratio_for_RLOF</p> <p>Handles the output and returns the maximum mass ratio at which RLOF just does not occur at ZAMS</p> <dl class="field-list simple"> @@ -281,7 +207,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.minimum_period_for_RLOF"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">minimum_period_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#minimum_period_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.minimum_period_for_RLOF" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">minimum_period_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#minimum_period_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.minimum_period_for_RLOF" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Wrapper function for _binary_c_bindings.return_minimum_orbit_for_RLOF</p> <p>Handles the output and returns the minimum orbital period at which RLOF just does not occur at ZAMS</p> <dl class="field-list simple"> @@ -301,7 +227,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.minimum_separation_for_RLOF"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">minimum_separation_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#minimum_separation_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.minimum_separation_for_RLOF" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">minimum_separation_for_RLOF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">M1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metallicity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">store_memaddr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#minimum_separation_for_RLOF"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.minimum_separation_for_RLOF" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Wrapper function for _binary_c_bindings.return_minimum_orbit_for_RLOF</p> <p>Handles the output and returns the minimum separation at which RLOF just does not occur at ZAMS</p> <dl class="field-list simple"> @@ -321,7 +247,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.ragb"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">ragb</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#ragb"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.ragb" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">ragb</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#ragb"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.ragb" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to calculate radius of a star in units of solar radii at first thermal pulse as a function of mass (Z=0.02 only, but also good for Z=0.0001)</p> <p>TODO: ask rob about this function. Do we still need this? Can we make something better? (i.e. upon installation of the code run a grid of systems and get the data from there?)</p> <dl class="field-list simple"> @@ -342,7 +268,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.roche_lobe"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">roche_lobe</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">q</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#roche_lobe"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.roche_lobe" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">roche_lobe</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">q</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#roche_lobe"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.roche_lobe" title="Permalink to this definition">ïƒ</a></dt> <dd><p>A function to evaluate R_L/a(q), Eggleton 1983.</p> <p># TODO: check the definition of the mass ratio # TODO: check whether the logs are correct</p> @@ -361,7 +287,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.rzams"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">rzams</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#rzams"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.rzams" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">rzams</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#rzams"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.rzams" title="Permalink to this definition">ïƒ</a></dt> <dd><p>Function to determine the radius of a ZAMS star as a function of m and z:</p> <p>Based on the fits of Tout et al., 1996, MNRAS, 281, 257</p> <dl class="field-list simple"> @@ -379,7 +305,7 @@ <dl class="py function"> <dt class="sig sig-object py" id="binarycpython.utils.useful_funcs.zams_collision"> -<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">zams_collision</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">e</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#zams_collision"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.zams_collision" title="Permalink to this definition">¶</a></dt> +<span class="sig-prename descclassname"><span class="pre">binarycpython.utils.useful_funcs.</span></span><span class="sig-name descname"><span class="pre">zams_collision</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">e</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/useful_funcs.html#zams_collision"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#binarycpython.utils.useful_funcs.zams_collision" title="Permalink to this definition">ïƒ</a></dt> <dd><p>given m1,m2, separation and eccentricity (and metallicity) determine if two stars collide on the ZAMS</p> <dl class="field-list simple"> @@ -401,61 +327,43 @@ determine if two stars collide on the ZAMS</p> </dl> </dd></dl> -</div> +</section> </div> - </div> - <footer> - - <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> - - <a href="example_notebooks.html" class="btn btn-neutral float-right" title="Example notebooks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> - - - <a href="stellar_types.html" class="btn btn-neutral float-left" title="stellar_types module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> - + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> + <a href="stellar_types.html" class="btn btn-neutral float-left" title="stellar_types module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> + <a href="example_notebooks.html" class="btn btn-neutral float-right" title="Example notebooks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> - <hr/> <div role="contentinfo"> - <p> - © Copyright 2021, David Hendriks, Robert Izzard - - </p> + <p>© Copyright 2021, David Hendriks, Robert Izzard.</p> </div> - Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + + Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a + <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> + provided by <a href="https://readthedocs.org">Read the Docs</a>. + <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. </footer> - </div> </div> - </section> - </div> - - - - <script type="text/javascript"> + <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - </script> - - - - - + </script> </body> </html> \ No newline at end of file diff --git a/docs/source/_templates/footer.html b/docs/source/_templates/footer.html index 152ad73acb51f621adb8f9122d1ebc0563fb06b2..2b6db79c0803e158993626a1891436e3286ee8fa 100644 --- a/docs/source/_templates/footer.html +++ b/docs/source/_templates/footer.html @@ -2,7 +2,7 @@ {%- block extrafooter %} <br><br> -Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision c28d981dead0092cf26fb560b88691d228bafd9c url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. +Generated on binarycpython git branch: development_0.9.3/2.2.1 git revision 8fa2493d09f4f240ef39658cdbb770d78dbac20f url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_0.9.3/2.2.1">git url</a>. <br><br> Using binary_c with bit branch branch_david: git revision: "5834:20211216:a3146490e" url: <a href="https://gitlab.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/source/badges/test_coverage.svg b/docs/source/badges/test_coverage.svg index bc3407c38eb421a1b578d6d7c04aed07dbd6ab83..4f8c1853c8aad23ace8aaa782014952e6375bcf3 100644 --- a/docs/source/badges/test_coverage.svg +++ b/docs/source/badges/test_coverage.svg @@ -9,13 +9,13 @@ </mask> <g mask="url(#a)"> <path fill="#555" d="M0 0h63v20H0z"/> - <path fill="#e05d44" d="M63 0h36v20H63z"/> + <path fill="#fe7d37" d="M63 0h36v20H63z"/> <path fill="url(#b)" d="M0 0h99v20H0z"/> </g> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> <text x="31.5" y="14">coverage</text> - <text x="80" y="15" fill="#010101" fill-opacity=".3">23%</text> - <text x="80" y="14">23%</text> + <text x="80" y="15" fill="#010101" fill-opacity=".3">50%</text> + <text x="80" y="14">50%</text> </g> </svg> diff --git a/docs/source/dicts.rst b/docs/source/dicts.rst new file mode 100644 index 0000000000000000000000000000000000000000..baa02e9c2782c321147934a3738676002977a908 --- /dev/null +++ b/docs/source/dicts.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.dicts + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/distribution_functions.rst b/docs/source/distribution_functions.rst deleted file mode 100644 index 5881ee38299d5af76771ac7312abd140886f99d1..0000000000000000000000000000000000000000 --- a/docs/source/distribution_functions.rst +++ /dev/null @@ -1,7 +0,0 @@ -distribution_functions module -================================= - -.. automodule:: binarycpython.utils.distribution_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/source/ensemble.rst b/docs/source/ensemble.rst new file mode 100644 index 0000000000000000000000000000000000000000..00c573086e74b84a1bac5ddf1afb07c7545853c5 --- /dev/null +++ b/docs/source/ensemble.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.ensemble + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/functions.py b/docs/source/functions.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/docs/source/grid_options_defaults.rst b/docs/source/grid_options_defaults.rst deleted file mode 100644 index c66555ac9989dff3ad956f893683dc34c4dc4c46..0000000000000000000000000000000000000000 --- a/docs/source/grid_options_defaults.rst +++ /dev/null @@ -1,7 +0,0 @@ -Grid options and descriptions -============================= - -.. automodule:: binarycpython.utils.grid_options_defaults - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/source/hpc_functions.rst b/docs/source/hpc_functions.rst deleted file mode 100644 index d336a0be090ee3eac23c4342286fe8895e0aea6f..0000000000000000000000000000000000000000 --- a/docs/source/hpc_functions.rst +++ /dev/null @@ -1,7 +0,0 @@ -hpc\_functions module -================================= - -.. automodule:: binarycpython.utils.hpc_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file diff --git a/docs/source/modules.rst b/docs/source/modules.rst index d4aaac5025cbb089f2754ed01ef8bd92f70bf81c..ce6f94e48b1de9e38dc33e8c6dceb7b468c3934f 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -6,13 +6,25 @@ This chapter contains the (auto)documentation for all the functions and modules :maxdepth: 4 custom_logging_functions - distribution_functions + dicts + ensemble functions grid - grid_options_defaults - hpc_functions plot_functions + population_extensions/analytics + population_extensions/cache + population_extensions/condor + population_extensions/dataIO + population_extensions/distribution_functions + population_extensions/gridcode + population_extensions/grid_logging + population_extensions/grid_options_defaults + population_extensions/HPC + population_extensions/metadata + population_extensions/Moe_di_Stefano_2017 + population_extensions/slurm + population_extensions/spacing_functions + population_extensions/version_info run_system_wrapper - spacing_functions stellar_types - useful_funcs \ No newline at end of file + useful_funcs diff --git a/docs/source/population_extensions/HPC.rst b/docs/source/population_extensions/HPC.rst new file mode 100644 index 0000000000000000000000000000000000000000..d8e791e19810997bff2a67a6a646ad047b8c71a9 --- /dev/null +++ b/docs/source/population_extensions/HPC.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.HPC + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/analytics.rst b/docs/source/population_extensions/analytics.rst new file mode 100644 index 0000000000000000000000000000000000000000..cb2de4881075b53f8140b5fe3eeacd3105acf74e --- /dev/null +++ b/docs/source/population_extensions/analytics.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.analytics + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/cache.rst b/docs/source/population_extensions/cache.rst new file mode 100644 index 0000000000000000000000000000000000000000..68c73899ab34cc8ea8d28d830ccfc5ab9efbc5d2 --- /dev/null +++ b/docs/source/population_extensions/cache.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.cache + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/condor.rst b/docs/source/population_extensions/condor.rst new file mode 100644 index 0000000000000000000000000000000000000000..f29b807109a0f67c101771af867998514b3762a0 --- /dev/null +++ b/docs/source/population_extensions/condor.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.condor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/dataIO.rst b/docs/source/population_extensions/dataIO.rst new file mode 100644 index 0000000000000000000000000000000000000000..420598310f0f885850525702766be2ebd29a936f --- /dev/null +++ b/docs/source/population_extensions/dataIO.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.dataIO + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/distribution_functions.rst b/docs/source/population_extensions/distribution_functions.rst new file mode 100644 index 0000000000000000000000000000000000000000..30bed60948cdf4caf648ff46506e6c1f0074f77b --- /dev/null +++ b/docs/source/population_extensions/distribution_functions.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.distribution_functions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/grid_options_defaults.rst b/docs/source/population_extensions/grid_options_defaults.rst new file mode 100644 index 0000000000000000000000000000000000000000..d833ab268a26bcf0fb18687e162eed4b5e132907 --- /dev/null +++ b/docs/source/population_extensions/grid_options_defaults.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.grid_options_defaults + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/gridcode.rst b/docs/source/population_extensions/gridcode.rst new file mode 100644 index 0000000000000000000000000000000000000000..66a99558b9e27b2693fa109e8d8746bd4127ff6f --- /dev/null +++ b/docs/source/population_extensions/gridcode.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.gridcode + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/metadata.rst b/docs/source/population_extensions/metadata.rst new file mode 100644 index 0000000000000000000000000000000000000000..399fb229d33b16f8eed0753a6132210baaf97e18 --- /dev/null +++ b/docs/source/population_extensions/metadata.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.metadata + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/slurm.rst b/docs/source/population_extensions/slurm.rst new file mode 100644 index 0000000000000000000000000000000000000000..5d5c73e2643e398371434165be6daa2f413f907e --- /dev/null +++ b/docs/source/population_extensions/slurm.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.slurm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/spacing_functions.rst b/docs/source/population_extensions/spacing_functions.rst new file mode 100644 index 0000000000000000000000000000000000000000..a3a3cb44ab5022261c91e9232f01452a6352d479 --- /dev/null +++ b/docs/source/population_extensions/spacing_functions.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.spacing_functions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/population_extensions/version_info.rst b/docs/source/population_extensions/version_info.rst new file mode 100644 index 0000000000000000000000000000000000000000..4193c1fe16eb7fed614f1bc4d0236507e5706d76 --- /dev/null +++ b/docs/source/population_extensions/version_info.rst @@ -0,0 +1,7 @@ +functions module +================ + +.. automodule:: binarycpython.utils.population_extensions.version_info + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/spacing_functions.rst b/docs/source/spacing_functions.rst deleted file mode 100644 index be0cf254dd52aafbde7404c588be65abcc46493e..0000000000000000000000000000000000000000 --- a/docs/source/spacing_functions.rst +++ /dev/null @@ -1,7 +0,0 @@ -spacing\_functions module -================================= - -.. automodule:: binarycpython.utils.spacing_functions - :members: - :undoc-members: - :show-inheritance: \ No newline at end of file