diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py index 4fb5fe1b7870884a5e02bbe9204300c6574e2982..7f80a0e4f3392c7d621f9cbe8db0766172a0ac9a 100644 --- a/binarycpython/utils/grid_options_defaults.py +++ b/binarycpython/utils/grid_options_defaults.py @@ -786,8 +786,8 @@ def write_grid_options_to_rst_file(output_file: str) -> None: # Moe & di Stefano options: print_option_descriptions( f, - moe_distefano_default_options, - moe_distefano_default_options_description, + moe_di_stefano_default_options, + moe_di_stefano_default_options_description, "Moe & di Stefano sampler options", "The following options are meant to be changed by the user.", ) diff --git a/docs/build/doctrees/binary_c_parameters.doctree b/docs/build/doctrees/binary_c_parameters.doctree index 39147e49b37777bd607584bb55d534f7b02de8c4..2b8b0fe1ca46d5a06a73efd23ab144570d88a675 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 49c9e8a7f23a14b54ebb7a54e9db0a46011dced7..8564058641095488be47b9c5a05e3a42bfa0d669 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/distribution_functions.doctree b/docs/build/doctrees/distribution_functions.doctree index 1da5ab487d8e3e6976aa07ca1ccce68e92453225..a5f832e6551b727b5e2b85396944895cb9f40287 100644 Binary files a/docs/build/doctrees/distribution_functions.doctree and b/docs/build/doctrees/distribution_functions.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 4736f93d38f415fb7a7bdc904b83a480d3293be0..9cac40f21767708fbffa9e71ccc2bc19c6d0c692 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/examples.doctree b/docs/build/doctrees/examples.doctree index d338f5d8552417a69007a27c5fe82a53820b2316..487fd3e3d1542a5bc3225a3cde737626765268bc 100644 Binary files a/docs/build/doctrees/examples.doctree and b/docs/build/doctrees/examples.doctree differ diff --git a/docs/build/doctrees/functions.doctree b/docs/build/doctrees/functions.doctree index 55930afdae733dce254051eee123bd7ff750dfd2..4fa1fa8595d451316bf9fb81bb73e75e959634b9 100644 Binary files a/docs/build/doctrees/functions.doctree and b/docs/build/doctrees/functions.doctree differ diff --git a/docs/build/doctrees/general_examples.doctree b/docs/build/doctrees/general_examples.doctree index 6a9ea1d82f7f59f34c616945f3276e2fab821847..e1c0cd131775ba9aff94d24ef4c79963cf4e3d71 100644 Binary files a/docs/build/doctrees/general_examples.doctree and b/docs/build/doctrees/general_examples.doctree differ diff --git a/docs/build/doctrees/grid.doctree b/docs/build/doctrees/grid.doctree index 12d12b69345f33e785b43d88a98ef8f1662b729e..7a1e57aa7c4d3642e652335e52a163dc78c55582 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 index 85f8989f323ce1c8bae27de688c7dac8a4cef280..a30f5c4df06312a6b3100c35e328ecc52d10ce2b 100644 Binary files a/docs/build/doctrees/grid_options_defaults.doctree and b/docs/build/doctrees/grid_options_defaults.doctree differ diff --git a/docs/build/doctrees/grid_options_descriptions.doctree b/docs/build/doctrees/grid_options_descriptions.doctree index 21e4c679b107fb157cb8ec70adfdad66409efb6e..ef9f5f153be768b3795647b853039c46c3f89296 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 index da2ff86e814c5f0b1bae3d23e1323c2e395ad97d..4fcafc7f3b5df064761c1d4e79a39e2b745defa0 100644 Binary files a/docs/build/doctrees/hpc_functions.doctree and b/docs/build/doctrees/hpc_functions.doctree differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index 9515d8a367c083a7bc16eb5808428c7b3c03830c..7d628604db8fc2ac7160e98c9ae762d91b6a70e7 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 a934abb3a00f1c89d9f74c148c35a275b451e39d..e39ddcdbc7468db4e520ea49e532ac855e217618 100644 Binary files a/docs/build/doctrees/modules.doctree and b/docs/build/doctrees/modules.doctree differ diff --git a/docs/build/doctrees/nbsphinx/notebook_population.ipynb b/docs/build/doctrees/nbsphinx/notebook_population.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..8d2bdbf982952c3a9debf9213d52656f2d8fa76e --- /dev/null +++ b/docs/build/doctrees/nbsphinx/notebook_population.ipynb @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "bbbaafbb-fd7d-4b73-a970-93506ba35d71", + "metadata": {}, + "source": [ + "# Title page\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6b8673-a2b5-4b50-ad1b-e90671f57470", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from binarycpython.utils.grid import Population\n", + "from binarycpython.utils.functions import (\n", + " get_help_all,\n", + " get_help,\n", + " create_hdf5,\n", + " output_lines,\n", + ")\n", + "from binarycpython.utils.custom_logging_functions import temp_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ab50b7-591f-4883-af09-116d1835a751", + "metadata": {}, + "outputs": [], + "source": [ + "#########################################################\n", + "# This file serves as an example for running a population.\n", + "# The use of help(<function>) is a good way to inspect what parameters are there to use\n", + "#########################################################\n", + "\n", + "# Create population object\n", + "example_pop = Population()\n", + "\n", + "# If you want verbosity, set this before other things\n", + "example_pop.set(verbose=1)\n", + "\n", + "# Setting values can be done via .set(<parameter_name>=<value>)\n", + "# Values that are known to be binary_c_parameters are loaded into bse_options.\n", + "# Those that are present in the default grid_options are set in grid_options\n", + "# All other values that you set are put in a custom_options dict\n", + "example_pop.set(\n", + " # binary_c physics options\n", + " M_1=10, # bse_options\n", + " separation=0, # bse_options\n", + " orbital_period=45000000080, # bse_options\n", + " max_evolution_time=15000, # bse_options\n", + " eccentricity=0.02, # bse_options\n", + " # Set companion to low mass\n", + " M_2=0.08, # Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.\n", + " # grid_options\n", + " amt_cores=2, # grid_options\n", + " verbose=1, # verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff\n", + " # Custom options # TODO: need to be set in grid_options probably\n", + " data_dir=os.path.join(\n", + " temp_dir(), \"example_python_population_result\"\n", + " ), # custom_options\n", + " base_filename=\"example_pop.dat\", # custom_options\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c986215-93b1-4e30-ad79-f7c397e9ff7d", + "metadata": {}, + "outputs": [], + "source": [ + "def parse_function(self, output):\n", + " # EXAMPLE PARSE_FUNCTION\n", + "\n", + " # extract info from the population instance\n", + "\n", + " # Get some information from the\n", + " data_dir = self.custom_options[\"data_dir\"]\n", + " base_filename = self.custom_options[\"base_filename\"]\n", + "\n", + " # Check directory, make if necessary\n", + " os.makedirs(data_dir, exist_ok=True)\n", + "\n", + " seperator = \" \"\n", + "\n", + " # Create filename\n", + " outfilename = os.path.join(data_dir, base_filename)\n", + "\n", + " parameters = [\"time\", \"mass\", \"zams_mass\", \"probability\", \"radius\", \"stellar_type\"]\n", + "\n", + " # Go over the output.\n", + " for el in output_lines(output):\n", + " headerline = el.split()[0]\n", + "\n", + " # CHeck the header and act accordingly\n", + " if headerline == \"MY_STELLAR_DATA\":\n", + " values = el.split()[1:]\n", + " print(values)\n", + "\n", + " if not len(parameters) == len(values):\n", + " print(\"Amount of column names isnt equal to amount of columns\")\n", + " raise ValueError\n", + "\n", + " if not os.path.exists(outfilename):\n", + " with open(outfilename, \"w\") as f:\n", + " f.write(seperator.join(parameters) + \"\\n\")\n", + "\n", + " with open(outfilename, \"a\") as f:\n", + " f.write(seperator.join(values) + \"\\n\")\n", + "\n", + "\n", + "\n", + "# Creating a parsing function\n", + "example_pop.set(\n", + " parse_function=parse_function, # Setting the parse function thats used in the evolve_population\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fa5188e-312f-4a05-aeda-0bd4c00629c8", + "metadata": {}, + "outputs": [], + "source": [ + "### Custom logging\n", + "# Log the moment when the star turns into neutron\n", + "example_pop.set(\n", + " C_logging_code=\"\"\"\n", + "if(stardata->star[0].stellar_type >= 13) \n", + "{\n", + " if (stardata->model.time < stardata->model.max_evolution_time)\n", + " {\n", + " Printf(\"MY_STELLAR_DATA %30.12e %g %g %g %g %d\\\\n\",\n", + " // \n", + " stardata->model.time, // 1\n", + " stardata->star[0].mass, // 2\n", + " stardata->common.zero_age.mass[0], // 4\n", + " stardata->model.probability, // 5\n", + " stardata->star[0].radius, // 6\n", + " stardata->star[0].stellar_type // 7\n", + " );\n", + " };\n", + " /* Kill the simulation to save time */\n", + " stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;\n", + "};\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd197154-a8ce-4865-8929-008d3483101a", + "metadata": {}, + "outputs": [], + "source": [ + "# Add grid variables\n", + "resolution = {\"M_1\": 20, \"q\": 20, \"per\": 40}\n", + "\n", + "# Mass\n", + "example_pop.add_grid_variable(\n", + " name=\"lnm1\",\n", + " longname=\"Primary mass\",\n", + " valuerange=[2, 150],\n", + " resolution=\"{}\".format(resolution[\"M_1\"]),\n", + " spacingfunc=\"const(math.log(2), math.log(150), {})\".format(resolution[\"M_1\"]),\n", + " precode=\"M_1=math.exp(lnm1)\",\n", + " probdist=\"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1\",\n", + " dphasevol=\"dlnm1\",\n", + " parameter_name=\"M_1\",\n", + " condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + ")\n", + "\n", + "# # Mass ratio\n", + "# test_pop.add_grid_variable(\n", + "# name=\"q\",\n", + "# longname=\"Mass ratio\",\n", + "# valuerange=[\"0.1/M_1\", 1],\n", + "# resolution=\"{}\".format(resolution['q']),\n", + "# spacingfunc=\"const(0.1/M_1, 1, {})\".format(resolution['q']),\n", + "# probdist=\"flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])\",\n", + "# dphasevol=\"dq\",\n", + "# precode=\"M_2 = q * M_1\",\n", + "# parameter_name=\"M_2\",\n", + "# condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + "# )\n", + "\n", + "# #\n", + "# test_pop.add_grid_variable(\n", + "# name=\"log10per\", # in days\n", + "# longname=\"log10(Orbital_Period)\",\n", + "# valuerange=[0.15, 5.5],\n", + "# resolution=\"{}\".format(resolution[\"per\"]),\n", + "# spacingfunc=\"const(0.15, 5.5, {})\".format(resolution[\"per\"]),\n", + "# precode=\"\"\"orbital_period = 10** log10per\n", + "# sep = calc_sep_from_period(M_1, M_2, orbital_period)\n", + "# sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)\n", + "# sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)\"\"\",\n", + "# probdist=\"sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)\",\n", + "# parameter_name=\"orbital_period\",\n", + "# dphasevol=\"dlog10per\",\n", + "# )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8c96b151-8c3b-4479-969f-6c2f898497a5", + "metadata": {}, + "source": [ + "Exporting of all the settings can be done with .export_all_info()\n", + "on default it exports everything, but can be supressed by turning it off:\n", + " population settings (bse_options, grid_options, custom_options), turn off with include_population\n", + " settings=False\n", + " binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults).\n", + " turn off with include_binary_c_defaults=False\n", + " include_binary_c_version_info (all the compilation info, and information about the compiled\n", + " parameters), turn off with include_binary_c_version_info=False\n", + " include_binary_c_help_all (all the help information for all the binary_c parameters),\n", + " turn off with include_binary_c_help_all=Fase\n", + "On default it will write this to the custom_options['data_dir'], but that can be overriden by\n", + " setting use_datadir=False and providing an outfile=<>" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ba83443c-64b4-4126-90b3-b1ca76c0f73d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_pop.export_all_info()" + ] + }, + { + "cell_type": "markdown", + "id": "ef5b51a1-e56d-4bec-a5c7-b9d5bceeceba", + "metadata": {}, + "source": [ + "Executing a single system\n", + "This uses the M_1 orbital period etc set with the set function" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "c0a9aed7-1fc9-4fe3-8bcf-4e987bfc00a9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating the code for the shared library for the custom logging\n", + "['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13']\n", + "None\n" + ] + } + ], + "source": [ + "output = example_pop.evolve_single()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea376c1-1e92-45af-8cab-9d7fdca564eb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "## Executing a population\n", + "## This uses the values generated by the grid_variables\n", + "example_pop.evolve() # TODO: update this function call" + ] + }, + { + "cell_type": "markdown", + "id": "ce937b07-7292-4bb1-b2e7-d69e51bdff6e", + "metadata": { + "tags": [] + }, + "source": [ + "Wrapping up the results to an hdf5 file can be done by using the create_hdf5\n", + "(<directory containing data and settings>) This function takes the settings file\n", + "(ending in _settings.json) and the data files (ending in .dat) from the data_dir\n", + "and packing them into an hdf5 file, which is then written into the same data_dir directory" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ad444138-f854-4fdb-8e18-49e35ac9c7e2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5\n", + "Adding settings to HDF5 file\n", + "Adding data to HDF5 file\n" + ] + } + ], + "source": [ + "create_hdf5(data_dir=example_pop.custom_options[\"data_dir\"], name=\"example_pop.hdf5\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34da69bc-fe60-4a9d-b07a-f6cd2f216964", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/build/doctrees/notebook_population.doctree b/docs/build/doctrees/notebook_population.doctree new file mode 100644 index 0000000000000000000000000000000000000000..08f0c57f12317e7f4149d83f15a4840761b0faaf Binary files /dev/null and b/docs/build/doctrees/notebook_population.doctree differ diff --git a/docs/build/doctrees/notebooks.doctree b/docs/build/doctrees/notebooks.doctree new file mode 100644 index 0000000000000000000000000000000000000000..f123d088aa1dfda9abcccddf71c255d92624ca9c Binary files /dev/null and b/docs/build/doctrees/notebooks.doctree differ diff --git a/docs/build/doctrees/plot_functions.doctree b/docs/build/doctrees/plot_functions.doctree index 57328fd02f2ddd260053baa71eeb415f969322ce..f0affdfdc59e0690f2070e069fceb200b846eece 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_example.doctree b/docs/build/doctrees/population_example.doctree index c2f09e4dafda3abec873ad81f29dd01e9f860e01..6a13c71bb631c06a385ab1128f9652c3c2d2d912 100644 Binary files a/docs/build/doctrees/population_example.doctree and b/docs/build/doctrees/population_example.doctree differ diff --git a/docs/build/doctrees/readme_link.doctree b/docs/build/doctrees/readme_link.doctree index 993113cf4c67cba24500d959f451f520e97aa898..e9622f33a0658d2e097976d6d9c3fe3e5368c872 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 bac76d0617cd57991a8e6869b0a4eaa34d091b4f..a6ea2f2c6c055369a77d782c380d77e53867454b 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 index 9cd4254603ca98ef74088656007aba83ddb64a59..70fd3a19e4682e01551414730b3227beb3555677 100644 Binary files a/docs/build/doctrees/spacing_functions.doctree and b/docs/build/doctrees/spacing_functions.doctree differ diff --git a/docs/build/doctrees/stellar_types.doctree b/docs/build/doctrees/stellar_types.doctree index 7d2d7a826cf471cd425845584a5e1009ea3c449d..a6440d267a247c8761eeb2c0ac1ea6bc311b716f 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 11570d5e27fab4d435fd51ab204d43636c5ed14d..1788c284e901d0fa9672d2860baaeab237464613 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 0fef865eb8bf85eda5e675e928067129120fc8c0..55a8b12a7eb43bc74f8800b104d95cd1b1c785b6 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: f4e8f1e1d66809b0bdafd78f415a24e8 +config: 44b2282a912f792069bea03167435e80 tags: 645f666f9bcd5a90fca523b33c5a78b7 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 e0517fb0bf16a8772b6aa7dc20fe2d209cbdce39..58baa7f283c772ac85577363d6a94ceb1c3b5702 100644 --- a/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/custom_logging_functions.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -170,11 +173,11 @@ <div class="viewcode-block" id="autogen_C_logging_code"><a class="viewcode-back" href="../../../custom_logging_functions.html#binarycpython.utils.custom_logging_functions.autogen_C_logging_code">[docs]</a><span class="k">def</span> <span class="nf">autogen_C_logging_code</span><span class="p">(</span><span class="n">logging_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">verbose</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="o">-></span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> <span class="sd">"""</span> -<span class="sd"> Function that autogenerates PRINTF statements for binaryc.</span> +<span class="sd"> Function that auto-generates PRINTF statements for binaryc.</span> <span class="sd"> Input is a dictionary where the key is the header of that logging line</span> <span class="sd"> and items which are lists of parameters that will be put in that logging line</span> -<span class="sd"> The list elements are all appended to 'stardata->' in the autogenerated code.</span> +<span class="sd"> The list elements are all appended to 'stardata->' in the auto-generated code.</span> <span class="sd"> Example:</span> <span class="sd"> Input dictionary should look like this::</span> @@ -190,7 +193,7 @@ <span class="sd"> Args:</span> <span class="sd"> logging_dict: Dictionary containing lists of parameters that binary_c has to output. The keys are used by binary_c as start of the sentence.</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> Returns:</span> <span class="sd"> string containing C printf statement built to output the parameters given as input.</span> @@ -269,7 +272,7 @@ <span class="sd"> Args:</span> <span class="sd"> code: Exact c-statement to output information in binary_c. Can be wrapped in logical statements.</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> Returns:</span> <span class="sd"> string containing the custom logging code. This includes all the includes and other definitions. This code will be used as the shared library</span> @@ -320,7 +323,7 @@ <span class="sd"> Args:</span> <span class="sd"> code: string containing the custom logging code to write to a file.</span> <span class="sd"> filename: target filename.</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> """</span> <span class="c1"># TODO: change this. I don't like the cwd</span> @@ -367,13 +370,13 @@ <span class="sd">"""</span> <span class="sd"> Function to build the compile command for the shared library</span> -<span class="sd"> Inspired by binary_c_inline_config command in perl</span> +<span class="sd"> Inspired by binary_c_inline_config command in Perl</span> -<span class="sd"> TODO: this function still has some cleaning up to do wrt default values for the compile command</span> +<span class="sd"> TODO: this function still has some cleaning up to do w.r.t. default values for the compile command</span> <span class="sd"> # https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/</span> <span class="sd"> Args:</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> Returns:</span> <span class="sd"> string containing the command to build the shared library</span> @@ -475,7 +478,7 @@ <span class="sd"> code: string containing the custom logging code</span> <span class="sd"> sourcefile_name: name of the file that will contain the code</span> <span class="sd"> outfile_name: name of the file that will be the shared library</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> """</span> <span class="c1"># Write code to file</span> @@ -499,7 +502,7 @@ <span class="p">)</span> <span class="p">)</span> - <span class="c1"># remove extra whitespaces:</span> + <span class="c1"># remove extra white spaces:</span> <span class="n">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">command</span><span class="o">.</span><span class="n">split</span><span class="p">())</span> <span class="c1"># Execute compilation and create the library</span> @@ -533,10 +536,10 @@ <span class="sd"> Args:</span> <span class="sd"> custom_logging_code: string containing the custom logging code</span> -<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicilty.</span> +<span class="sd"> verbose: Level of verbosity. Defaults to zero if not set explicitly.</span> <span class="sd"> Returns:</span> -<span class="sd"> memory adress of the custom logging function in a int type.</span> +<span class="sd"> memory address of the custom logging function in a capsule.</span> <span class="sd"> """</span> <span class="c1">#</span> @@ -547,7 +550,7 @@ <span class="n">custom_logging_dir</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">tmp_dir</span><span class="p">,</span> <span class="s2">"custom_logging"</span><span class="p">)</span> - <span class="c1"># Create the subdir for the custom_logging code</span> + <span class="c1"># Create the sub dir for the custom_logging code</span> <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">custom_logging_dir</span><span class="p">,</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="c1">#</span> @@ -623,9 +626,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/distribution_functions.html b/docs/build/html/_modules/binarycpython/utils/distribution_functions.html index 51cdc6db376c1e597944f242a22705e7121288de..ea5e186868859966b86c49488f0dc16e245402b8 100644 --- a/docs/build/html/_modules/binarycpython/utils/distribution_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/distribution_functions.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -167,12 +170,12 @@ <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 im gonna do that now</span> +<span class="sd"> calculations but not sure if I'm gonna do that now</span> <span class="sd"> - TODO: add eccentricity distribution: thermal</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 powerlaw thats general enough to fix the three part and the 4 part</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="kn">import</span> <span class="nn">gc</span> @@ -192,7 +195,7 @@ <span class="c1">###</span> <span class="c1"># File containing probability distributions</span> -<span class="c1"># Mostly copied from the perl modules</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> @@ -201,10 +204,10 @@ <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 dont have to be calculated each time.</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: globablly acessible dictionary where factors are stored in</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> @@ -295,17 +298,17 @@ <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 powerlaw</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: powerlaw slope</span> +<span class="sd"> k: power law slope</span> <span class="sd"> Returns:</span> -<span class="sd"> constant to normalize the given powerlaw between the min_val and max_val range</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> @@ -326,11 +329,11 @@ <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 powerlaw with index k at x from min to max</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 powerlaw</span> -<span class="sd"> max_val: upper bound of the powerlaw</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> @@ -349,7 +352,7 @@ <span class="n">powerlaw_const</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"># powerlaw</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="c1"># print(</span> <span class="c1"># "Power law from {} to {}: const = {}, y = {}".format(</span> @@ -369,9 +372,9 @@ <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 powerlaw</span> +<span class="sd"> Function to calculate the constants for a three-part power law</span> -<span class="sd"> TODO: use the powerlaw_constant function to calculate all these values</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> @@ -442,7 +445,7 @@ <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"> Generalized three-part power law, usually used for mass distributions</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> @@ -486,19 +489,19 @@ <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"> 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"> 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"> normalisation constant for the Gaussian distribution(mean, sigma) between gmin and gmax</span> <span class="sd"> """</span> - <span class="c1"># First time; calculate multipllier for given mean and sigma</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> @@ -515,15 +518,15 @@ <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"> 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"> 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"> 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> @@ -544,13 +547,13 @@ <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"> 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"> '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> @@ -559,7 +562,7 @@ <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"># normalize over given range</span> + <span class="c1"># normalise over given range</span> <span class="c1"># TODO: add loading into global var</span> <span class="n">normalisation</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="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> @@ -574,7 +577,7 @@ <div class="viewcode-block" id="Kroupa2001"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.Kroupa2001">[docs]</a><span class="k">def</span> <span class="nf">Kroupa2001</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, where the default values to the</span> +<span class="sd"> Probability distribution function for Kroupa 2001 IMF, where the default values to the</span> <span class="sd"> three_part_powerlaw are: default = {"m0": 0.1, "m1": 0.5, "m2": 1, "mmax": 100, "p1": -1.3, "p2": -2.3,"p3": -2.3}</span> <span class="sd"> Args:</span> @@ -585,7 +588,7 @@ <span class="sd"> 'probability' of distribution function evaluated at m</span> <span class="sd"> """</span> - <span class="c1"># Default params and override them</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> @@ -690,7 +693,7 @@ <div class="viewcode-block" id="imf_tinsley1980"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.imf_tinsley1980">[docs]</a><span class="k">def</span> <span class="nf">imf_tinsley1980</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): three_part_powerlaw(m, 0.1, 2.0, 10.0, 80.0, -2.0, -2.3, -3.3)</span> +<span class="sd"> Probability distribution function for Tinsley 1980 IMF (defined up until 80Msol): 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> @@ -717,7 +720,7 @@ <div class="viewcode-block" id="imf_scalo1998"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.imf_scalo1998">[docs]</a><span class="k">def</span> <span class="nf">imf_scalo1998</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"> From Scalo 1998</span> <span class="sd"> Probability distribution function for Scalo 1998 IMF (defined up until 80Msol): three_part_powerlaw(m, 0.1, 1.0, 10.0, 80.0, -1.2, -2.7, -2.3)</span> @@ -867,7 +870,7 @@ <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 distributoon</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> @@ -880,7 +883,7 @@ <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 normalizations are given</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> @@ -970,10 +973,10 @@ <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"># print("Izzard2012 called for M={} (trunc'd to {}), P={}\n".format(Mwas, M1, P))</span> + <span class="c1"># print("Izzard2012 called for M={} (truncated to {}), P={}\n".format(Mwas, M1, P))</span> <span class="c1"># Calculate the normalisations</span> - <span class="c1"># need to normalize the distribution for this mass</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> @@ -982,13 +985,13 @@ <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 const.</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="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="c1"># print(</span> - <span class="c1"># "Normalization constant for Izzard2012 M={} (log10Pmin={}) is\</span> + <span class="c1"># "Normalisation constant for Izzard2012 M={} (log10Pmin={}) is\</span> <span class="c1"># {}\n".format(</span> <span class="c1"># M1, log10Pmin, distribution_constants["Izzard2012"][M1][log10Pmin]</span> <span class="c1"># )</span> @@ -1079,7 +1082,7 @@ <span class="sd"> z: redshift</span> <span class="sd"> Returns:</span> -<span class="sd"> Cosmic star formation rate in Solarmass year^-1 megaparsec^-3</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> @@ -1102,8 +1105,8 @@ <span class="c1">#</span> <span class="c1"># TODO: Solve the memory issues that are present. </span> <span class="c1"># Are the interpolators not cleaned? </span> -<span class="c1"># TODO: Parallellize the setting up of the interpolators</span> -<span class="c1"># TODO: Generalize the code such that we can input other/newer tables</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> @@ -1114,7 +1117,7 @@ <div class="viewcode-block" id="poisson"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.poisson">[docs]</a><span class="k">def</span> <span class="nf">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="n">nmax</span><span class="o">=</span><span class="kc">None</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 calculates the poisson value and normalizes</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> @@ -1136,7 +1139,7 @@ <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 normalize</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="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> @@ -1161,7 +1164,7 @@ <span class="k">def</span> <span class="nf">_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="sd">"""</span> -<span class="sd"> Function to return the poisson value</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> @@ -1219,7 +1222,7 @@ <div class="viewcode-block" id="normalize_dict"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.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="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 normalize a dictionary</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="n">result_dict</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">result_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span> @@ -1227,11 +1230,10 @@ <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> -<div class="viewcode-block" id="Moe_de_Stefano_2017_multiplicity_fractions"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_multiplicity_fractions">[docs]</a><span class="k">def</span> <span class="nf">Moe_de_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="o">=</span><span class="mi">0</span><span class="p">):</span> +<div class="viewcode-block" id="Moe_di_Stefano_2017_multiplicity_fractions"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.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="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"> normalizes and merges them according to the users choice.</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 low, we can probably go a bit further</span> @@ -1290,7 +1292,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1311,7 +1313,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1320,7 +1322,7 @@ <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">M&S: Moe_de_Stefano_2017_multiplicity_fractions: Not normalizing (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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1330,11 +1332,11 @@ <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="n">full_fractions_array</span> <span class="o">*</span> <span class="n">multiplicity_modulator_array</span> - <span class="c1"># Normalize this so it is intotal 1:</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">M&S: Moe_de_Stefano_2017_multiplicity_fractions: Normalizing 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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1344,17 +1346,17 @@ <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="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 normalize to be sure</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">M&S: Moe_de_Stefano_2017_multiplicity_fractions: Normalizing 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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="n">verbosity</span><span class="p">,</span> <span class="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1382,7 +1384,7 @@ <span class="c1"># Since the information from the table for M&S is independent of any choice we make,</span> <span class="c1"># we need to take into account that for example our choice of minimum mass leads to</span> <span class="c1"># a minimum q_min that is not the same as in the table</span> - <span class="c1"># We should ignore those parts of the table and renormalize.</span> + <span class="c1"># We should ignore those parts of the table and renormalise.</span> <span class="c1"># If we are below the lowest value of qmin in the table we need to extrapolate the data</span> <span class="c1">#</span> <span class="c1"># Anyway, the goal of this function is to provide some extrapolated values for q when we should sample outside of the boundaries</span> @@ -1425,9 +1427,15 @@ <span class="c1"># qmin = options["ranges"]["M"][</span> <span class="c1"># 0</span> <span class="c1"># ] # TODO: this lower range must not be lower than Mmin.</span> - <span class="c1"># print("build_q_table qmin: {}".format(qmin))</span> + <span class="n">qmin</span> <span class="o">=</span> <span class="n">options</span><span class="p">[</span><span class="s1">'Mmin'</span><span class="p">]</span><span class="o">/</span><span class="n">options</span><span class="p">[</span><span class="s1">'M_1'</span><span class="p">]</span> - <span class="nb">print</span><span class="p">(</span><span class="s2">"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="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_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> @@ -1440,7 +1448,13 @@ <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="nb">print</span><span class="p">(</span><span class="s2">"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="n">verbose_print</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_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> @@ -1464,7 +1478,7 @@ <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: shouldnt the extrapolation need to happen if qmax > 0.95</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> @@ -1567,7 +1581,7 @@ <span class="p">)</span> <span class="k">continue</span> <span class="k">elif</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 value and extrapolate it</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> @@ -1620,7 +1634,7 @@ <span class="n">_MS_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="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">"M&S: build_q_table: Method 'poly' not implemented"</span><span class="p">)</span> <span class="k">else</span><span class="p">:</span> @@ -1654,16 +1668,16 @@ <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">M&S: build_q_table: Renormalizing table"</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: build_q_table: Renormalising table"</span><span class="p">,</span> <span class="n">verbosity</span><span class="p">,</span> <span class="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> - <span class="c1"># now we integrate and renormalize (if the table is not all zero)</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="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"># normalize to 1.0 by dividing the data by 1.0/$I</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> @@ -1697,7 +1711,7 @@ <div class="viewcode-block" id="powerlaw_extrapolation_q"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.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="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="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 powerlaw extrapolation at the lower end of the q range</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> @@ -1751,7 +1765,7 @@ <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/renormalization</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> @@ -1780,7 +1794,7 @@ <div class="viewcode-block" id="fill_data"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.fill_data">[docs]</a><span class="k">def</span> <span class="nf">fill_data</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 normalized array of values for given logmass and logperiod</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> @@ -1797,7 +1811,7 @@ <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"># Normalize the data</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> @@ -1810,7 +1824,7 @@ <span class="sd">"""</span> <span class="sd"> Function to calculate the P integral</span> -<span class="sd"> We need to renormalize this because min_per > 0, and not all periods should be included</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> @@ -1861,7 +1875,7 @@ <span class="sd">"""</span> <span class="sd"> Function to calculate the P integral</span> -<span class="sd"> We need to renormalize this because min_per > 0, and not all periods should be included</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> @@ -1914,9 +1928,9 @@ <span class="k">return</span> <span class="n">prob_dict</span></div> -<div class="viewcode-block" id="Moe_de_Stefano_2017_pdf"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_pdf">[docs]</a><span class="k">def</span> <span class="nf">Moe_de_Stefano_2017_pdf</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> +<div class="viewcode-block" id="Moe_di_Stefano_2017_pdf"><a class="viewcode-back" href="../../../distribution_functions.html#binarycpython.utils.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="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"> Moe & diStefano function to calculate the probability density.</span> <span class="sd"> takes a dictionary as input (in options) with options:</span> @@ -1929,7 +1943,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="p">),</span> <span class="n">verbosity</span><span class="p">,</span> @@ -1941,7 +1955,7 @@ <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">M&S: Moe_de_Stefano_2017_pdf: Did not find a multiplicity value in the options dictionary"</span> + <span class="n">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -1957,7 +1971,7 @@ <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="n">multiplicity</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">M&S: Moe_de_Stefano_2017_pdf: returning 0 because of the multiplicity modulator being 0"</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -1965,12 +1979,12 @@ <span class="c1">############################################################</span> <span class="c1"># multiplicity fraction</span> - <span class="c1"># Calculate the probabilty, or rather, fraction, of stars that belong to this mass</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="n">Moe_de_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="n">multiplicity</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> + <span class="n">multiplicity_probability</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="n">multiplicity</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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'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> @@ -1983,12 +1997,12 @@ <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 powerlaw now.</span> - <span class="c1"># TODO: is this actually the correct way? putting the M1 in there? Do we sample in logspace?</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="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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'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> @@ -2016,7 +2030,7 @@ <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">_MS_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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2033,7 +2047,7 @@ <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">_MS_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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2051,7 +2065,7 @@ <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">_MS_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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2083,7 +2097,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'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> @@ -2109,7 +2123,7 @@ <span class="c1"># Construct the q table</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">M&S: Moe_de_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">"</span><span class="se">\t</span><span class="s2">M&S: 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="n">verbosity</span><span class="p">,</span> @@ -2122,7 +2136,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2149,14 +2163,14 @@ <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 probabilty for ecc</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="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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'ecc'</span><span class="p">],</span> <span class="n">prob_dict</span> <span class="p">),</span> <span class="n">verbosity</span><span class="p">,</span> @@ -2189,7 +2203,7 @@ <span class="c1"># period is too short : system is not hierarchical</span> <span class="n">prob_dict</span><span class="p">[</span><span class="s1">'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">M&S: Moe_de_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 hierarchichal. Added 0 to probability list"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2224,7 +2238,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'P2'</span><span class="p">],</span> <span class="n">prob_dict</span> <span class="p">),</span> <span class="n">verbosity</span><span class="p">,</span> @@ -2249,7 +2263,7 @@ <span class="c1"># Build q table</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">M&S: Moe_de_Stefano_2017_pdf: Called build_q_table"</span><span class="p">,</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -2260,7 +2274,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2278,7 +2292,7 @@ <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 strructure of the quadruple. Is this only double binary quadrupples?</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> @@ -2311,7 +2325,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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="s1">'P3'</span><span class="p">],</span> <span class="n">prob_dict</span> <span class="p">),</span> <span class="n">verbosity</span><span class="p">,</span> @@ -2337,7 +2351,7 @@ <span class="c1"># Calculate new q table</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">M&S: Moe_de_Stefano_2017_pdf: Created q_table "</span><span class="o">.</span><span class="n">format</span><span class="p">(),</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: Moe_di_Stefano_2017_pdf: Created q_table "</span><span class="o">.</span><span class="n">format</span><span class="p">(),</span> <span class="n">verbosity</span><span class="p">,</span> <span class="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -2348,7 +2362,7 @@ <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="s1">'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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2367,7 +2381,7 @@ <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">M&S: Moe_de_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">msg</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2383,7 +2397,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2394,7 +2408,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2408,7 +2422,7 @@ <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">M&S: Moe_de_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="s2">"</span><span class="se">\t</span><span class="s2">M&S: 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> @@ -2425,7 +2439,7 @@ <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">"M&S: Moe_de_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="s2">"M&S: 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> @@ -2468,9 +2482,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/functions.html b/docs/build/html/_modules/binarycpython/utils/functions.html index d2a6ac3f3a26bc9dc4fd0f6b912d281cd94e1d25..1e2d750e9ae4005fac0de60de64ae3664560ea4e 100644 --- a/docs/build/html/_modules/binarycpython/utils/functions.html +++ b/docs/build/html/_modules/binarycpython/utils/functions.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -184,7 +187,7 @@ <span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</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">import</span> <span class="nn">binarycpython.utils.moe_distefano_data</span> <span class="k">as</span> <span class="nn">moe_distefano_data</span> +<span class="kn">import</span> <span class="nn">binarycpython.utils.moe_di_stefano_2017_data</span> <span class="k">as</span> <span class="nn">moe_di_stefano_2017_data</span> <span class="kn">import</span> <span class="nn">py_rinterpolate</span> @@ -239,7 +242,7 @@ <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"> 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> @@ -368,9 +371,9 @@ <span class="k">return</span> <span class="n">new_dict</span></div> -<div class="viewcode-block" id="get_moe_distefano_dataset"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.get_moe_distefano_dataset">[docs]</a><span class="k">def</span> <span class="nf">get_moe_distefano_dataset</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> +<div class="viewcode-block" id="get_moe_di_stefano_dataset"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.get_moe_di_stefano_dataset">[docs]</a><span class="k">def</span> <span class="nf">get_moe_di_stefano_dataset</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 to get the default moe and Distefano dataset or accept a userinput.</span> +<span class="sd"> Function to get the default moe and di Stefano dataset or accept a user input.</span> <span class="sd"> """</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">"file"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span> @@ -380,7 +383,7 @@ <span class="mi">1</span><span class="p">,</span> <span class="p">)</span> - <span class="n">json_data</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">moe_distefano_data</span><span class="o">.</span><span class="n">moe_distefano_2017_data</span><span class="p">)</span> + <span class="n">json_data</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">moe_di_stefano_2017_data</span><span class="o">.</span><span class="n">moe_di_stefano_2017_data</span><span class="p">)</span> <span class="k">else</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">isfile</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"file"</span><span class="p">]):</span> @@ -401,7 +404,7 @@ <span class="p">)</span> <span class="k">else</span><span class="p">:</span> - <span class="c1"># Read input data and Clean up the data if there are whitespaces around the keys</span> + <span class="c1"># Read input data and Clean up the data if there are white spaces around the keys</span> <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">options</span><span class="p">[</span><span class="s2">"file"</span><span class="p">],</span> <span class="s2">"r"</span><span class="p">)</span> <span class="k">as</span> <span class="n">data_filehandle</span><span class="p">:</span> <span class="n">datafile_data</span> <span class="o">=</span> <span class="n">data_filehandle</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> <span class="n">datafile_data</span> <span class="o">=</span> <span class="n">datafile_data</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'" '</span><span class="p">,</span> <span class="s1">'"'</span><span class="p">)</span> @@ -518,11 +521,11 @@ <span class="sd"> Function to remove files but with verbosity</span> <span class="sd"> Args:</span> -<span class="sd"> file: full filepath to the file that will be removed.</span> +<span class="sd"> file: full file path to the file that will be removed.</span> <span class="sd"> verbosity: current verbosity level (Optional)</span> <span class="sd"> Returns:</span> -<span class="sd"> the path of a subdirectory called binary_c_python in the TMP of the filesystem</span> +<span class="sd"> the path of a sub directory called binary_c_python in the TMP of the file system</span> <span class="sd"> """</span> @@ -548,7 +551,7 @@ <div class="viewcode-block" id="temp_dir"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.temp_dir">[docs]</a><span class="k">def</span> <span class="nf">temp_dir</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> <span class="sd">"""</span> -<span class="sd"> Function to create directory within the TMP directory of the filesystem</span> +<span class="sd"> Function to create directory within the TMP directory of the file system</span> <span class="sd"> Makes use of os.makedirs exist_ok which requires python 3.2+</span> @@ -556,7 +559,7 @@ <span class="sd"> function arguments: str input where each next input will be a child of the previous full_path. e.g. temp_dir('tests', 'grid') will become '/tmp/binary_c_python/tests/grid'</span> <span class="sd"> Returns:</span> -<span class="sd"> the path of a subdirectory called binary_c_python in the TMP of the filesystem</span> +<span class="sd"> the path of a sub directory called binary_c_python in the TMP of the file system</span> <span class="sd"> """</span> <span class="n">tmp_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">gettempdir</span><span class="p">()</span> @@ -579,7 +582,7 @@ <span class="sd"> - settings file is selected by checking on files ending on settings</span> <span class="sd"> - data files are selected by checking on files ending with .dat</span> -<span class="sd"> TODO: fix missing settingsfiles</span> +<span class="sd"> TODO: fix missing settings files</span> <span class="sd"> Args:</span> <span class="sd"> data_dir: directory containing the data files and settings file</span> @@ -662,7 +665,7 @@ <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 envvar is already present. lets save that and put that back later</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> @@ -778,7 +781,7 @@ <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"># Argpairs:</span> + <span class="c1"># Arg pairs:</span> <span class="c1"># Split off</span> <span class="n">argpairs</span> <span class="o">=</span> <span class="nb">set</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">cleaned</span> <span class="o">-</span> <span class="n">argpairs</span> @@ -902,7 +905,7 @@ <span class="c1">##########################</span> <span class="c1"># miscellaneous:</span> - <span class="c1"># All those that I didnt catch with the above filters. Could try to get some more out though.</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="c1"># TODO: filter a bit more.</span> <span class="n">misc_dict</span> <span class="o">=</span> <span class="p">{}</span> @@ -958,7 +961,7 @@ <div class="viewcode-block" id="output_lines"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.output_lines">[docs]</a><span class="k">def</span> <span class="nf">output_lines</span><span class="p">(</span><span class="n">output</span><span class="p">:</span> <span class="nb">str</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"> Function that outputs the lines that were recieved from the binary_c run, but now as an iterator.</span> +<span class="sd"> Function that outputs the lines that were received from the binary_c run, but now as an iterator.</span> <span class="sd"> Args:</span> <span class="sd"> output: raw binary_c output</span> @@ -980,7 +983,7 @@ <span class="sd"> This function works in two cases:</span> <span class="sd"> if the caught line contains output like 'example_header time=12.32 mass=0.94 ..'</span> <span class="sd"> or if the line contains output like 'example_header 12.32 0.94'</span> -<span class="sd"> Please dont the two cases.</span> +<span class="sd"> Please don't the two cases.</span> <span class="sd"> You can give a 'selected_header' to catch any line that starts with that.</span> <span class="sd"> Then the values will be put into a dictionary.</span> @@ -1034,7 +1037,7 @@ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">value_dicts</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">"Sorry, didnt find any line matching your header </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">selected_header</span><span class="p">)</span> + <span class="s2">"Sorry, didn't find any line matching your header </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">selected_header</span><span class="p">)</span> <span class="p">)</span> <span class="k">return</span> <span class="kc">None</span> @@ -1101,7 +1104,7 @@ <span class="sd"> This function is called by get_defaults()</span> <span class="sd"> Args:</span> -<span class="sd"> arg_dict: dictionary containing the argument + default keypairs of binary_c</span> +<span class="sd"> arg_dict: dictionary containing the argument + default key pairs of binary_c</span> <span class="sd"> Returns:</span> <span class="sd"> filtered dictionary (pairs with NULL and Function values are removed)</span> @@ -1271,10 +1274,10 @@ <div class="viewcode-block" id="get_help_all"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.get_help_all">[docs]</a><span class="k">def</span> <span class="nf">get_help_all</span><span class="p">(</span><span class="n">print_help</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 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 categorized in sections.</span> +<span class="sd"> 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.</span> <span class="sd"> Args:</span> -<span class="sd"> print_help: (optional, default = Tru) prints all the parameters and their descriptions.</span> +<span class="sd"> print_help: (optional, default = True) prints all the parameters and their descriptions.</span> <span class="sd"> Returns:</span> <span class="sd"> returns a dictionary containing dictionaries per section. These dictionaries contain the parameters and descriptions etc for all the parameters in that section</span> @@ -1320,7 +1323,7 @@ <span class="k">for</span> <span class="n">split_param</span> <span class="ow">in</span> <span class="n">split_params</span><span class="p">:</span> <span class="n">split_param_info</span> <span class="o">=</span> <span class="n">split_param</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="nb">len</span><span class="p">(</span><span class="n">split_param_info</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> - <span class="c1"># there are ocassions where the semicolon</span> + <span class="c1"># there are occasions where the semicolon</span> <span class="c1"># is used in the description text itself.</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">split_param_info</span><span class="p">)</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span> <span class="n">split_param_info</span> <span class="o">=</span> <span class="p">[</span> @@ -1329,7 +1332,7 @@ <span class="n">split_param_info</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="p">]</span> - <span class="c1"># other occassions?</span> + <span class="c1"># other occasions?</span> <span class="c1"># Put the information in a dict</span> <span class="n">param_name</span> <span class="o">=</span> <span class="n">split_param_info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> @@ -1484,7 +1487,7 @@ <span class="sd"> this document</span> <span class="sd"> Args:</span> -<span class="sd"> output_file: name of the output .rst faile containing the ReStructuredText formatted output</span> +<span class="sd"> output_file: name of the output .rst file containing the ReStructuredText formatted output</span> <span class="sd"> of all the binary_c parameters.</span> <span class="sd"> """</span> @@ -1536,13 +1539,13 @@ <span class="c1">########################################################</span> -<span class="c1"># logfile functions</span> +<span class="c1"># log file functions</span> <span class="c1">########################################################</span> <div class="viewcode-block" id="load_logfile"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.load_logfile">[docs]</a><span class="k">def</span> <span class="nf">load_logfile</span><span class="p">(</span><span class="n">logfile</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"> Experimental function that parses the generated logfile of binary_c.</span> +<span class="sd"> Experimental function that parses the generated log file of binary_c.</span> <span class="sd"> This function is not finished and shouldn't be used yet.</span> @@ -1550,7 +1553,7 @@ <span class="sd"> - TODO:</span> <span class="sd"> Args:</span> -<span class="sd"> - logfile: filename of the logfile you want to parse</span> +<span class="sd"> - logfile: filename of the log file you want to parse</span> <span class="sd"> Returns:</span> @@ -1938,7 +1941,7 @@ <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 piecewise sort</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> @@ -1993,7 +1996,7 @@ <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"> 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> @@ -2075,7 +2078,7 @@ <div class="viewcode-block" id="BinaryCEncoder.default"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.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"> 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> @@ -2090,13 +2093,13 @@ <div class="viewcode-block" id="binaryc_json_serializer"><a class="viewcode-back" href="../../../functions.html#binarycpython.utils.functions.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 serializer for binary_c to use when functions are present in the dictionary</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 serializable</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> @@ -2150,9 +2153,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/grid.html b/docs/build/html/_modules/binarycpython/utils/grid.html index 80bf98e072d27f7be1ac53fdd94611ddec408630..c6fdf1d6e3510a24e7a02c6a5ac6dc2d547ba315 100644 --- a/docs/build/html/_modules/binarycpython/utils/grid.html +++ b/docs/build/html/_modules/binarycpython/utils/grid.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -200,7 +203,7 @@ <span class="kn">from</span> <span class="nn">binarycpython.utils.grid_options_defaults</span> <span class="kn">import</span> <span class="p">(</span> <span class="n">grid_options_defaults_dict</span><span class="p">,</span> - <span class="n">moe_distefano_default_options</span><span class="p">,</span> + <span class="n">moe_di_stefano_default_options</span><span class="p">,</span> <span class="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -220,7 +223,7 @@ <span class="n">merge_dicts</span><span class="p">,</span> <span class="n">update_dicts</span><span class="p">,</span> <span class="n">extract_ensemble_json_from_string</span><span class="p">,</span> - <span class="n">get_moe_distefano_dataset</span><span class="p">,</span> + <span class="n">get_moe_di_stefano_dataset</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> @@ -243,7 +246,7 @@ <span class="n">get_max_multiplicity</span><span class="p">,</span> <span class="n">Arenou2010_binary_fraction</span><span class="p">,</span> <span class="n">raghavan2010_binary_fraction</span><span class="p">,</span> - <span class="n">Moe_de_Stefano_2017_multiplicity_fractions</span><span class="p">,</span> + <span class="n">Moe_di_Stefano_2017_multiplicity_fractions</span><span class="p">,</span> <span class="p">)</span> <span class="kn">from</span> <span class="nn">binarycpython</span> <span class="kn">import</span> <span class="n">_binary_c_bindings</span> @@ -281,7 +284,7 @@ <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="c1"># Load M&s options</span> - <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s1">'m&s_options'</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">moe_distefano_default_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="s1">'m&s_options'</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">moe_di_stefano_default_options</span><span class="p">)</span> <span class="c1"># Write M&S options to a file</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> @@ -500,7 +503,7 @@ <div class="viewcode-block" id="Population.last_grid_variable"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.last_grid_variable">[docs]</a> <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"> Functon that returns the last grid variable</span> +<span class="sd"> Function that returns the last grid variable</span> <span class="sd"> (i.e. the one with the highest grid_variable_number)</span> <span class="sd"> """</span> @@ -531,7 +534,7 @@ <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 forloop.</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> @@ -581,7 +584,7 @@ <span class="sd"> Examples:</span> <span class="sd"> precode = 'M_1=math.exp(lnm1);'</span> <span class="sd"> probdist:</span> -<span class="sd"> FUnction determining the probability that gets asigned to the sampled parameter</span> +<span class="sd"> Function determining the probability that gets assigned to the sampled parameter</span> <span class="sd"> </span> <span class="sd"> Examples:</span> <span class="sd"> probdist = 'Kroupa2001(M_1)*M_1'</span> @@ -600,8 +603,7 @@ <span class="sd"> (steps starting at lower edge + 0.5 * stepsize).</span> <span class="sd"> """</span> - <span class="c1"># TODO: Add check for the gridtype input value</span> - <span class="c1"># TODO: add functionality for branchpoint</span> + <span class="c1"># TODO: Add check for the grid type input value</span> <span class="c1"># Add grid_variable</span> <span class="n">grid_variable</span> <span class="o">=</span> <span class="p">{</span> @@ -636,7 +638,7 @@ <span class="sd">"""</span> <span class="sd"> Function that returns all the options that have been set.</span> -<span class="sd"> Can be combined with json to make a nice file.</span> +<span class="sd"> Can be combined with JSON to make a nice file.</span> <span class="sd"> Returns:</span> <span class="sd"> dictionary containing "bse_options", "grid_options", "custom_options"</span> @@ -726,14 +728,14 @@ <span class="n">include_binary_c_help_all</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="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="kc">None</span><span class="p">]:</span> <span class="sd">"""</span> -<span class="sd"> Function that exports the all_info to a json file</span> +<span class="sd"> Function that exports the all_info to a JSON file</span> <span class="sd"> Tasks:</span> -<span class="sd"> - TODO: if any of the values in the dicts here is of a not-serializable form, then we</span> +<span class="sd"> - TODO: if any of the values in the dicts here is of a not-serialisable form, then we</span> <span class="sd"> need to change that to a string or something so, use a recursive function that</span> <span class="sd"> goes over the all_info dict and finds those that fit</span> <span class="sd"> - TODO: Fix to write things to the directory. which options do which etc</span> -<span class="sd"> - TODO: theres flawed logic here. rewrite this part pls</span> +<span class="sd"> - TODO: there's flawed logic here. rewrite this part pls</span> <span class="sd"> - TODO: consider actually just removing the whole 'output to file' part and let the</span> <span class="sd"> user do this.</span> @@ -746,7 +748,7 @@ <span class="sd"> version info (see return_binary_c_version_info)</span> <span class="sd"> include_binary_c_help_all: whether to include a dict containing all the information</span> <span class="sd"> about the binary_c parameters (see get_help_all)</span> -<span class="sd"> use_datadir: boolean whether to use the custom_options['data_dir'] to write the file to.</span> +<span class="sd"> use_datadir: Boolean whether to use the custom_options['data_dir'] to write the file to.</span> <span class="sd"> If the custom_options["base_filename"] is set, the output file will be called</span> <span class="sd"> <custom_options["base_filename"]>_settings.json. Otherwise a file called</span> <span class="sd"> simulation_<date+time>_settings.json will be created</span> @@ -836,7 +838,7 @@ <span class="n">verbose</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="p">)</span> - <span class="c1"># Load memory adress</span> + <span class="c1"># Load memory address</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">"custom_logging_func_memaddr"</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">"_custom_logging_shared_library_file"</span><span class="p">],</span> @@ -858,7 +860,7 @@ <span class="n">logging_line</span><span class="p">,</span> <span class="n">verbose</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="p">)</span> - <span class="c1"># Load memory adress</span> + <span class="c1"># Load memory address</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">"custom_logging_func_memaddr"</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">"_custom_logging_shared_library_file"</span><span class="p">],</span> @@ -888,13 +890,13 @@ <div class="viewcode-block" id="Population.evolve"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.evolve">[docs]</a> <span class="k">def</span> <span class="nf">evolve</span><span class="p">(</span><span class="bp">self</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"> Entrypoint function of the whole object. From here, based on the settings,</span> +<span class="sd"> Entry point function of the whole object. From here, based on the settings,</span> <span class="sd"> we set up a SLURM or CONDOR grid, or if no setting is given we go straight</span> <span class="sd"> to evolving the population</span> <span class="sd"> There are no direct arguments to this function, rather it is based on the grid_options settings:</span> -<span class="sd"> grid_options['slurm']: integer boolean whether to use a slurm_grid evolution</span> -<span class="sd"> grid_options['condor']: integer boolean whether to use a condor_grid evolution</span> +<span class="sd"> grid_options['slurm']: integer Boolean whether to use a slurm_grid evolution</span> +<span class="sd"> grid_options['condor']: integer Boolean whether to use a condor_grid evolution</span> <span class="sd"> If neither of the above is set, we continue without using HPC routines</span> <span class="sd"> (that doesn't mean this cannot be run on a server with many cores)</span> @@ -908,7 +910,7 @@ <span class="c1"># Check which type:</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"># Execute slurm subroutines</span> + <span class="c1"># Execute Slurm subroutines</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">1</span><span class="p">:</span> @@ -1071,7 +1073,7 @@ <span class="n">generator</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">"_system_generator"</span><span class="p">](</span><span class="bp">self</span><span class="p">,</span> <span class="n">print_results</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="c1"># TODO: build in method to handle with the HPC.</span> - <span class="c1"># Continously fill the queue</span> + <span class="c1"># Continuously fill the queue</span> <span class="k">for</span> <span class="n">system_number</span><span class="p">,</span> <span class="n">system_dict</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">generator</span><span class="p">):</span> <span class="c1"># Put job in queue</span> <span class="n">job_queue</span><span class="o">.</span><span class="n">put</span><span class="p">((</span><span class="n">system_number</span><span class="p">,</span> <span class="n">system_dict</span><span class="p">))</span> @@ -1134,13 +1136,13 @@ <span class="sd">"""</span> <span class="sd"> Function that handles running the population using multiprocessing.</span> -<span class="sd"> First we set uip the multiprocessing manager and the job and result queue.</span> +<span class="sd"> First we set up the multiprocessing manager and the job and result queue.</span> <span class="sd"> Then we spawn <self.grid_options["amt_cores"]> amount of process instances,</span> <span class="sd"> and signal them to start.</span> <span class="sd"> While the processes are waiting for their instructions, we start the queue filler,</span> -<span class="sd"> which goes over the gridcode and puts all the tasks in a queue until its full.</span> +<span class="sd"> which goes over the grid code and puts all the tasks in a queue until its full.</span> <span class="sd"> The processes take these jobs, evolve the and store results.</span> @@ -1152,7 +1154,7 @@ <span class="c1"># Set process name</span> <span class="n">setproctitle</span><span class="o">.</span><span class="n">setproctitle</span><span class="p">(</span><span class="s1">'binarycpython parent process'</span><span class="p">)</span> - <span class="n">setproctitle</span><span class="o">.</span><span class="n">setthreadtitle</span><span class="p">(</span><span class="s2">"binarycpyhon parent thread"</span><span class="p">)</span> + <span class="n">setproctitle</span><span class="o">.</span><span class="n">setthreadtitle</span><span class="p">(</span><span class="s2">"binarycpython parent thread"</span><span class="p">)</span> <span class="c1"># Set up the manager object that can share info between processes</span> <span class="n">manager</span> <span class="o">=</span> <span class="n">multiprocessing</span><span class="o">.</span><span class="n">Manager</span><span class="p">()</span> @@ -1329,9 +1331,9 @@ <span class="mi">0</span><span class="p">,</span> <span class="p">)</span> - <span class="c1"># Set the ensemble memaddr</span> + <span class="c1"># Set the ensemble memory address</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="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> - <span class="c1"># set persistent data memaddr if necessary.</span> + <span class="c1"># set persistent data memory address if necessary.</span> <span class="n">persistent_data_memaddr</span> <span class="o">=</span> <span class="p">(</span> <span class="n">_binary_c_bindings</span><span class="o">.</span><span class="n">return_persistent_data_memaddr</span><span class="p">()</span> <span class="p">)</span> @@ -1398,7 +1400,7 @@ <span class="c1"># they match the keys known to binary_c.</span> <span class="c1"># Won't do that every system cause that is a bit of a waste of computing time.</span> <span class="k">if</span> <span class="n">number_of_systems_run</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> - <span class="c1"># TODO: Put this someplace else and wrap in a functioncall</span> + <span class="c1"># TODO: Put this someplace else and wrap in a function call</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">full_system_dict</span><span class="o">.</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="bp">self</span><span class="o">.</span><span class="n">available_keys</span><span class="p">:</span> <span class="c1"># Deal with special keys</span> @@ -1426,7 +1428,7 @@ <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"Process </span><span class="si">{}</span><span class="s2"> is handling system </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">ID</span><span class="p">,</span> <span class="n">system_number</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="mi">1</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># In some cases, the whole run crashes. To be able to figure out which system</span> @@ -1517,7 +1519,7 @@ <span class="n">ensemble_json</span> <span class="o">=</span> <span class="p">{}</span> <span class="c1"># Make sure it exists already</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="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">"Process </span><span class="si">{}</span><span class="s2">: is freeing ensemble output (using persisten_data memaddr </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">"Process </span><span class="si">{}</span><span class="s2">: is freeing ensemble output (using persistent_data memaddr </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">ID</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">persistent_data_memory_dict</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">process_ID</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> @@ -1572,7 +1574,7 @@ <span class="p">)</span> <span class="p">)</span> - <span class="c1"># free store mem:</span> + <span class="c1"># free store memory:</span> <span class="n">_binary_c_bindings</span><span class="o">.</span><span class="n">free_store_memaddr</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">"_store_memaddr"</span><span class="p">])</span> <span class="c1"># Return a set of results and errors</span> @@ -1656,7 +1658,7 @@ <span class="c1"># Clean up the interpolators if they exist</span> <span class="c1"># TODO: make a cleanup function for the individual threads</span> - <span class="c1"># TODO: make sure this is necessary. Actually its probably not, because we have a centralized queue</span> + <span class="c1"># TODO: make sure this is necessary. Actually its probably not, because we have a centralised queue</span> <span class="k">return</span> @@ -1691,7 +1693,7 @@ <span class="n">population</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="p">)</span> - <span class="c1"># TODO: add call to function that cleans up the temp customlogging dir,</span> + <span class="c1"># TODO: add call to function that cleans up the temp custom logging dir,</span> <span class="c1"># and unloads the loaded libraries.</span> <span class="c1"># TODO: make a switch to turn this off</span> @@ -1760,14 +1762,14 @@ <span class="p">[</span><span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"ensemble_filter_"</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">bse_options</span><span class="p">]</span> <span class="p">):</span> <span class="n">verbose_print</span><span class="p">(</span> - <span class="s2">"Warning: Running the ensemble without any filter requires alot of available RAM"</span><span class="p">,</span> + <span class="s2">"Warning: Running the ensemble without any filter requires a lot of available RAM"</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">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_filters_off"</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">"Warning: Running the ensemble without any filter requires alot of available RAM"</span><span class="p">,</span> + <span class="s2">"Warning: Running the ensemble without any filter requires a lot of available RAM"</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> @@ -1775,7 +1777,7 @@ <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">"combine_ensemble_with_thread_joining"</span><span class="p">]</span> <span class="o">==</span> <span class="kc">False</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">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">verbose_print</span><span class="p">(</span> - <span class="s2">"Error: chosen to write the ensemble output directly to files but data_dir isnt set"</span><span class="p">,</span> + <span class="s2">"Error: chosen to write the ensemble output directly to files but data_dir isn't set"</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> @@ -1789,23 +1791,24 @@ <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 havent defined any grid variables! Aborting"</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"># Set up the grid code with a dry run option to see total probability</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">True</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="s1">'do_dry_run'</span><span class="p">]:</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">True</span><span class="p">)</span> - <span class="c1"># Load the grid code</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_load_grid_function</span><span class="p">()</span> + <span class="c1"># Load the grid code</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_load_grid_function</span><span class="p">()</span> - <span class="c1"># Do a dry run</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_dry_run</span><span class="p">()</span> + <span class="c1"># Do a dry run</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_dry_run</span><span class="p">()</span> - <span class="nb">print</span><span class="p">(</span> - <span class="s2">"Total starcount for this run will 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="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_total_starcount"</span><span class="p">]</span> + <span class="nb">print</span><span class="p">(</span> + <span class="s2">"Total starcount for this run will 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="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s2">"_total_starcount"</span><span class="p">]</span> + <span class="p">)</span> <span class="p">)</span> - <span class="p">)</span> <span class="c1">#######################</span> <span class="c1"># Reset values and prepare the grid function</span> @@ -1835,8 +1838,9 @@ <span class="c1"># TODO: fix this function</span> <span class="c1"># self._load_source_file_function()</span> - <span class="c1"># Do a dry run</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_dry_run_source_file</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="s1">'do_dry_run'</span><span class="p">]:</span> + <span class="c1"># Do a dry run</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_dry_run_source_file</span><span class="p">()</span> <span class="nb">print</span><span class="p">(</span> <span class="s2">"Total starcount for this run will be: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> @@ -1899,7 +1903,7 @@ <span class="k">del</span> <span class="n">Moecache</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="c1">###################################################</span> - <span class="c1"># Gridcode functions</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> @@ -1917,13 +1921,13 @@ <span class="sd"> # TODO: Add correct logging everywhere</span> <span class="sd"> # TODO: add part to handle separation if orbital_period is added. Idea. use default values</span> <span class="sd"> # for orbital parameters and possibly overwrite those or something.</span> -<span class="sd"> # TODO: add centering center left right for the spacing.</span> +<span class="sd"> # TODO: add centre left right for the spacing.</span> <span class="sd"> # TODO: add sensible description to this function.</span> <span class="sd"> # TODO: Check whether all the probability and phasevol values are correct.</span> <span class="sd"> # TODO: import only the necessary packages/functions</span> <span class="sd"> # TODO: Put all the masses, eccentricities and periods in there already</span> -<span class="sd"> # TODO: Put the certain blocks that are repeated in some subfunctions</span> -<span class="sd"> # TODO: make sure running systems with multicplity 3+ is also possible.</span> +<span class="sd"> # TODO: Put the certain blocks that are repeated in some sub functions</span> +<span class="sd"> # TODO: make sure running systems with multiplicity 3+ is also possible.</span> <span class="sd"> Results in a generated file that contains a system_generator function.</span> <span class="sd"> """</span> @@ -2027,8 +2031,8 @@ <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"># Setting up the forloop</span> - <span class="c1"># Add comment for forloop</span> + <span class="c1"># Setting up the for loop</span> + <span class="c1"># Add comment for for loop</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="p">(</span> <span class="n">indent</span> <span class="o">*</span> <span class="n">depth</span> <span class="o">+</span> <span class="s2">"# for loop 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">grid_variable</span><span class="p">[</span><span class="s2">"parameter_name"</span><span class="p">])</span> @@ -2072,6 +2076,7 @@ <span class="c1"># + "\n"</span> <span class="c1"># )</span> + <span class="c1"># TODO: make sure this works</span> <span class="c1"># Adding for loop structure</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="p">(</span> <span class="n">indent</span> <span class="o">*</span> <span class="n">depth</span> @@ -2081,8 +2086,29 @@ <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="p">)</span> + <span class="c1"># code_string += (</span> + <span class="c1"># indent * depth</span> + <span class="c1"># + "for {}_sample_number in range({}):".format(</span> + <span class="c1"># grid_variable["name"], grid_variable["resolution"]</span> + <span class="c1"># )</span> + <span class="c1"># + "\n"</span> + <span class="c1"># )</span> + <span class="c1"># code_string += (</span> + <span class="c1"># indent * (depth+1)</span> + <span class="c1"># + "{} = sampled_values_{}[0] + ((sampled_values_{}[-1]-sampled_values_{}[0])/{}) * {}_sample_number".format(</span> + <span class="c1"># grid_variable["name"], grid_variable["name"], grid_variable["name"], grid_variable["name"], grid_variable["resolution"], grid_variable["name"]</span> + <span class="c1"># )</span> + <span class="c1"># + "\n"</span> + <span class="c1"># )</span> + + + + + + + <span class="c1">#################################################################################</span> - <span class="c1"># Check condition and generate forloop</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> @@ -2110,7 +2136,7 @@ <span class="p">)</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</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="c1"># Add some whiteline</span> + <span class="c1"># Add some white line</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="c1">##############3</span> @@ -2131,7 +2157,7 @@ <span class="p">)</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</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="c1"># Add some whiteline</span> + <span class="c1"># Add some white line</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="c1">#########################</span> @@ -2223,7 +2249,7 @@ <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 ifstatement here that checks</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> @@ -2261,7 +2287,7 @@ <span class="p">)</span> <span class="c1"># Set phasevol</span> - <span class="c1"># TODO: fix. this isnt supposed to be the value that we give it here. discuss</span> + <span class="c1"># TODO: fix. this isn't supposed to be the value that we give it here. discuss</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"phasevol /= phasevol_</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">grid_variable</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="p">)</span> @@ -2331,7 +2357,7 @@ <span class="c1">#################################################################################</span> <span class="c1"># Stop of code generation. Here the code is saved and written</span> - <span class="c1"># Save the gridcode to the grid_options</span> + <span class="c1"># Save the grid code to the grid_options</span> <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"Saving 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> @@ -2353,6 +2379,8 @@ <span class="k">with</span> <span class="nb">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="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="n">code_string</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">code_string</span><span class="p">,</span> <span class="n">indent</span><span class="p">,</span> <span class="n">depth</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> @@ -2460,13 +2488,10 @@ <span class="k">if</span> <span class="ow">not</span> <span class="n">dry_run</span><span class="p">:</span> <span class="c1"># Handling of what is returned, or what is not.</span> - <span class="c1"># TODO: think of whether this is a good method</span> - <span class="c1"># code_string += indent * (depth + 2) + "if (self.grid_options['multiplicity'] >= 2): print('phasevol_q: ',phasevol_q); print('phasevol_log10per: ',phasevol_log10per);\n"</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"yield(parameter_dict)</span><span class="se">\n</span><span class="s2">"</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"># code_string += indent * (depth + 2) + "if (self.grid_options['multiplicity'] >= 2): print(phasevol_q)\n"</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"pass</span><span class="se">\n</span><span class="s2">"</span> <span class="n">code_string</span> <span class="o">+=</span> <span class="n">indent</span> <span class="o">*</span> <span class="p">(</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</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> @@ -2475,7 +2500,7 @@ <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"> Functon that loads the script containing the grid code.</span> +<span class="sd"> Function that loads the script containing the grid code.</span> <span class="sd"> TODO: Update this description</span> <span class="sd"> Test function to run grid stuff. mostly to test the import</span> @@ -2547,10 +2572,10 @@ <span class="nb">print</span><span class="p">(</span><span class="n">info_string</span><span class="p">)</span> <span class="c1">###################################################</span> - <span class="c1"># Montecarlo functions</span> + <span class="c1"># Monte Carlo functions</span> <span class="c1">#</span> <span class="c1"># Functions below are used to run populations with</span> - <span class="c1"># Monte carlo</span> + <span class="c1"># Monte Carlo</span> <span class="c1">###################################################</span> <span class="c1">###################################################</span> @@ -2593,7 +2618,7 @@ <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="c1"># We can choose to perform a check on the sourcefile, which checks if the lines start with 'binary_c'</span> + <span class="c1"># We can choose to perform a check on the source file, which checks if the lines start with 'binary_c'</span> <span class="k">if</span> <span class="n">check</span><span class="p">:</span> <span class="n">source_file_check_filehandle</span> <span class="o">=</span> <span class="nb">open</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">"source_file_filename"</span><span class="p">],</span> <span class="s2">"r"</span> @@ -2618,7 +2643,7 @@ <span class="k">def</span> <span class="nf">_dict_from_line_source_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">line</span><span class="p">):</span> <span class="sd">"""</span> -<span class="sd"> Function that creates a dict from a binary_c argline</span> +<span class="sd"> Function that creates a dict from a binary_c arg line</span> <span class="sd"> """</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">"binary_c "</span><span class="p">):</span> @@ -3117,18 +3142,16 @@ <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="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 gridcode and writes the generated parameters to a file.</span> -<span class="sd"> In the form of a commandline call</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 wouldnt be that useful</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"> WARNING; dont use yet. not fully tested.</span> - <span class="sd"> Tasks:</span> <span class="sd"> - TODO: test this function</span> <span class="sd"> - TODO: make sure the binary_c_python .. output file has a unique name</span> @@ -3136,7 +3159,7 @@ <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 seperate file.</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"> """</span> <span class="c1"># Check if there is no compiled grid yet. If not, lets try to build it first.</span> @@ -3155,7 +3178,7 @@ <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 havent defined any grid variables! Aborting"</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> @@ -3169,7 +3192,7 @@ <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 theres one passed to the function</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> @@ -3178,7 +3201,7 @@ <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 theres a filename passed to the function</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> @@ -3253,7 +3276,7 @@ <span class="c1"># TODO: Unset custom logging code</span> - <span class="c1"># TODO: Unset function memory adress</span> + <span class="c1"># TODO: Unset function memory address</span> <span class="c1"># print(self.grid_options["custom_logging_func_memaddr"])</span> <span class="c1"># remove shared library files</span> @@ -3271,7 +3294,7 @@ <span class="p">)</span> <span class="c1"># TODO: make sure that these also work. not fully sure if necessary tho.</span> - <span class="c1"># whether its a single file, or a dict of files/memaddresses</span> + <span class="c1"># whether its a single file, or a dict of files/mem addresses</span> <span class="k">if</span> <span class="n">evol_type</span> <span class="o">==</span> <span class="s2">"MC"</span><span class="p">:</span> <span class="k">pass</span> @@ -3294,7 +3317,7 @@ <span class="sd"> Function to set the loggers for the execution of the grid</span> <span class="sd"> """</span> - <span class="c1"># Set logfile</span> + <span class="c1"># Set log file</span> <span class="n">binary_c_logfile</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">"log_file"</span><span class="p">]</span> <span class="c1"># Create directory</span> @@ -3312,7 +3335,7 @@ <span class="s2">"</span><span class="si">%(asctime)s</span><span class="s2"> - </span><span class="si">%(name)s</span><span class="s2"> - </span><span class="si">%(levelname)s</span><span class="s2"> - </span><span class="si">%(message)s</span><span class="s2">"</span> <span class="p">)</span> - <span class="c1"># Make and add filehandlers</span> + <span class="c1"># Make and add file handlers</span> <span class="c1"># make handler for output to file</span> <span class="n">handler_file</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">FileHandler</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="n">binary_c_logfile</span><span class="p">))</span> <span class="n">handler_file</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span><span class="n">log_formatter</span><span class="p">)</span> @@ -3388,7 +3411,7 @@ <span class="c1"># If not, write the failing systems to files unique to each process</span> <span class="k">else</span><span class="p">:</span> - <span class="c1"># Write arglines to file</span> + <span class="c1"># Write arg lines to file</span> <span class="n">argstring</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">system_dict</span><span class="p">)</span> <span class="k">with</span> <span class="nb">open</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> @@ -3406,9 +3429,9 @@ <span class="mi">2</span><span class="p">,</span> <span class="p">)</span> -<div class="viewcode-block" id="Population.set_moe_distefano_settings"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.set_moe_distefano_settings">[docs]</a> <span class="k">def</span> <span class="nf">set_moe_distefano_settings</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +<div class="viewcode-block" id="Population.set_moe_di_stefano_settings"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.set_moe_di_stefano_settings">[docs]</a> <span class="k">def</span> <span class="nf">set_moe_di_stefano_settings</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> <span class="sd">"""</span> -<span class="sd"> Function to set user input configurations for the moe & distefano methods</span> +<span class="sd"> Function to set user input configurations for the moe & di Stefano methods</span> <span class="sd"> </span> <span class="sd"> If nothing is passed then we just use the default options</span> <span class="sd"> """</span> @@ -3423,15 +3446,15 @@ <span class="k">with</span> <span class="nb">open</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">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="s2">"moeopts.dat"</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="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="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s1">'m&s_options'</span><span class="p">],</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span></div> - <span class="k">def</span> <span class="nf">_load_moe_distefano_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="k">def</span> <span class="nf">_load_moe_di_stefano_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">"""</span> -<span class="sd"> Function to load the moe & distefano data</span> +<span class="sd"> Function to load the moe & di stefano data</span> <span class="sd"> """</span> - <span class="c1"># Only if the grid is loaded and moecache contains information</span> + <span class="c1"># Only if the grid is loaded and Moecache contains information</span> <span class="k">if</span> <span class="p">(</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="s1">'_loaded_ms_data'</span><span class="p">])</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="p">:</span> - <span class="c1"># Load the json data</span> - <span class="n">json_data</span> <span class="o">=</span> <span class="n">get_moe_distefano_dataset</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="s1">'m&s_options'</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="s1">'verbosity'</span><span class="p">])</span> + <span class="c1"># Load the JSON data</span> + <span class="n">json_data</span> <span class="o">=</span> <span class="n">get_moe_di_stefano_dataset</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="s1">'m&s_options'</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="s1">'verbosity'</span><span class="p">])</span> <span class="c1"># entry of log10M1 is a list containing 1 dict. We can take the dict out of the list</span> <span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">]</span> <span class="o">=</span> <span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> @@ -3441,7 +3464,7 @@ <span class="k">if</span> <span class="ow">not</span> <span class="n">logmasses</span><span class="p">:</span> <span class="n">msg</span> <span class="o">=</span> <span class="s2">"The table does not contain masses."</span> <span class="n">verbose_print</span><span class="p">(</span> - <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_de_Stefano_2017: </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">msg</span><span class="p">),</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017: </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">msg</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> @@ -3464,7 +3487,7 @@ <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">logperiods</span> <span class="o">==</span> <span class="n">current_logperiods</span><span class="p">):</span> <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Period values are not consistent throughout the dataset"</span> <span class="n">verbose_print</span><span class="p">(</span> - <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_de_Stefano_2017: </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">msg</span><span class="p">),</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017: </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">msg</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> @@ -3480,7 +3503,7 @@ <span class="p">):</span> <span class="n">msg</span> <span class="o">=</span> <span class="s2">"Period spacing is not consistent throughout the dataset"</span> <span class="n">verbose_print</span><span class="p">(</span> - <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_de_Stefano_2017: </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">msg</span><span class="p">),</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017: </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">msg</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> @@ -3582,7 +3605,7 @@ <span class="c1">#</span> <span class="n">qs</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">][</span><span class="n">logmass</span><span class="p">][</span><span class="s2">"logP"</span><span class="p">][</span><span class="n">logperiod</span><span class="p">][</span><span class="s2">"q"</span><span class="p">])</span> - <span class="c1"># Fill the data and 'normalize'</span> + <span class="c1"># Fill the data and 'normalise'</span> <span class="n">qdata</span> <span class="o">=</span> <span class="n">fill_data</span><span class="p">(</span> <span class="n">qs</span><span class="p">,</span> <span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">][</span><span class="n">logmass</span><span class="p">][</span><span class="s2">"logP"</span><span class="p">][</span><span class="n">logperiod</span><span class="p">][</span><span class="s2">"q"</span><span class="p">]</span> <span class="p">)</span> @@ -3600,7 +3623,7 @@ <span class="c1"># eccentricity distributions as a function of mass, period, ecc</span> <span class="n">eccs</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">][</span><span class="n">logmass</span><span class="p">][</span><span class="s2">"logP"</span><span class="p">][</span><span class="n">logperiod</span><span class="p">][</span><span class="s2">"e"</span><span class="p">])</span> - <span class="c1"># Fill the data and 'normalize'</span> + <span class="c1"># Fill the data and 'normalise'</span> <span class="n">ecc_data</span> <span class="o">=</span> <span class="n">fill_data</span><span class="p">(</span> <span class="n">eccs</span><span class="p">,</span> <span class="n">json_data</span><span class="p">[</span><span class="s2">"log10M1"</span><span class="p">][</span><span class="n">logmass</span><span class="p">][</span><span class="s2">"logP"</span><span class="p">][</span><span class="n">logperiod</span><span class="p">][</span><span class="s2">"e"</span><span class="p">]</span> <span class="p">)</span> @@ -3640,35 +3663,35 @@ <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_de_Stefano_2017: Length period_distributions table: </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="se">\t</span><span class="s2">Moe_di_Stefano_2017: Length period_distributions table: </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">Moecache</span><span class="p">[</span><span class="s2">"period_distributions"</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="n">_MS_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_de_Stefano_2017: Length multiplicity table: </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="se">\t</span><span class="s2">Moe_di_Stefano_2017: Length multiplicity table: </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">Moecache</span><span class="p">[</span><span class="s2">"multiplicity_table"</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="n">_MS_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_de_Stefano_2017: Length q table: </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="se">\t</span><span class="s2">Moe_di_Stefano_2017: Length q table: </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">Moecache</span><span class="p">[</span><span class="s2">"q_distributions"</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="n">_MS_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_de_Stefano_2017: Length ecc table: </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="se">\t</span><span class="s2">Moe_di_Stefano_2017: Length ecc table: </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">Moecache</span><span class="p">[</span><span class="s2">"ecc_distributions"</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="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> - <span class="c1"># Write to logfile</span> + <span class="c1"># Write to log file</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> <span class="k">with</span> <span class="nb">open</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">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="s2">"moecache.json"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">cache_filehandle</span><span class="p">:</span> <span class="n">cache_filehandle</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">Moecache</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span> @@ -3676,9 +3699,9 @@ <span class="c1"># Signal that the data has been loaded</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s1">'_loaded_ms_data'</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span> - <span class="k">def</span> <span class="nf">_set_moe_distefano_distributions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="k">def</span> <span class="nf">_set_moe_di_stefano_distributions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">"""</span> -<span class="sd"> Function to set the moe & distefano distribution</span> +<span class="sd"> Function to set the Moe & di Stefano distribution</span> <span class="sd"> """</span> <span class="c1">############################################################</span> @@ -3687,7 +3710,7 @@ <span class="n">max_multiplicity</span> <span class="o">=</span> <span class="n">get_max_multiplicity</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="s1">'m&s_options'</span><span class="p">][</span><span class="s2">"multiplicity_modulator"</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_de_Stefano_2017: 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">max_multiplicity</span><span class="p">),</span> + <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017: 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">max_multiplicity</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="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -3737,7 +3760,7 @@ <span class="n">gridtype</span><span class="o">=</span><span class="s2">"centred"</span><span class="p">,</span> <span class="n">dphasevol</span><span class="o">=</span><span class="s2">"dlnm1"</span><span class="p">,</span> <span class="n">precode</span><span class="o">=</span><span class="s1">'M_1 = np.exp(lnm1); options["M_1"]=M_1'</span><span class="p">,</span> - <span class="n">probdist</span><span class="o">=</span><span class="s2">"Moe_de_Stefano_2017_pdf({{</span><span class="si">{}</span><span class="s2">, </span><span class="si">{}</span><span class="s2">, </span><span class="si">{}</span><span class="s2">}}, verbosity=self.grid_options['verbosity'])['total_probdens'] if multiplicity == 1 else 1"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">probdist</span><span class="o">=</span><span class="s2">"Moe_di_Stefano_2017_pdf({{</span><span class="si">{}</span><span class="s2">, </span><span class="si">{}</span><span class="s2">, </span><span class="si">{}</span><span class="s2">}}, verbosity=self.grid_options['verbosity'])['total_probdens'] if multiplicity == 1 else 1"</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="nb">dict</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="s1">'m&s_options'</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="p">],</span> <span class="s2">"'multiplicity': multiplicity"</span><span class="p">,</span> <span class="s2">"'M_1': M_1"</span> <span class="p">),</span> <span class="p">)</span> @@ -3999,7 +4022,7 @@ <span class="c1"># Now we are at the last part.</span> <span class="c1"># Here we should combine all the information that we calculate and update the options</span> - <span class="c1"># dictionary. This will then be passed to the Moe_de_Stefano_2017_pdf to calculate</span> + <span class="c1"># dictionary. This will then be passed to the Moe_di_Stefano_2017_pdf to calculate</span> <span class="c1"># the real probability. The trick we use is to strip the options_dict as a string</span> <span class="c1"># and add some keys to it:</span> @@ -4018,7 +4041,7 @@ <span class="s1">'"ecc3": eccentricity3'</span><span class="p">,</span> <span class="p">)</span> - <span class="n">probdist_addition</span> <span class="o">=</span> <span class="s2">"Moe_de_Stefano_2017_pdf(</span><span class="si">{}</span><span class="s2">, verbosity=self.grid_options['verbosity'])['total_probdens']"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> + <span class="n">probdist_addition</span> <span class="o">=</span> <span class="s2">"Moe_di_Stefano_2017_pdf(</span><span class="si">{}</span><span class="s2">, verbosity=self.grid_options['verbosity'])['total_probdens']"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span> <span class="n">updated_options</span> <span class="p">)</span> @@ -4033,9 +4056,7 @@ <span class="c1"># ] += "; self.grid_options['m&s_ensemble_options'] = {}".format(o)</span> <span class="n">verbose_print</span><span class="p">(</span> - <span class="s2">"</span><span class="se">\t</span><span class="s2">Moe_de_Stefano_2017: Added final call to the pdf function"</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="s2">"</span><span class="se">\t</span><span class="s2">Moe_di_Stefano_2017: Added final call to the pdf function"</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="n">_MS_VERBOSITY_LEVEL</span><span class="p">,</span> <span class="p">)</span> @@ -4044,29 +4065,29 @@ <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s1">'_set_ms_grid'</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span> <span class="c1">################################################################################################</span> -<div class="viewcode-block" id="Population.Moe_de_Stefano_2017"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.Moe_de_Stefano_2017">[docs]</a> <span class="k">def</span> <span class="nf">Moe_de_Stefano_2017</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +<div class="viewcode-block" id="Population.Moe_di_Stefano_2017"><a class="viewcode-back" href="../../../grid.html#binarycpython.utils.grid.Population.Moe_di_Stefano_2017">[docs]</a> <span class="k">def</span> <span class="nf">Moe_di_Stefano_2017</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> <span class="sd">"""</span> <span class="sd"> Function to handle setting the user input settings,</span> <span class="sd"> set up the data and load that into interpolators and</span> -<span class="sd"> and then set the distribution functions</span> +<span class="sd"> then set the distribution functions</span> <span class="sd"> Takes a dictionary as its only argument</span> <span class="sd"> """</span> - <span class="c1"># Set the userinput</span> - <span class="bp">self</span><span class="o">.</span><span class="n">set_moe_distefano_settings</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="n">options</span><span class="p">)</span> + <span class="c1"># Set the user input</span> + <span class="bp">self</span><span class="o">.</span><span class="n">set_moe_di_stefano_settings</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="n">options</span><span class="p">)</span> <span class="c1"># Load the data</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_load_moe_distefano_data</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_load_moe_di_stefano_data</span><span class="p">()</span> <span class="c1"># construct the grid here</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_set_moe_distefano_distributions</span><span class="p">()</span></div> + <span class="bp">self</span><span class="o">.</span><span class="n">_set_moe_di_stefano_distributions</span><span class="p">()</span></div> <span class="k">def</span> <span class="nf">_clean_interpolators</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">"""</span> <span class="sd"> Function to clean up the interpolators after a run</span> -<span class="sd"> We look in the MoeCache global variable for items that are interpolators.</span> +<span class="sd"> We look in the Moecache global variable for items that are interpolators.</span> <span class="sd"> Should be called by the general cleanup function AND the thread cleanup function</span> <span class="sd"> """</span> @@ -4092,7 +4113,12 @@ <span class="c1"># Just return 1 if no option has been chosen</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="s1">'multiplicity_fraction_function'</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">"Chosen not to use any multiplicity fraction."</span><span class="p">)</span> + <span class="n">verbose_print</span><span class="p">(</span> + <span class="s2">"_calculate_multiplicity_fraction: Chosen not to use any multiplicity fraction."</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="k">return</span> <span class="mi">1</span> <span class="c1"># Raise an error if the multiplicity is not set</span> @@ -4106,7 +4132,7 @@ <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"_calculate_multiplicity_fraction: Using Arenou 2010 to calculate multiplicity fractions"</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="mi">2</span><span class="p">,</span> <span class="p">)</span> <span class="n">binary_fraction</span> <span class="o">=</span> <span class="n">Arenou2010_binary_fraction</span><span class="p">(</span><span class="n">system_dict</span><span class="p">[</span><span class="s1">'M_1'</span><span class="p">])</span> @@ -4117,7 +4143,7 @@ <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"_calculate_multiplicity_fraction: Using Rhagavan 2010 to calculate multiplicity fractions"</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="mi">2</span><span class="p">,</span> <span class="p">)</span> <span class="n">binary_fraction</span> <span class="o">=</span> <span class="n">raghavan2010_binary_fraction</span><span class="p">(</span><span class="n">system_dict</span><span class="p">[</span><span class="s1">'M_1'</span><span class="p">])</span> @@ -4131,16 +4157,16 @@ <span class="n">msg</span> <span class="o">=</span> <span class="s2">"The M&S options do not seem to be set properly. The value is </span><span class="si">{}</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="s1">'m&s_options'</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"># Second: is the moecache filled.</span> + <span class="c1"># Second: is the Moecache filled.</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">Moecache</span><span class="p">:</span> <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"_calculate_multiplicity_fraction: Moecache is empty. It needs to be filled with the data for the interpolators. Loading the data now"</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="mi">2</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># Load the data</span> - <span class="bp">self</span><span class="o">.</span><span class="n">_load_moe_distefano_data</span><span class="p">()</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_load_moe_di_stefano_data</span><span class="p">()</span> <span class="c1"># record the prev value</span> <span class="n">prev_M1_value_ms</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="s1">'m&s_options'</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'M_1'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> @@ -4149,7 +4175,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">grid_options</span><span class="p">[</span><span class="s1">'m&s_options'</span><span class="p">][</span><span class="s1">'M_1'</span><span class="p">]</span> <span class="o">=</span> <span class="n">system_dict</span><span class="p">[</span><span class="s1">'M_1'</span><span class="p">]</span> <span class="c1"># Calculate the multiplicity fraction</span> - <span class="n">multiplicity_fraction_list</span> <span class="o">=</span> <span class="n">Moe_de_Stefano_2017_multiplicity_fractions</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="s1">'m&s_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="n">multiplicity_fraction_list</span> <span class="o">=</span> <span class="n">Moe_di_Stefano_2017_multiplicity_fractions</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="s1">'m&s_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="c1"># Turn into dict</span> <span class="n">multiplicity_fraction_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">el</span><span class="o">+</span><span class="mi">1</span><span class="p">:</span><span class="n">multiplicity_fraction_list</span><span class="p">[</span><span class="n">el</span><span class="p">]</span> <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">multiplicity_fraction_list</span><span class="p">))}</span> @@ -4165,7 +4191,7 @@ <span class="n">verbose_print</span><span class="p">(</span> <span class="s2">"Multiplicity: </span><span class="si">{}</span><span class="s2"> multiplicity_fraction: </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">system_dict</span><span class="p">[</span><span class="s1">'multiplicity'</span><span class="p">],</span> <span class="n">multiplicity_fraction_dict</span><span class="p">[</span><span class="n">system_dict</span><span class="p">[</span><span class="s1">'multiplicity'</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="mi">2</span><span class="p">,</span> <span class="p">)</span> <span class="k">return</span> <span class="n">multiplicity_fraction_dict</span><span class="p">[</span><span class="n">system_dict</span><span class="p">[</span><span class="s1">'multiplicity'</span><span class="p">]]</span></div> @@ -4195,9 +4221,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/grid_options_defaults.html b/docs/build/html/_modules/binarycpython/utils/grid_options_defaults.html index e2ee12889651d6179d83a3119a4cb9f2cd781df7..3349af953a5c102d10b71721546b0730f5a9721c 100644 --- a/docs/build/html/_modules/binarycpython/utils/grid_options_defaults.html +++ b/docs/build/html/_modules/binarycpython/utils/grid_options_defaults.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -183,11 +186,11 @@ <span class="c1"># general (or unordered..)</span> <span class="c1">##########################</span> <span class="s2">"amt_cores"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1"># total amount of cores used to evolve the population</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">"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: M&S 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">"_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">"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_{popuation_id}_{thread_id}.json</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> @@ -195,6 +198,7 @@ <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="c1">##########################</span> <span class="c1"># Execution log:</span> <span class="c1">##########################</span> @@ -224,17 +228,17 @@ <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 kes are they headers</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_loggion_functions.py</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 adress, useful for preloading.</span> - <span class="c1"># defaults to -1 and isnt used if thats the default then.</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> @@ -247,7 +251,7 @@ <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="p">],</span> <span class="c1"># available choices for type of population evolution. # TODO: fill later with monte carlo, sourcefile</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> @@ -599,14 +603,14 @@ <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">"binary"</span><span class="p">:</span> <span class="s2">"Set this to 1 if the population contains binaries. Input: int"</span><span class="p">,</span> <span class="c1"># TODO: write what effect this has.</span> - <span class="s2">"amt_cores"</span><span class="p">:</span> <span class="s2">"The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multiprocessed, not multithreaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int"</span><span class="p">,</span> + <span class="s2">"amt_cores"</span><span class="p">:</span> <span class="s2">"The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multi processed, not multi threaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int"</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="c1"># TODO: make sure this is logged to a file</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="c1"># TODO: make sure this is logged to a file</span> <span class="s2">"_total_starcount"</span><span class="p">:</span> <span class="s2">"Variable storing the total amount 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 amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the commandline 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 commandline calls. These all have to start with binary_c."</span><span class="p">,</span> <span class="c1"># TODO: Expand</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 amount 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 amount of failed systems."</span><span class="p">,</span> @@ -616,43 +620,44 @@ <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 montecarlo grid."</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. Unused "</span><span class="p">,</span> <span class="c1"># TODO: fix the functionality for this and describe it properly</span> <span class="s2">"log_args_dir"</span><span class="p">:</span> <span class="s2">"Directory to log the arguments to. Unused"</span><span class="p">,</span> <span class="c1"># TODO: fix the functionality for this and describe it properly</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="c1"># TODO: fix the functionality for this and describe it properly</span> - <span class="s2">"custom_logging_func_memaddr"</span><span class="p">:</span> <span class="s2">"Memory adress where the custom_logging_function is stored. Input: int"</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="c1"># TODO: check whether this is used properly throughout</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 adress 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 amount of systems that are allowed to fail before logging their commandline arguments to failed_systems log files"</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 amount 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 grid_options['results'] dictionary, or just output results to a file"</span><span class="p">,</span> <span class="s2">"condor"</span><span class="p">:</span> <span class="s2">"Int flag whether to use a condor type population evolution. Not implemented yet."</span><span class="p">,</span> <span class="c1"># TODO: describe this in more detail</span> - <span class="s2">"slurm"</span><span class="p">:</span> <span class="s2">"Int flag whether to use a slurm type population evolution."</span><span class="p">,</span> <span class="c1"># TODO: describe this in more detail</span> - <span class="s2">"weight"</span><span class="p">:</span> <span class="s2">"Weight factor for each system. The calculated probability is mulitplied 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">"slurm"</span><span class="p">:</span> <span class="s2">"Int flag whether to use a Slurm type population evolution."</span><span class="p">,</span> <span class="c1"># TODO: describe this in more detail</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="c1"># TODO: make sure this is used.</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 or linear processing"</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">{popuation_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 alot 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">"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_ms_grid"</span><span class="p">:</span> <span class="s2">"Internal flag whether the M&S 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">"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: M&S 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 M&S options. Don't write to this your self"</span><span class="p">,</span> <span class="s2">"_loaded_ms_data"</span><span class="p">:</span> <span class="s2">"Internal variable storing whether the M&S 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="p">}</span> <span class="c1">###</span> <span class="c1">#</span> -<span class="c1"># Default options for the Moe & Distefano grid</span> -<span class="n">moe_distefano_default_options</span> <span class="o">=</span> <span class="p">{</span> +<span class="c1"># Default options for the Moe & di Stefano grid</span> +<span class="n">moe_di_stefano_default_options</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"resolutions"</span><span class="p">:</span> <span class="p">{</span> <span class="s2">"M"</span><span class="p">:</span> <span class="p">[</span> <span class="mi">20</span><span class="p">,</span> <span class="c1"># M1</span> @@ -689,7 +694,7 @@ <span class="c1"># multiplicity model (as a function of log10M1)</span> <span class="c1">#</span> - <span class="c1"># You can use 'Poisson' which uses the system multiplicty</span> + <span class="c1"># You can use 'Poisson' which uses the system multiplicity</span> <span class="c1"># given by Moe and maps this to single/binary/triple/quad</span> <span class="c1"># fractions.</span> <span class="c1">#</span> @@ -712,16 +717,16 @@ <span class="mi">0</span><span class="p">,</span> <span class="c1"># triple</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># quadruple</span> <span class="p">],</span> - <span class="c1"># given a mix of multiplities, you can either (noting that</span> + <span class="c1"># given a mix of multiplicities, you can either (noting that</span> <span class="c1"># here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) )</span> <span class="c1">#</span> - <span class="c1"># 'norm' : normalize so the whole population is 1.0</span> + <span class="c1"># 'norm' : normalise so the whole population is 1.0</span> <span class="c1"># after implementing the appropriate fractions</span> <span class="c1"># S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)</span> <span class="c1">#</span> <span class="c1"># 'raw' : stick to what is predicted, i.e.</span> <span class="c1"># S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)</span> - <span class="c1"># without normalization</span> + <span class="c1"># without normalisation</span> <span class="c1"># (in which case the total probability < 1.0 unless</span> <span class="c1"># all you use single, binary, triple and quadruple)</span> <span class="c1">#</span> @@ -736,7 +741,7 @@ <span class="c1">#</span> <span class="c1">#</span> <span class="c1"># note: if you only set one multiplicity_modulator</span> - <span class="c1"># to 1, and all the others to 0, then normalizing</span> + <span class="c1"># to 1, and all the others to 0, then normalising</span> <span class="c1"># will mean that you effectively have the same number</span> <span class="c1"># of stars as single, binary, triple or quad (whichever</span> <span class="c1"># is non-zero) i.e. the multiplicity fraction is ignored.</span> @@ -748,14 +753,14 @@ <span class="s2">"q_high_extrapolation_method"</span><span class="p">:</span> <span class="s2">"linear"</span><span class="p">,</span> <span class="p">}</span> -<span class="n">moe_distefano_default_options_description</span> <span class="o">=</span> <span class="p">{</span> +<span class="n">moe_di_stefano_default_options_description</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"resolutions"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"ranges"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"Mmin"</span><span class="p">:</span> <span class="s2">"Minimum stellar mass"</span><span class="p">,</span> <span class="s2">"multiplicity_model"</span><span class="p">:</span> <span class="s2">"""</span> <span class="s2">multiplicity model (as a function of log10M1)</span> -<span class="s2">You can use 'Poisson' which uses the system multiplicty</span> +<span class="s2">You can use 'Poisson' which uses the system multiplicity</span> <span class="s2">given by Moe and maps this to single/binary/triple/quad</span> <span class="s2">fractions.</span> @@ -772,13 +777,13 @@ <span class="s2">defaults to [1,1,0,0] i.e. singles and binaries</span> <span class="s2">"""</span><span class="p">,</span> <span class="s2">"normalize_multiplicities"</span><span class="p">:</span> <span class="s2">"""</span> -<span class="s2">'norm': normalize so the whole population is 1.0</span> +<span class="s2">'norm': normalise so the whole population is 1.0</span> <span class="s2"> after implementing the appropriate fractions</span> <span class="s2"> S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)</span> -<span class="s2"> given a mix of multiplities, you can either (noting that</span> +<span class="s2"> given a mix of multiplicities, you can either (noting that</span> <span class="s2"> here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) )</span> <span class="s2"> note: if you only set one multiplicity_modulator</span> -<span class="s2"> to 1, and all the others to 0, then normalizing</span> +<span class="s2"> to 1, and all the others to 0, then normalising</span> <span class="s2"> will mean that you effectively have the same number</span> <span class="s2"> of stars as single, binary, triple or quad (whichever</span> <span class="s2"> is non-zero) i.e. the multiplicity fraction is ignored.</span> @@ -787,7 +792,7 @@ <span class="s2">'raw' : stick to what is predicted, i.e.</span> <span class="s2"> S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)</span> -<span class="s2"> without normalization</span> +<span class="s2"> without normalisation</span> <span class="s2"> (in which case the total probability < 1.0 unless</span> <span class="s2"> all you use single, binary, triple and quadruple)</span> @@ -827,7 +832,7 @@ <span class="sd"> option: which option you want to have the description of</span> <span class="sd"> returns:</span> -<span class="sd"> dict containg the option, the description if its there, otherwise empty string. And if the key doesnt exist, the dict is empty</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="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> @@ -890,7 +895,7 @@ <span class="sd"> Function that writes the descriptions of the grid options to a rst file</span> <span class="sd"> Tasks:</span> -<span class="sd"> TODO: seperate things into private and public options</span> +<span class="sd"> TODO: separate things into private and public options</span> <span class="sd"> Args:</span> <span class="sd"> output_file: target file where the grid options descriptions are written to</span> @@ -936,12 +941,12 @@ <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 & Distefano options:</span> + <span class="c1"># Moe & di Stefano options:</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_distefano_default_options</span><span class="p">,</span> - <span class="n">moe_distefano_default_options_description</span><span class="p">,</span> - <span class="s2">"Moe & Distefano sampler options"</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> @@ -1000,9 +1005,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/plot_functions.html b/docs/build/html/_modules/binarycpython/utils/plot_functions.html index d27308913f72033bb63161d66c3eacc716213cd3..390e89bddbb4c21b7183267e3cf47bd3ef84856a 100644 --- a/docs/build/html/_modules/binarycpython/utils/plot_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/plot_functions.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -164,12 +167,12 @@ <span class="sd"> plotting functions</span> <span class="sd"> master function: plot_system</span> -<span class="sd">All the loose components here can ofcourse be used in other routines if you want.</span> +<span class="sd">All the loose components here can of course be used in other routines if you want.</span> -<span class="sd">There is no preloaded matplotlib rc, you should do that yourself</span> +<span class="sd">There is no pre loaded matplotlib rc, you should do that yourself</span> -<span class="sd">These plotting routines are designed for binary systems, and admittingly they are here mostly for </span> -<span class="sd">inspirational purposes, since one would problably want to customize the plots. </span> +<span class="sd">These plotting routines are designed for binary systems, and admittedly they are here mostly for </span> +<span class="sd">inspirational purposes, since one would probably want to customise the plots. </span> <span class="sd">Regardless, having some plotting routines in here seemed like a nice idea</span> <span class="sd">Tasks</span> @@ -826,9 +829,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. 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 45ea5478f70ee9363d69b888eabd0ad8e72cd09d..cfa05a03bd5b80653aa133032183cfad8b37f8d5 100644 --- a/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html +++ b/docs/build/html/_modules/binarycpython/utils/run_system_wrapper.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -179,7 +182,7 @@ <span class="sd"> Examples:</span> <span class="sd"> - run_system(M_1=10): will run a system with ZAMS mass 1 = 10</span> <span class="sd"> - run_system(M_1=10, log_filename="~/example_log.txt"): Will run a system</span> -<span class="sd"> and write the logfile too</span> +<span class="sd"> and write the log file too</span> <span class="sd"> - run_system(M_1=10, parse_function=fancy_parsing_function)</span> <span class="sd"> Tasks:</span> @@ -192,9 +195,9 @@ <span class="sd"> Kwargs:</span> <span class="sd"> custom_logging_code: Should contain a string containing the c-code for the shared library.</span> <span class="sd"> If this is provided binary_c will use that custom logging code to output its data</span> -<span class="sd"> log_filename: Should contain name of the binary_c system logfile.</span> +<span class="sd"> log_filename: Should contain name of the binary_c system log file.</span> <span class="sd"> Passing this will make sure that the filename gets written for a run</span> -<span class="sd"> (its default behaviour is NOT to write a logfile for a system)</span> +<span class="sd"> (its default behaviour is NOT to write a log file for a system)</span> <span class="sd"> parse_function (function): should contain a function that parses the output.</span> <span class="sd"> The parse function should take 1 required parameter: the output of the binaryc run</span> <span class="sd"> Passing this will call the parse_function by passing it the output of the binary_c call</span> @@ -213,7 +216,7 @@ <span class="n">func_memaddr</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="n">write_logfile</span> <span class="o">=</span> <span class="mi">0</span> - <span class="c1"># Create dict to pass as argstring</span> + <span class="c1"># Create dict to pass as arg string</span> <span class="n">binary_c_args</span> <span class="o">=</span> <span class="p">{}</span> <span class="c1"># Check which binary_c arguments have been passed and put them into a dict</span> @@ -225,7 +228,7 @@ <span class="k">else</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">other_keywords</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span> - <span class="s2">"The following keyword was not recognized and wont be used:</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">"The following keyword was not recognised and wont be used:</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="n">key</span> <span class="p">)</span> <span class="p">)</span> @@ -284,9 +287,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/spacing_functions.html b/docs/build/html/_modules/binarycpython/utils/spacing_functions.html index b2e20f0406d135ad49cca2156d7f78bd19ff492f..06d3820d3ae586205a60476fe99b721e0ea86879 100644 --- a/docs/build/html/_modules/binarycpython/utils/spacing_functions.html +++ b/docs/build/html/_modules/binarycpython/utils/spacing_functions.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -206,9 +209,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/binarycpython/utils/useful_funcs.html b/docs/build/html/_modules/binarycpython/utils/useful_funcs.html index 9fe021016a584544105928dbbc8b261cf1a801d0..8ba8b44261c72ccd2de1722967d6d3c2a4fe0de7 100644 --- a/docs/build/html/_modules/binarycpython/utils/useful_funcs.html +++ b/docs/build/html/_modules/binarycpython/utils/useful_funcs.html @@ -30,6 +30,9 @@ <script src="../../../_static/underscore.js"></script> <script src="../../../_static/doctools.js"></script> <script src="../../../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../../../_static/js/theme.js"></script> @@ -165,10 +168,13 @@ <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"> - 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> <span class="sd">Tasks:</span> <span class="sd"> - TODO: check whether these functions are correct</span> -<span class="sd"> - TODO: add unittest for maximum_mass_ratio_for_RLOF</span> +<span class="sd"> - TODO: add unit test for maximum_mass_ratio_for_RLOF</span> <span class="sd">"""</span> <span class="kn">import</span> <span class="nn">math</span> @@ -186,13 +192,13 @@ <span class="sd">"""</span> <span class="sd"> Wrapper function for _binary_c_bindings.return_minimum_orbit_for_RLOF</span> -<span class="sd"> Handles the output and returns the minimum orbital period at which RLOF just does not occur at zams</span> +<span class="sd"> Handles the output and returns the minimum orbital period at which RLOF just does not occur at ZAMS</span> <span class="sd"> Args:</span> <span class="sd"> M1: Primary mass in solar mass</span> <span class="sd"> M2: Secondary mass in solar mass</span> <span class="sd"> metallicity: metallicity</span> -<span class="sd"> store_memaddr (optional): store memory adress</span> +<span class="sd"> store_memaddr (optional): store memory address</span> <span class="sd"> Returns:</span> <span class="sd"> minimum orbital_period that just does not cause a RLOF at ZAMS</span> @@ -560,9 +566,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html index 191639de419f1f892361c50bfc35fbe6b9e04fd9..1ed7f7d1c26a073f6a3aa518d9236695444a59fc 100644 --- a/docs/build/html/_modules/index.html +++ b/docs/build/html/_modules/index.html @@ -30,6 +30,9 @@ <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="../_static/js/theme.js"></script> @@ -186,9 +189,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/_sources/binary_c_parameters.rst.txt b/docs/build/html/_sources/binary_c_parameters.rst.txt index cdca213e0895c0790c4f7097c7731afe40b9e315..0c1a4dd88ee625380f747f05594385a18ea74e0b 100644 --- a/docs/build/html/_sources/binary_c_parameters.rst.txt +++ b/docs/build/html/_sources/binary_c_parameters.rst.txt @@ -4,7 +4,7 @@ The following chapter contains all the parameters that the current version of bi This information was obtained by the following binary_c build: - **binary_c git branch**: branch_david **binary_c git revision**: 6044:20210720:d1ed5b6c1 **Built on**: Jul 20 2021 13:54:45 + **binary_c git branch**: branch_david **binary_c git revision**: 6068:20210727:8955b541d **Built on**: Jul 27 2021 22:36:46 Section: stars diff --git a/docs/build/html/_sources/examples.rst.txt b/docs/build/html/_sources/examples.rst.txt index ab58720d9b5a670eb13d8468daa687e72ab86e52..16e4dc3a0f7b7bcd92dd5e32e85b18e708fdc653 100644 --- a/docs/build/html/_sources/examples.rst.txt +++ b/docs/build/html/_sources/examples.rst.txt @@ -6,4 +6,5 @@ This chapter contains the source code of example scripts which show the way of u :hidden: general_examples - population_example \ No newline at end of file + population_example + notebooks \ No newline at end of file diff --git a/docs/build/html/_sources/grid_options_descriptions.rst.txt b/docs/build/html/_sources/grid_options_descriptions.rst.txt index 5a77792e1c16a5d29844979038458f27e145a08d..319b8d56a6d616f55498ec2c10fbc358a8de8183 100644 --- a/docs/build/html/_sources/grid_options_descriptions.rst.txt +++ b/docs/build/html/_sources/grid_options_descriptions.rst.txt @@ -13,19 +13,21 @@ The following options are meant to be changed by the user. | **C_logging_code**: 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. -| **amt_cores**: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multiprocessed, not multithreaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int +| **amt_cores**: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multi processed, not multi threaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int -| **combine_ensemble_with_thread_joining**: BOolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{popuation_id}_{thread_id}.json +| **combine_ensemble_with_thread_joining**: Boolean 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 | **condor**: Int flag whether to use a condor type population evolution. Not implemented yet. -| **custom_logging_func_memaddr**: Memory adress where the custom_logging_function is stored. Input: int +| **custom_logging_func_memaddr**: Memory address where the custom_logging_function is stored. Input: int + +| **do_dry_run**: Whether to do a dry run to calculate the total probability for this run | **ensemble_factor_in_probability_weighted_mass**: Flag to multiply all the ensemble results with 1/probability_weighted_mass | **evolution_type**: Variable containing the type of evolution used of the grid. Multiprocessing or linear processing -| **failed_systems_threshold**: Variable storing the maximum amount of systems that are allowed to fail before logging their commandline arguments to failed_systems log files +| **failed_systems_threshold**: Variable storing the maximum amount of systems that are allowed to fail before logging their command line arguments to failed_systems log files | **gridcode_filename**: 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. @@ -35,7 +37,7 @@ The following options are meant to be changed by the user. | **log_file**: Log file for the population object. Unused -| **log_runtime_systems**: 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 alot 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 +| **log_runtime_systems**: 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 | **m&s_options**: Internal variable that holds the M&S options. Don't write to this your self @@ -49,20 +51,20 @@ The following options are meant to be changed by the user. | **repeat**: Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating. -| **run_zero_probability_system**: Whether to run the zero probability systems. Default: True. Input: boolean +| **run_zero_probability_system**: Whether to run the zero probability systems. Default: True. Input: Boolean -| **slurm**: Int flag whether to use a slurm type population evolution. +| **slurm**: Int flag whether to use a Slurm type population evolution. -| **source_file_filename**: Variable containing the source file containing lines of binary_c commandline calls. These all have to start with binary_c. +| **source_file_filename**: Variable containing the source file containing lines of binary_c command line calls. These all have to start with binary_c. | **tmp_dir**: 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 | **verbosity**: 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. -| **weight**: Weight factor for each system. The calculated probability is mulitplied 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. +| **weight**: 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. -Moe & Distefano sampler options -------------------------------- +Moe & di Stefano sampler options +-------------------------------- The following options are meant to be changed by the user. @@ -71,7 +73,7 @@ The following options are meant to be changed by the user. | **multiplicity_model**: multiplicity model (as a function of log10M1) - You can use 'Poisson' which uses the system multiplicty + You can use 'Poisson' which uses the system multiplicity given by Moe and maps this to single/binary/triple/quad fractions. @@ -90,13 +92,13 @@ The following options are meant to be changed by the user. | **normalize_multiplicities**: - 'norm': normalize so the whole population is 1.0 + 'norm': normalise so the whole population is 1.0 after implementing the appropriate fractions S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) - given a mix of multiplities, you can either (noting that + given a mix of multiplicities, you can either (noting that here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) ) note: if you only set one multiplicity_modulator - to 1, and all the others to 0, then normalizing + to 1, and all the others to 0, then normalising will mean that you effectively have the same number of stars as single, binary, triple or quad (whichever is non-zero) i.e. the multiplicity fraction is ignored. @@ -105,7 +107,7 @@ The following options are meant to be changed by the user. 'raw' : stick to what is predicted, i.e. S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) - without normalization + without normalisation (in which case the total probability < 1.0 unless all you use single, binary, triple and quadruple) @@ -160,9 +162,9 @@ The following options are not meant to be changed by the user, as these options | **_end_time_evolution**: Variable storing the end timestamp of the population evolution. Set by the object itself -| **_errors_exceeded**: Variable storing a boolean flag whether the amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the commandline arguments of the failing systems will not be stored in the failed_system_log files. +| **_errors_exceeded**: Variable storing a Boolean flag whether the amount 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. -| **_errors_found**: Variable storing a boolean flag whether errors by binary_c are encountered. +| **_errors_found**: Variable storing a Boolean flag whether errors by binary_c are encountered. | **_evolution_type_options**: List containing the evolution type options. @@ -186,9 +188,9 @@ The following options are not meant to be changed by the user, as these options | **_start_time_evolution**: Variable storing the start timestamp of the population evolution. Set by the object itself. -| **_store_memaddr**: Memory adress of the store object for binary_c. +| **_store_memaddr**: Memory address of the store object for binary_c. -| **_system_generator**: Function object that contains the system generator function. This can be from a grid, or a source file, or a montecarlo grid. +| **_system_generator**: Function object that contains the system generator function. This can be from a grid, or a source file, or a Monte Carlo grid. | **_total_mass_run**: To count the total mass that thread/process has ran diff --git a/docs/build/html/_sources/notebook_population.ipynb.txt b/docs/build/html/_sources/notebook_population.ipynb.txt new file mode 100644 index 0000000000000000000000000000000000000000..8d2bdbf982952c3a9debf9213d52656f2d8fa76e --- /dev/null +++ b/docs/build/html/_sources/notebook_population.ipynb.txt @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "bbbaafbb-fd7d-4b73-a970-93506ba35d71", + "metadata": {}, + "source": [ + "# Title page\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6b8673-a2b5-4b50-ad1b-e90671f57470", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from binarycpython.utils.grid import Population\n", + "from binarycpython.utils.functions import (\n", + " get_help_all,\n", + " get_help,\n", + " create_hdf5,\n", + " output_lines,\n", + ")\n", + "from binarycpython.utils.custom_logging_functions import temp_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ab50b7-591f-4883-af09-116d1835a751", + "metadata": {}, + "outputs": [], + "source": [ + "#########################################################\n", + "# This file serves as an example for running a population.\n", + "# The use of help(<function>) is a good way to inspect what parameters are there to use\n", + "#########################################################\n", + "\n", + "# Create population object\n", + "example_pop = Population()\n", + "\n", + "# If you want verbosity, set this before other things\n", + "example_pop.set(verbose=1)\n", + "\n", + "# Setting values can be done via .set(<parameter_name>=<value>)\n", + "# Values that are known to be binary_c_parameters are loaded into bse_options.\n", + "# Those that are present in the default grid_options are set in grid_options\n", + "# All other values that you set are put in a custom_options dict\n", + "example_pop.set(\n", + " # binary_c physics options\n", + " M_1=10, # bse_options\n", + " separation=0, # bse_options\n", + " orbital_period=45000000080, # bse_options\n", + " max_evolution_time=15000, # bse_options\n", + " eccentricity=0.02, # bse_options\n", + " # Set companion to low mass\n", + " M_2=0.08, # Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.\n", + " # grid_options\n", + " amt_cores=2, # grid_options\n", + " verbose=1, # verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff\n", + " # Custom options # TODO: need to be set in grid_options probably\n", + " data_dir=os.path.join(\n", + " temp_dir(), \"example_python_population_result\"\n", + " ), # custom_options\n", + " base_filename=\"example_pop.dat\", # custom_options\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c986215-93b1-4e30-ad79-f7c397e9ff7d", + "metadata": {}, + "outputs": [], + "source": [ + "def parse_function(self, output):\n", + " # EXAMPLE PARSE_FUNCTION\n", + "\n", + " # extract info from the population instance\n", + "\n", + " # Get some information from the\n", + " data_dir = self.custom_options[\"data_dir\"]\n", + " base_filename = self.custom_options[\"base_filename\"]\n", + "\n", + " # Check directory, make if necessary\n", + " os.makedirs(data_dir, exist_ok=True)\n", + "\n", + " seperator = \" \"\n", + "\n", + " # Create filename\n", + " outfilename = os.path.join(data_dir, base_filename)\n", + "\n", + " parameters = [\"time\", \"mass\", \"zams_mass\", \"probability\", \"radius\", \"stellar_type\"]\n", + "\n", + " # Go over the output.\n", + " for el in output_lines(output):\n", + " headerline = el.split()[0]\n", + "\n", + " # CHeck the header and act accordingly\n", + " if headerline == \"MY_STELLAR_DATA\":\n", + " values = el.split()[1:]\n", + " print(values)\n", + "\n", + " if not len(parameters) == len(values):\n", + " print(\"Amount of column names isnt equal to amount of columns\")\n", + " raise ValueError\n", + "\n", + " if not os.path.exists(outfilename):\n", + " with open(outfilename, \"w\") as f:\n", + " f.write(seperator.join(parameters) + \"\\n\")\n", + "\n", + " with open(outfilename, \"a\") as f:\n", + " f.write(seperator.join(values) + \"\\n\")\n", + "\n", + "\n", + "\n", + "# Creating a parsing function\n", + "example_pop.set(\n", + " parse_function=parse_function, # Setting the parse function thats used in the evolve_population\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fa5188e-312f-4a05-aeda-0bd4c00629c8", + "metadata": {}, + "outputs": [], + "source": [ + "### Custom logging\n", + "# Log the moment when the star turns into neutron\n", + "example_pop.set(\n", + " C_logging_code=\"\"\"\n", + "if(stardata->star[0].stellar_type >= 13) \n", + "{\n", + " if (stardata->model.time < stardata->model.max_evolution_time)\n", + " {\n", + " Printf(\"MY_STELLAR_DATA %30.12e %g %g %g %g %d\\\\n\",\n", + " // \n", + " stardata->model.time, // 1\n", + " stardata->star[0].mass, // 2\n", + " stardata->common.zero_age.mass[0], // 4\n", + " stardata->model.probability, // 5\n", + " stardata->star[0].radius, // 6\n", + " stardata->star[0].stellar_type // 7\n", + " );\n", + " };\n", + " /* Kill the simulation to save time */\n", + " stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;\n", + "};\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd197154-a8ce-4865-8929-008d3483101a", + "metadata": {}, + "outputs": [], + "source": [ + "# Add grid variables\n", + "resolution = {\"M_1\": 20, \"q\": 20, \"per\": 40}\n", + "\n", + "# Mass\n", + "example_pop.add_grid_variable(\n", + " name=\"lnm1\",\n", + " longname=\"Primary mass\",\n", + " valuerange=[2, 150],\n", + " resolution=\"{}\".format(resolution[\"M_1\"]),\n", + " spacingfunc=\"const(math.log(2), math.log(150), {})\".format(resolution[\"M_1\"]),\n", + " precode=\"M_1=math.exp(lnm1)\",\n", + " probdist=\"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1\",\n", + " dphasevol=\"dlnm1\",\n", + " parameter_name=\"M_1\",\n", + " condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + ")\n", + "\n", + "# # Mass ratio\n", + "# test_pop.add_grid_variable(\n", + "# name=\"q\",\n", + "# longname=\"Mass ratio\",\n", + "# valuerange=[\"0.1/M_1\", 1],\n", + "# resolution=\"{}\".format(resolution['q']),\n", + "# spacingfunc=\"const(0.1/M_1, 1, {})\".format(resolution['q']),\n", + "# probdist=\"flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])\",\n", + "# dphasevol=\"dq\",\n", + "# precode=\"M_2 = q * M_1\",\n", + "# parameter_name=\"M_2\",\n", + "# condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + "# )\n", + "\n", + "# #\n", + "# test_pop.add_grid_variable(\n", + "# name=\"log10per\", # in days\n", + "# longname=\"log10(Orbital_Period)\",\n", + "# valuerange=[0.15, 5.5],\n", + "# resolution=\"{}\".format(resolution[\"per\"]),\n", + "# spacingfunc=\"const(0.15, 5.5, {})\".format(resolution[\"per\"]),\n", + "# precode=\"\"\"orbital_period = 10** log10per\n", + "# sep = calc_sep_from_period(M_1, M_2, orbital_period)\n", + "# sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)\n", + "# sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)\"\"\",\n", + "# probdist=\"sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)\",\n", + "# parameter_name=\"orbital_period\",\n", + "# dphasevol=\"dlog10per\",\n", + "# )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8c96b151-8c3b-4479-969f-6c2f898497a5", + "metadata": {}, + "source": [ + "Exporting of all the settings can be done with .export_all_info()\n", + "on default it exports everything, but can be supressed by turning it off:\n", + " population settings (bse_options, grid_options, custom_options), turn off with include_population\n", + " settings=False\n", + " binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults).\n", + " turn off with include_binary_c_defaults=False\n", + " include_binary_c_version_info (all the compilation info, and information about the compiled\n", + " parameters), turn off with include_binary_c_version_info=False\n", + " include_binary_c_help_all (all the help information for all the binary_c parameters),\n", + " turn off with include_binary_c_help_all=Fase\n", + "On default it will write this to the custom_options['data_dir'], but that can be overriden by\n", + " setting use_datadir=False and providing an outfile=<>" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ba83443c-64b4-4126-90b3-b1ca76c0f73d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_pop.export_all_info()" + ] + }, + { + "cell_type": "markdown", + "id": "ef5b51a1-e56d-4bec-a5c7-b9d5bceeceba", + "metadata": {}, + "source": [ + "Executing a single system\n", + "This uses the M_1 orbital period etc set with the set function" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "c0a9aed7-1fc9-4fe3-8bcf-4e987bfc00a9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating the code for the shared library for the custom logging\n", + "['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13']\n", + "None\n" + ] + } + ], + "source": [ + "output = example_pop.evolve_single()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea376c1-1e92-45af-8cab-9d7fdca564eb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "## Executing a population\n", + "## This uses the values generated by the grid_variables\n", + "example_pop.evolve() # TODO: update this function call" + ] + }, + { + "cell_type": "markdown", + "id": "ce937b07-7292-4bb1-b2e7-d69e51bdff6e", + "metadata": { + "tags": [] + }, + "source": [ + "Wrapping up the results to an hdf5 file can be done by using the create_hdf5\n", + "(<directory containing data and settings>) This function takes the settings file\n", + "(ending in _settings.json) and the data files (ending in .dat) from the data_dir\n", + "and packing them into an hdf5 file, which is then written into the same data_dir directory" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ad444138-f854-4fdb-8e18-49e35ac9c7e2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5\n", + "Adding settings to HDF5 file\n", + "Adding data to HDF5 file\n" + ] + } + ], + "source": [ + "create_hdf5(data_dir=example_pop.custom_options[\"data_dir\"], name=\"example_pop.hdf5\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34da69bc-fe60-4a9d-b07a-f6cd2f216964", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/build/html/_sources/notebooks.rst.txt b/docs/build/html/_sources/notebooks.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..8002bcb2bc18ba071f737026c70fa34f8297207b --- /dev/null +++ b/docs/build/html/_sources/notebooks.rst.txt @@ -0,0 +1,10 @@ +Notebooks +========= +The notebooks. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + notebook_population.ipynb diff --git a/docs/build/html/binary_c_parameters.html b/docs/build/html/binary_c_parameters.html index 9993c622ef77e4b90f5f229bb241f35e246c84d6..d76fcd53759765e9bc812e63ae60d7d96125f8be 100644 --- a/docs/build/html/binary_c_parameters.html +++ b/docs/build/html/binary_c_parameters.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -37,7 +40,7 @@ <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 of population script" href="population_example.html" /> + <link rel="prev" title="Title page" href="notebook_population.html" /> </head> <body class="wy-body-for-nav"> @@ -166,11 +169,35 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="binary-c-parameters"> + +<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="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>: 6044:20210720:d1ed5b6c1 <strong>Built on</strong>: Jul 20 2021 13:54:45</p> +<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>: 6068:20210727:8955b541d <strong>Built on</strong>: Jul 27 2021 22:36:46</p> </dd> </dl> <div class="section" id="section-stars"> @@ -3433,7 +3460,7 @@ <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="population_example.html" class="btn btn-neutral float-left" title="Example of population script" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> + <a href="notebook_population.html" class="btn btn-neutral float-left" title="Title page" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> @@ -3456,9 +3483,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/custom_logging_functions.html b/docs/build/html/custom_logging_functions.html index 3a5d93579b899bc01758d50501befcbbbb6a1707..40bf0c78f733ddd8d7f3fe89b93a46ae7240e96d 100644 --- a/docs/build/html/custom_logging_functions.html +++ b/docs/build/html/custom_logging_functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,17 +174,41 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.custom_logging_functions"> + +<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="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 id="binarycpython.utils.custom_logging_functions.autogen_C_logging_code"> <code class="sig-prename descclassname">binarycpython.utils.custom_logging_functions.</code><code class="sig-name descname">autogen_C_logging_code</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">logging_dict</span></em>, <em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">0</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">[source]</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 autogenerates PRINTF statements for binaryc. +<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> -<p>The list elements are all appended to ‘stardata->’ in the autogenerated code.</p> +<p>The list elements are all appended to ‘stardata->’ in the auto-generated code.</p> <p class="rubric">Example</p> <p>Input dictionary should look like this:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="s1">'MY_STELLAR_DATA'</span><span class="p">:</span> @@ -198,7 +225,7 @@ and items which are lists of parameters that will be put in that logging line</p <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>logging_dict</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code>) – Dictionary containing lists of parameters that binary_c has to output. The keys are used by binary_c as start of the sentence.</p></li> -<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p></li> +<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</p></li> </ul> </dd> <dt class="field-even">Return type</dt> @@ -243,7 +270,7 @@ and items which are lists of parameters that will be put in that logging line</p <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>code</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – Exact c-statement to output information in binary_c. Can be wrapped in logical statements.</p></li> -<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p></li> +<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</p></li> </ul> </dd> <dt class="field-even">Return type</dt> @@ -264,7 +291,7 @@ and items which are lists of parameters that will be put in that logging line</p <dd class="field-odd"><ul class="simple"> <li><p><strong>code</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – string containing the custom logging code to write to a file.</p></li> <li><p><strong>filename</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – target filename.</p></li> -<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p></li> +<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</p></li> </ul> </dd> <dt class="field-even">Return type</dt> @@ -285,7 +312,7 @@ TODO: consider returning a status</p> <li><p><strong>code</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – string containing the custom logging code</p></li> <li><p><strong>sourcefile_name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – name of the file that will contain the code</p></li> <li><p><strong>outfile_name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – name of the file that will be the shared library</p></li> -<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p></li> +<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</p></li> </ul> </dd> <dt class="field-even">Return type</dt> @@ -305,14 +332,14 @@ I recommend using this in function in combination with a function that generates <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>custom_logging_code</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – string containing the custom logging code</p></li> -<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p></li> +<li><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</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">Tuple</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">str</span></code>]</p> </dd> <dt class="field-odd">Returns</dt> -<dd class="field-odd"><p>memory adress of the custom logging function in a int type.</p> +<dd class="field-odd"><p>memory address of the custom logging function in a capsule.</p> </dd> </dl> </dd></dl> @@ -341,12 +368,12 @@ I recommend using this in function in combination with a function that generates <dt id="binarycpython.utils.custom_logging_functions.return_compilation_dict"> <code class="sig-prename descclassname">binarycpython.utils.custom_logging_functions.</code><code class="sig-name descname">return_compilation_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">0</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">[source]</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 wrt default values for the compile command +<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 # <a class="reference external" href="https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/">https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/</a></p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> -<dd class="field-odd"><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicilty.</p> +<dd class="field-odd"><p><strong>verbose</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – Level of verbosity. Defaults to zero if not set explicitly.</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> @@ -393,9 +420,9 @@ I recommend using this in function in combination with a function that generates provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/distribution_functions.html b/docs/build/html/distribution_functions.html index 98fb7a3d044283c17d55ec1cb1bc76b5e7e9e1dd..0261d69ff9fcd1941eab66fe03a15ff18a569cf5 100644 --- a/docs/build/html/distribution_functions.html +++ b/docs/build/html/distribution_functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.distribution_functions"> + +<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="module-binarycpython.utils.distribution_functions"> <span id="distribution-functions-module"></span><h1>distribution_functions module<a class="headerlink" href="#module-binarycpython.utils.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 @@ -186,7 +213,7 @@ generate probability distributions for sampling populations</p> </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 im gonna do that now</p> +<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> @@ -194,7 +221,7 @@ generate probability distributions for sampling populations</p> <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 powerlaw thats general enough to fix the three part and the 4 part</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> @@ -246,7 +273,7 @@ and Sana’s power law (as a function of logP) at high mass</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.Kroupa2001"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">Kroupa2001</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">m</span></em>, <em class="sig-param"><span class="n">newopts</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#Kroupa2001"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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 +<dd><p>Probability distribution function for Kroupa 2001 IMF, where the default values to the three_part_powerlaw are: default = {“m0â€: 0.1, “m1â€: 0.5, “m2â€: 1, “mmaxâ€: 100, “p1â€: -1.3, “p2â€: -2.3,â€p3â€: -2.3}</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> @@ -265,10 +292,10 @@ three_part_powerlaw are: default = {“m0â€: 0.1, “m1â€: 0.5, “m2â€: 1, </dd></dl> <dl class="py function"> -<dt id="binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_multiplicity_fractions"> -<code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">Moe_de_Stefano_2017_multiplicity_fractions</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#Moe_de_Stefano_2017_multiplicity_fractions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_multiplicity_fractions" title="Permalink to this definition">¶</a></dt> +<dt id="binarycpython.utils.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions"> +<code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">Moe_di_Stefano_2017_multiplicity_fractions</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#Moe_di_Stefano_2017_multiplicity_fractions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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 -normalizes and merges them according to the users choice.</p> +normalises and merges them according to the users choice.</p> <p>TODO: make an extrapolation functionality in this. log10(1.6e1) is low, we can probably go a bit further</p> <p>The default result that is returned when sampling the mass outside @@ -277,9 +304,9 @@ of the mass range is now the last known value</p> </dd></dl> <dl class="py function"> -<dt id="binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_pdf"> -<code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">Moe_de_Stefano_2017_pdf</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#Moe_de_Stefano_2017_pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_pdf" title="Permalink to this definition">¶</a></dt> -<dd><p>Moe & distefano function to calculate the probability density.</p> +<dt id="binarycpython.utils.distribution_functions.Moe_di_Stefano_2017_pdf"> +<code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">Moe_di_Stefano_2017_pdf</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#Moe_di_Stefano_2017_pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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] @@ -297,14 +324,14 @@ mmax => maximum allowed stellar mass (default 80.0)</p> <dt id="binarycpython.utils.distribution_functions.calc_P_integral"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">calc_P_integral</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">min_P</span></em>, <em class="sig-param"><span class="n">integrals_string</span></em>, <em class="sig-param"><span class="n">interpolator_name</span></em>, <em class="sig-param"><span class="n">mass_string</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#calc_P_integral"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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 renormalize this because min_per > 0, and not all periods should be included</p> +<p>We need to renormalise this because min_per > 0, and not all periods should be included</p> </dd></dl> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.calc_e_integral"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">calc_e_integral</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">integrals_string</span></em>, <em class="sig-param"><span class="n">interpolator_name</span></em>, <em class="sig-param"><span class="n">mass_string</span></em>, <em class="sig-param"><span class="n">period_string</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#calc_e_integral"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.calc_e_integral" title="Permalink to this definition">¶</a></dt> <dd><p>Function to calculate the P integral</p> -<p>We need to renormalize this because min_per > 0, and not all periods should be included</p> +<p>We need to renormalise this because min_per > 0, and not all periods should be included</p> </dd></dl> <dl class="py function"> @@ -316,8 +343,8 @@ mmax => maximum allowed stellar mass (default 80.0)</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.calculate_constants_three_part_powerlaw"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">calculate_constants_three_part_powerlaw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">m0</span></em>, <em class="sig-param"><span class="n">m1</span></em>, <em class="sig-param"><span class="n">m2</span></em>, <em class="sig-param"><span class="n">m_max</span></em>, <em class="sig-param"><span class="n">p1</span></em>, <em class="sig-param"><span class="n">p2</span></em>, <em class="sig-param"><span class="n">p3</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#calculate_constants_three_part_powerlaw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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 powerlaw</p> -<p>TODO: use the powerlaw_constant function to calculate all these values</p> +<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"> @@ -368,7 +395,7 @@ mmax => maximum allowed stellar mass (default 80.0)</p> <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 Solarmass year^-1 megaparsec^-3</p> +<dd class="field-even"><p>Cosmic star formation rate in Solar mass year^-1 mega parsec^-3</p> </dd> </dl> </dd></dl> @@ -393,7 +420,7 @@ mmax => maximum allowed stellar mass (default 80.0)</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.fill_data"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">fill_data</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sample_values</span></em>, <em class="sig-param"><span class="n">data_dict</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#fill_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.fill_data" title="Permalink to this definition">¶</a></dt> -<dd><p>Function that returns the normalized array of values for given logmass and logperiod +<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> @@ -440,8 +467,8 @@ used for the e and q values</p> <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>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> @@ -450,7 +477,7 @@ used for the e and q values</p> <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 class="field-odd"><p>‘probability’ of the Gaussian distribution between the boundaries, evaluated at x</p> </dd> </dl> </dd></dl> @@ -458,20 +485,20 @@ used for the e and q values</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.gaussian_func"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">gaussian_func</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span></em>, <em class="sig-param"><span class="n">mean</span></em>, <em class="sig-param"><span class="n">sigma</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#gaussian_func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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> +<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> +<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 class="field-odd"><p>value of the Gaussian at x</p> </dd> </dl> </dd></dl> @@ -479,12 +506,12 @@ used for the e and q values</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.gaussian_normalizing_const"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">gaussian_normalizing_const</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span></em>, <em class="sig-param"><span class="n">sigma</span></em>, <em class="sig-param"><span class="n">gmin</span></em>, <em class="sig-param"><span class="n">gmax</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#gaussian_normalizing_const"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.gaussian_normalizing_const" title="Permalink to this definition">¶</a></dt> -<dd><p>Function to calculate the normalisation constant for the gaussian</p> +<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>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> @@ -493,7 +520,7 @@ used for the e and q values</p> <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 class="field-odd"><p>normalisation constant for the Gaussian distribution(mean, sigma) between gmin and gmax</p> </dd> </dl> </dd></dl> @@ -547,7 +574,7 @@ used for the e and q values</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.imf_scalo1998"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">imf_scalo1998</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">m</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#imf_scalo1998"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.imf_scalo1998" title="Permalink to this definition">¶</a></dt> -<dd><p>From scalo 1998</p> +<dd><p>From Scalo 1998</p> <p>Probability distribution function for Scalo 1998 IMF (defined up until 80Msol): 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> @@ -565,7 +592,7 @@ used for the e and q values</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.imf_tinsley1980"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">imf_tinsley1980</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">m</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#imf_tinsley1980"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.imf_tinsley1980" title="Permalink to this definition">¶</a></dt> -<dd><p>Probability distribution function for tinsley 1980 IMF (defined up until 80Msol): three_part_powerlaw(m, 0.1, 2.0, 10.0, 80.0, -2.0, -2.3, -3.3)</p> +<dd><p>Probability distribution function for Tinsley 1980 IMF (defined up until 80Msol): 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> @@ -647,7 +674,7 @@ low: at 1.15</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.normalize_dict"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">normalize_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">result_dict</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#normalize_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.normalize_dict" title="Permalink to this definition">¶</a></dt> -<dd><p>Function to normalize a dictionary</p> +<dd><p>Function to normalise a dictionary</p> </dd></dl> <dl class="py function"> @@ -670,19 +697,19 @@ low: at 1.15</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.poisson"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">poisson</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lambda_val</span></em>, <em class="sig-param"><span class="n">n</span></em>, <em class="sig-param"><span class="n">nmax</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#poisson"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.poisson" title="Permalink to this definition">¶</a></dt> -<dd><p>Function that calculates the poisson value and normalizes +<dd><p>Function that calculates the Poisson value and normalises TODO: improve the description</p> </dd></dl> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.powerlaw"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">powerlaw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">min_val</span></em>, <em class="sig-param"><span class="n">max_val</span></em>, <em class="sig-param"><span class="n">k</span></em>, <em class="sig-param"><span class="n">x</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#powerlaw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.powerlaw" title="Permalink to this definition">¶</a></dt> -<dd><p>Single powerlaw with index k at x from min to max</p> +<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 powerlaw</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 powerlaw</p></li> +<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> @@ -699,21 +726,21 @@ TODO: improve the description</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.powerlaw_constant"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">powerlaw_constant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">min_val</span></em>, <em class="sig-param"><span class="n">max_val</span></em>, <em class="sig-param"><span class="n">k</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#powerlaw_constant"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.powerlaw_constant" title="Permalink to this definition">¶</a></dt> -<dd><p>Function that returns the constant to normalise a powerlaw</p> +<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>]) – powerlaw slope</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 normalize the given powerlaw between the min_val and max_val range</p> +<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> @@ -721,7 +748,7 @@ TODO: improve the description</p> <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.powerlaw_extrapolation_q"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">powerlaw_extrapolation_q</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">qdata</span></em>, <em class="sig-param"><span class="n">qs</span></em>, <em class="sig-param"><span class="n">indices</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#powerlaw_extrapolation_q"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.powerlaw_extrapolation_q" title="Permalink to this definition">¶</a></dt> -<dd><p>Function to do the powerlaw extrapolation at the lower end of the q range</p> +<dd><p>Function to do the power law extrapolation at the lower end of the q range</p> </dd></dl> <dl class="py function"> @@ -729,11 +756,11 @@ TODO: improve the description</p> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">prepare_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">global_dict</span></em>, <em class="sig-param"><span class="n">list_of_sub_keys</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#prepare_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.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 dont have to be calculated each time.</p> +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>) – globablly acessible dictionary where factors are stored in</p></li> +<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> @@ -789,7 +816,7 @@ and is be given by dp/dlogP ~ (logP)^p for all other binary configurations (defa <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 distributoon</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> @@ -825,7 +852,7 @@ and is be given by dp/dlogP ~ (logP)^p for all other binary configurations (defa <dl class="py function"> <dt id="binarycpython.utils.distribution_functions.three_part_powerlaw"> <code class="sig-prename descclassname">binarycpython.utils.distribution_functions.</code><code class="sig-name descname">three_part_powerlaw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">m</span></em>, <em class="sig-param"><span class="n">m0</span></em>, <em class="sig-param"><span class="n">m1</span></em>, <em class="sig-param"><span class="n">m2</span></em>, <em class="sig-param"><span class="n">m_max</span></em>, <em class="sig-param"><span class="n">p1</span></em>, <em class="sig-param"><span class="n">p2</span></em>, <em class="sig-param"><span class="n">p3</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/distribution_functions.html#three_part_powerlaw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.distribution_functions.three_part_powerlaw" title="Permalink to this definition">¶</a></dt> -<dd><p>Generalized three-part power law, usually used for mass distributions</p> +<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"> @@ -884,9 +911,9 @@ and is be given by dp/dlogP ~ (logP)^p for all other binary configurations (defa provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/examples.html b/docs/build/html/examples.html index 305fa05bec0932483bb154627702bccb92baa35a..75ebcda6be31fb1f52a01d67a40dd189d52a4fc6 100644 --- a/docs/build/html/examples.html +++ b/docs/build/html/examples.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -89,6 +92,7 @@ <li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a><ul> <li class="toctree-l2"><a class="reference internal" href="general_examples.html">Examples</a></li> <li class="toctree-l2"><a class="reference internal" href="population_example.html">Example of population script</a></li> +<li class="toctree-l2"><a class="reference internal" href="notebooks.html">Notebooks</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> @@ -160,7 +164,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="examples"> + +<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="examples"> <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h1> <p>This chapter contains the source code of example scripts which show the way of using certain functions</p> <div class="toctree-wrapper compound"> @@ -201,9 +229,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/functions.html b/docs/build/html/functions.html index 8c75c527e5afa6406ac1779aa1b61fa8d6bc78ce..995bd180d272c39de1f8dfa3f8766d0c828b8835 100644 --- a/docs/build/html/functions.html +++ b/docs/build/html/functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.functions"> + +<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="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 @@ -190,7 +217,7 @@ useful functions for the user</p> <dl class="py method"> <dt id="binarycpython.utils.functions.BinaryCEncoder.default"> <code class="sig-name descname">default</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">o</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#BinaryCEncoder.default"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.functions.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><p>Converting function. Well, could be more precise. look at the JSON module</p> </dd></dl> </dd></dl> @@ -230,12 +257,12 @@ useful functions for the user</p> <dl class="py function"> <dt id="binarycpython.utils.functions.binaryc_json_serializer"> <code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">binaryc_json_serializer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">obj</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#binaryc_json_serializer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.functions.binaryc_json_serializer" title="Permalink to this definition">¶</a></dt> -<dd><p>Custom serializer for binary_c to use when functions are present in the dictionary +<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 serializable</p> +<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> @@ -330,7 +357,7 @@ This string is missing the ‘binary_c ‘ at the start.</p> </ul> </dd> </dl> -<p>TODO: fix missing settingsfiles</p> +<p>TODO: fix missing settings files</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> @@ -363,7 +390,7 @@ detailed. Custom functions can be easier:</p> <p>This function works in two cases: if the caught line contains output like ‘example_header time=12.32 mass=0.94 ..’ or if the line contains output like ‘example_header 12.32 0.94’ -Please dont the two cases.</p> +Please don’t the two cases.</p> <p>You can give a ‘selected_header’ to catch any line that starts with that. Then the values will be put into a dictionary.</p> <dl class="simple"> @@ -403,7 +430,7 @@ process)</p></li> <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 class="field-odd"><p>JSON dictionary with the parsed ENSEMBLE_JSON data</p> </dd> </dl> </dd></dl> @@ -415,7 +442,7 @@ process)</p></li> <p>This function is called by get_defaults()</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> -<dd class="field-odd"><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 keypairs of binary_c</p> +<dd class="field-odd"><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> </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> @@ -500,10 +527,10 @@ valid parameter name</p></li> <dl class="py function"> <dt id="binarycpython.utils.functions.get_help_all"> <code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">get_help_all</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">print_help</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_help_all"><span class="viewcode-link">[source]</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 categorized in sections.</p> +<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> -<dd class="field-odd"><p><strong>print_help</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – (optional, default = Tru) prints all the parameters and their descriptions.</p> +<dd class="field-odd"><p><strong>print_help</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – (optional, default = True) prints all the parameters and their descriptions.</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> @@ -536,9 +563,9 @@ the help function to get as much information as possible.</p> </dd></dl> <dl class="py function"> -<dt id="binarycpython.utils.functions.get_moe_distefano_dataset"> -<code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">get_moe_distefano_dataset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_moe_distefano_dataset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.functions.get_moe_distefano_dataset" title="Permalink to this definition">¶</a></dt> -<dd><p>Function to get the default moe and Distefano dataset or accept a userinput.</p> +<dt id="binarycpython.utils.functions.get_moe_di_stefano_dataset"> +<code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">get_moe_di_stefano_dataset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">verbosity</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#get_moe_di_stefano_dataset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.functions.get_moe_di_stefano_dataset" title="Permalink to this definition">¶</a></dt> +<dd><p>Function to get the default moe and di Stefano dataset or accept a user input.</p> </dd></dl> <dl class="py function"> @@ -606,7 +633,7 @@ it will return the type of what the value would be in the input_dict</p> <dl class="py function"> <dt id="binarycpython.utils.functions.load_logfile"> <code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">load_logfile</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">logfile</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#load_logfile"><span class="viewcode-link">[source]</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 logfile of binary_c.</p> +<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"> <dt>Tasks:</dt><dd><ul class="simple"> @@ -616,7 +643,7 @@ it will return the type of what the value would be in the input_dict</p> </dl> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> -<dd class="field-odd"><p><strong>logfile</strong> (<em>-</em>) – filename of the logfile you want to parse</p> +<dd class="field-odd"><p><strong>logfile</strong> (<em>-</em>) – filename of the log file you want to parse</p> </dd> </dl> <p>Returns:</p> @@ -685,7 +712,7 @@ it will return the type of what the value would be in the input_dict</p> <dl class="py function"> <dt id="binarycpython.utils.functions.output_lines"> <code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">output_lines</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">output</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#output_lines"><span class="viewcode-link">[source]</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 recieved from the binary_c run, but now as an iterator.</p> +<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> <dd class="field-odd"><p><strong>output</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – raw binary_c output</p> @@ -738,7 +765,7 @@ Does not work with lists as values</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> -<li><p><strong>file</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – full filepath to the file that will be removed.</p></li> +<li><p><strong>file</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – full file path to the file that will be removed.</p></li> <li><p><strong>verbosity</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – current verbosity level (Optional)</p></li> </ul> </dd> @@ -746,7 +773,7 @@ Does not work with lists as values</p> <dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p> </dd> <dt class="field-odd">Returns</dt> -<dd class="field-odd"><p>the path of a subdirectory called binary_c_python in the TMP of the filesystem</p> +<dd class="field-odd"><p>the path of a sub directory called binary_c_python in the TMP of the file system</p> </dd> </dl> </dd></dl> @@ -782,7 +809,7 @@ dictionary</p> <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"> +<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> @@ -819,7 +846,7 @@ If that results in an empty dict, the dict will be removed too.</p> <dl class="py function"> <dt id="binarycpython.utils.functions.temp_dir"> <code class="sig-prename descclassname">binarycpython.utils.functions.</code><code class="sig-name descname">temp_dir</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/functions.html#temp_dir"><span class="viewcode-link">[source]</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 filesystem</p> +<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"> <dt class="field-odd">Parameters</dt> @@ -829,7 +856,7 @@ If that results in an empty dict, the dict will be removed too.</p> <dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></p> </dd> <dt class="field-odd">Returns</dt> -<dd class="field-odd"><p>the path of a subdirectory called binary_c_python in the TMP of the filesystem</p> +<dd class="field-odd"><p>the path of a sub directory called binary_c_python in the TMP of the file system</p> </dd> </dl> </dd></dl> @@ -903,7 +930,7 @@ Writes the results to a .rst file that can be included in the docs.</p> </dl> <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>) – name of the output .rst faile containing the ReStructuredText formatted output +<dd class="field-odd"><p><strong>output_file</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – name of the output .rst file containing the ReStructuredText formatted output of all the binary_c parameters.</p> </dd> <dt class="field-even">Return type</dt> @@ -948,9 +975,9 @@ of all the binary_c parameters.</p> provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/general_examples.html b/docs/build/html/general_examples.html index d6937f484e5d5ca8e9eba24caaf0c6049461155d..c574cef1cc47975a591b8afcf5bad6935cbda0e2 100644 --- a/docs/build/html/general_examples.html +++ b/docs/build/html/general_examples.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -89,6 +92,7 @@ <li class="toctree-l1 current"><a class="reference internal" href="examples.html">Examples</a><ul class="current"> <li class="toctree-l2 current"><a class="current reference internal" href="#">Examples</a></li> <li class="toctree-l2"><a class="reference internal" href="population_example.html">Example of population script</a></li> +<li class="toctree-l2"><a class="reference internal" href="notebooks.html">Notebooks</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> @@ -162,7 +166,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="examples"> + +<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="examples"> <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h1> <p>The source code of the general examples.</p> <div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1 @@ -660,9 +688,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 1a2f3c368278e4a138d560247dea2634ec62f7e4..8c67f1634361d3885f3de3a64dd9e1fb37da5b2b 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -443,7 +446,7 @@ </li> <li><a href="distribution_functions.html#binarycpython.utils.distribution_functions.get_max_multiplicity">get_max_multiplicity() (in module binarycpython.utils.distribution_functions)</a> </li> - <li><a href="functions.html#binarycpython.utils.functions.get_moe_distefano_dataset">get_moe_distefano_dataset() (in module binarycpython.utils.functions)</a> + <li><a href="functions.html#binarycpython.utils.functions.get_moe_di_stefano_dataset">get_moe_di_stefano_dataset() (in module binarycpython.utils.functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.get_size">get_size() (in module binarycpython.utils.functions)</a> </li> @@ -560,11 +563,11 @@ </ul></li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="grid.html#binarycpython.utils.grid.Population.Moe_de_Stefano_2017">Moe_de_Stefano_2017() (binarycpython.utils.grid.Population method)</a> + <li><a href="grid.html#binarycpython.utils.grid.Population.Moe_di_Stefano_2017">Moe_di_Stefano_2017() (binarycpython.utils.grid.Population method)</a> </li> - <li><a href="distribution_functions.html#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_multiplicity_fractions">Moe_de_Stefano_2017_multiplicity_fractions() (in module binarycpython.utils.distribution_functions)</a> + <li><a href="distribution_functions.html#binarycpython.utils.distribution_functions.Moe_di_Stefano_2017_multiplicity_fractions">Moe_di_Stefano_2017_multiplicity_fractions() (in module binarycpython.utils.distribution_functions)</a> </li> - <li><a href="distribution_functions.html#binarycpython.utils.distribution_functions.Moe_de_Stefano_2017_pdf">Moe_de_Stefano_2017_pdf() (in module binarycpython.utils.distribution_functions)</a> + <li><a href="distribution_functions.html#binarycpython.utils.distribution_functions.Moe_di_Stefano_2017_pdf">Moe_di_Stefano_2017_pdf() (in module binarycpython.utils.distribution_functions)</a> </li> <li><a href="functions.html#binarycpython.utils.functions.multiply_values_dict">multiply_values_dict() (in module binarycpython.utils.functions)</a> </li> @@ -670,7 +673,7 @@ </li> <li><a href="grid.html#binarycpython.utils.grid.Population.set">set() (binarycpython.utils.grid.Population method)</a> </li> - <li><a href="grid.html#binarycpython.utils.grid.Population.set_moe_distefano_settings">set_moe_distefano_settings() (binarycpython.utils.grid.Population method)</a> + <li><a href="grid.html#binarycpython.utils.grid.Population.set_moe_di_stefano_settings">set_moe_di_stefano_settings() (binarycpython.utils.grid.Population method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> @@ -759,9 +762,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/grid.html b/docs/build/html/grid.html index c894bac07a591f9319773aed58619f9a06e31f30..e1256802594797c82ac9256a31b0d5fadcd22702 100644 --- a/docs/build/html/grid.html +++ b/docs/build/html/grid.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.grid"> + +<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="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> @@ -204,11 +231,11 @@ but copying functionality isn’t recommended except if you know what you are do <p>Population Object. Contains all the necessary functions to set up, run and process a population of systems</p> <dl class="py method"> -<dt id="binarycpython.utils.grid.Population.Moe_de_Stefano_2017"> -<code class="sig-name descname">Moe_de_Stefano_2017</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.Moe_de_Stefano_2017"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.Moe_de_Stefano_2017" title="Permalink to this definition">¶</a></dt> +<dt id="binarycpython.utils.grid.Population.Moe_di_Stefano_2017"> +<code class="sig-name descname">Moe_di_Stefano_2017</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.Moe_di_Stefano_2017"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.Moe_di_Stefano_2017" title="Permalink to this definition">¶</a></dt> <dd><p>Function to handle setting the user input settings, set up the data and load that into interpolators and -and then set the distribution functions</p> +then set the distribution functions</p> <p>Takes a dictionary as its only argument</p> </dd></dl> @@ -216,7 +243,7 @@ and then set the distribution functions</p> <dt id="binarycpython.utils.grid.Population.add_grid_variable"> <code class="sig-name descname">add_grid_variable</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">longname</span></em>, <em class="sig-param"><span class="n">valuerange</span></em>, <em class="sig-param"><span class="n">resolution</span></em>, <em class="sig-param"><span class="n">spacingfunc</span></em>, <em class="sig-param"><span class="n">probdist</span></em>, <em class="sig-param"><span class="n">dphasevol</span></em>, <em class="sig-param"><span class="n">parameter_name</span></em>, <em class="sig-param"><span class="n">gridtype</span><span class="o">=</span><span class="default_value">'edge'</span></em>, <em class="sig-param"><span class="n">branchpoint</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">precode</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">condition</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.add_grid_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.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 forloop. +<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. @@ -261,7 +288,7 @@ sampling function (i.e. a value for lnm1 is chosen already)</p> <p class="rubric">Examples</p> <p>precode = ‘M_1=math.exp(lnm1);’</p> </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 asigned to the sampled parameter</p> +<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> @@ -288,12 +315,12 @@ the lower edge of the value range) or ‘center’ <dl class="py method"> <dt id="binarycpython.utils.grid.Population.evolve"> <code class="sig-name descname">evolve</code><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">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.evolve" title="Permalink to this definition">¶</a></dt> -<dd><p>Entrypoint function of the whole object. From here, based on the settings, +<dd><p>Entry point function of the whole object. From here, based on the settings, we set up a SLURM or CONDOR grid, or if no setting is given we go straight to evolving the population</p> <dl class="simple"> -<dt>There are no direct arguments to this function, rather it is based on the grid_options settings:</dt><dd><p>grid_options[‘slurm’]: integer boolean whether to use a slurm_grid evolution -grid_options[‘condor’]: integer boolean whether to use a condor_grid evolution</p> +<dt>There are no direct arguments to this function, rather it is based on the grid_options settings:</dt><dd><p>grid_options[‘slurm’]: integer Boolean whether to use a slurm_grid evolution +grid_options[‘condor’]: integer Boolean whether to use a condor_grid evolution</p> </dd> </dl> <p>If neither of the above is set, we continue without using HPC routines @@ -344,17 +371,17 @@ NOT IMPLEMENTED YET to evolve a population via a variable grid, a source file or <dl class="py method"> <dt id="binarycpython.utils.grid.Population.export_all_info"> <code class="sig-name descname">export_all_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">use_datadir</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">outfile</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">include_population_settings</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">include_binary_c_defaults</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">include_binary_c_version_info</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">include_binary_c_help_all</span><span class="o">=</span><span class="default_value">True</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">[source]</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> +<dd><p>Function that exports the all_info to a JSON file</p> <dl class="simple"> <dt>Tasks:</dt><dd><ul class="simple"> <li><dl class="simple"> -<dt>TODO: if any of the values in the dicts here is of a not-serializable form, then we</dt><dd><p>need to change that to a string or something so, use a recursive function that +<dt>TODO: if any of the values in the dicts here is of a not-serialisable form, then we</dt><dd><p>need to change that to a string or something so, use a recursive function that goes over the all_info dict and finds those that fit</p> </dd> </dl> </li> <li><p>TODO: Fix to write things to the directory. which options do which etc</p></li> -<li><p>TODO: theres flawed logic here. rewrite this part pls</p></li> +<li><p>TODO: there’s flawed logic here. rewrite this part pls</p></li> <li><dl class="simple"> <dt>TODO: consider actually just removing the whole ‘output to file’ part and let the</dt><dd><p>user do this.</p> </dd> @@ -374,7 +401,7 @@ and their default values</p></li> version info (see return_binary_c_version_info)</p></li> <li><p><strong>include_binary_c_help_all</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – whether to include a dict containing all the information about the binary_c parameters (see get_help_all)</p></li> -<li><p><strong>use_datadir</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – boolean whether to use the custom_options[‘data_dir’] to write the file to. +<li><p><strong>use_datadir</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – Boolean whether to use the custom_options[‘data_dir’] to write the file to. If the custom_options[“base_filenameâ€] is set, the output file will be called <custom_options[“base_filenameâ€]>_settings.json. Otherwise a file called simulation_<date+time>_settings.json will be created</p></li> @@ -406,7 +433,7 @@ simulation_<date+time>_settings.json will be created</p></li> <dl class="py method"> <dt id="binarycpython.utils.grid.Population.last_grid_variable"> <code class="sig-name descname">last_grid_variable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.last_grid_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.last_grid_variable" title="Permalink to this definition">¶</a></dt> -<dd><p>Functon that returns the last grid variable +<dd><p>Function that returns the last grid variable (i.e. the one with the highest grid_variable_number)</p> </dd></dl> @@ -463,7 +490,7 @@ the binary_c parameters (see get_help_all)</p></li> <dt id="binarycpython.utils.grid.Population.return_population_settings"> <code class="sig-name descname">return_population_settings</code><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">[source]</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> +<p>Can be combined with JSON to make a nice file.</p> <dl class="field-list simple"> <dt class="field-odd">Return type</dt> <dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></p> @@ -498,9 +525,9 @@ in the self.grid_options</p> </dd></dl> <dl class="py method"> -<dt id="binarycpython.utils.grid.Population.set_moe_distefano_settings"> -<code class="sig-name descname">set_moe_distefano_settings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.set_moe_distefano_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.set_moe_distefano_settings" title="Permalink to this definition">¶</a></dt> -<dd><p>Function to set user input configurations for the moe & distefano methods</p> +<dt id="binarycpython.utils.grid.Population.set_moe_di_stefano_settings"> +<code class="sig-name descname">set_moe_di_stefano_settings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.set_moe_di_stefano_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.set_moe_di_stefano_settings" title="Permalink to this definition">¶</a></dt> +<dd><p>Function to set user input configurations for the moe & di Stefano methods</p> <p>If nothing is passed then we just use the default options</p> </dd></dl> @@ -515,13 +542,12 @@ Will have to play with the size of this.</p> <dl class="py method"> <dt id="binarycpython.utils.grid.Population.write_binary_c_calls_to_file"> <code class="sig-name descname">write_binary_c_calls_to_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">output_dir</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">output_filename</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">include_defaults</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid.html#Population.write_binary_c_calls_to_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.grid.Population.write_binary_c_calls_to_file" title="Permalink to this definition">¶</a></dt> -<dd><p>Function that loops over the gridcode and writes the generated parameters to a file. -In the form of a commandline call</p> -<p>Only useful when you have a variable grid as system_generator. MC wouldnt be that useful</p> +<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> -<p>WARNING; dont use yet. not fully tested.</p> <dl class="simple"> <dt>Tasks:</dt><dd><ul class="simple"> <li><p>TODO: test this function</p></li> @@ -534,7 +560,7 @@ like m1,m2,sep, orb-per, ecc, probability etc.</p> <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 seperate file.</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">Return type</dt> @@ -581,9 +607,9 @@ like m1,m2,sep, orb-per, ecc, probability etc.</p> provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/grid_options_defaults.html b/docs/build/html/grid_options_defaults.html index b4e515035f2461c8c183a046a0648126f8502234..fe3ca3872288f2e091c2adbbbb7b1606ae026ef9 100644 --- a/docs/build/html/grid_options_defaults.html +++ b/docs/build/html/grid_options_defaults.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.grid_options_defaults"> + +<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="module-binarycpython.utils.grid_options_defaults"> <span id="grid-options-and-descriptions"></span><h1>Grid options and descriptions<a class="headerlink" href="#module-binarycpython.utils.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"> @@ -217,7 +244,7 @@ <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 containg the option, the description if its there, otherwise empty string. And if the key doesnt exist, the dict is empty</p> +<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> @@ -232,7 +259,7 @@ <code class="sig-prename descclassname">binarycpython.utils.grid_options_defaults.</code><code class="sig-name descname">write_grid_options_to_rst_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">output_file</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/binarycpython/utils/grid_options_defaults.html#write_grid_options_to_rst_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#binarycpython.utils.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 a rst file</p> <dl class="simple"> -<dt>Tasks:</dt><dd><p>TODO: seperate things into private and public options</p> +<dt>Tasks:</dt><dd><p>TODO: separate things into private and public options</p> </dd> </dl> <dl class="field-list simple"> @@ -281,9 +308,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/grid_options_descriptions.html b/docs/build/html/grid_options_descriptions.html index ea8f9712755293c3950581d36e31bd6f885ac1a6..ec8a52d1b57e1156ab956c170a4b21fbbcc15457 100644 --- a/docs/build/html/grid_options_descriptions.html +++ b/docs/build/html/grid_options_descriptions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -89,7 +92,7 @@ <li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> <li class="toctree-l1 current"><a class="current reference internal" href="#">Population grid code options</a><ul> <li class="toctree-l2"><a class="reference internal" href="#public-options">Public options</a></li> -<li class="toctree-l2"><a class="reference internal" href="#moe-distefano-sampler-options">Moe & Distefano sampler options</a></li> +<li class="toctree-l2"><a class="reference internal" href="#moe-di-stefano-sampler-options">Moe & di Stefano sampler options</a></li> <li class="toctree-l2"><a class="reference internal" href="#private-options">Private options</a></li> </ul> </li> @@ -160,7 +163,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="population-grid-code-options"> + +<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="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 1 options that are not described yet.</p> @@ -174,16 +201,19 @@ There are 1 options that are not described yet.</p> <div class="line"><strong>C_logging_code</strong>: 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.</div> </div> <div class="line-block"> -<div class="line"><strong>amt_cores</strong>: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multiprocessed, not multithreaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int</div> +<div class="line"><strong>amt_cores</strong>: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multi processed, not multi threaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int</div> </div> <div class="line-block"> -<div class="line"><strong>combine_ensemble_with_thread_joining</strong>: BOolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{popuation_id}_{thread_id}.json</div> +<div class="line"><strong>combine_ensemble_with_thread_joining</strong>: Boolean 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</div> </div> <div class="line-block"> <div class="line"><strong>condor</strong>: Int flag whether to use a condor type population evolution. Not implemented yet.</div> </div> <div class="line-block"> -<div class="line"><strong>custom_logging_func_memaddr</strong>: Memory adress where the custom_logging_function is stored. Input: int</div> +<div class="line"><strong>custom_logging_func_memaddr</strong>: Memory address where the custom_logging_function is stored. Input: int</div> +</div> +<div class="line-block"> +<div class="line"><strong>do_dry_run</strong>: Whether to do a dry run to calculate the total probability for this run</div> </div> <div class="line-block"> <div class="line"><strong>ensemble_factor_in_probability_weighted_mass</strong>: Flag to multiply all the ensemble results with 1/probability_weighted_mass</div> @@ -192,7 +222,7 @@ There are 1 options that are not described yet.</p> <div class="line"><strong>evolution_type</strong>: Variable containing the type of evolution used of the grid. Multiprocessing or linear processing</div> </div> <div class="line-block"> -<div class="line"><strong>failed_systems_threshold</strong>: Variable storing the maximum amount of systems that are allowed to fail before logging their commandline arguments to failed_systems log files</div> +<div class="line"><strong>failed_systems_threshold</strong>: Variable storing the maximum amount of systems that are allowed to fail before logging their command line arguments to failed_systems log files</div> </div> <div class="line-block"> <div class="line"><strong>gridcode_filename</strong>: 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.</div> @@ -207,7 +237,7 @@ There are 1 options that are not described yet.</p> <div class="line"><strong>log_file</strong>: Log file for the population object. Unused</div> </div> <div class="line-block"> -<div class="line"><strong>log_runtime_systems</strong>: 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 alot 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</div> +<div class="line"><strong>log_runtime_systems</strong>: 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</div> </div> <div class="line-block"> <div class="line"><strong>m&s_options</strong>: Internal variable that holds the M&S options. Don’t write to this your self</div> @@ -228,13 +258,13 @@ There are 1 options that are not described yet.</p> <div class="line"><strong>repeat</strong>: Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating.</div> </div> <div class="line-block"> -<div class="line"><strong>run_zero_probability_system</strong>: Whether to run the zero probability systems. Default: True. Input: boolean</div> +<div class="line"><strong>run_zero_probability_system</strong>: Whether to run the zero probability systems. Default: True. Input: Boolean</div> </div> <div class="line-block"> -<div class="line"><strong>slurm</strong>: Int flag whether to use a slurm type population evolution.</div> +<div class="line"><strong>slurm</strong>: Int flag whether to use a Slurm type population evolution.</div> </div> <div class="line-block"> -<div class="line"><strong>source_file_filename</strong>: Variable containing the source file containing lines of binary_c commandline calls. These all have to start with binary_c.</div> +<div class="line"><strong>source_file_filename</strong>: Variable containing the source file containing lines of binary_c command line calls. These all have to start with binary_c.</div> </div> <div class="line-block"> <div class="line"><strong>tmp_dir</strong>: 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</div> @@ -243,11 +273,11 @@ There are 1 options that are not described yet.</p> <div class="line"><strong>verbosity</strong>: 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.</div> </div> <div class="line-block"> -<div class="line"><strong>weight</strong>: Weight factor for each system. The calculated probability is mulitplied 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.</div> +<div class="line"><strong>weight</strong>: 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.</div> </div> </div> -<div class="section" id="moe-distefano-sampler-options"> -<h2>Moe & Distefano sampler options<a class="headerlink" href="#moe-distefano-sampler-options" title="Permalink to this headline">¶</a></h2> +<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> <p>The following options are meant to be changed by the user.</p> <div class="line-block"> <div class="line"><strong>Mmin</strong>: Minimum stellar mass</div> @@ -257,7 +287,7 @@ There are 1 options that are not described yet.</p> multiplicity model (as a function of log10M1)</div> </div> <blockquote> -<div><p>You can use ‘Poisson’ which uses the system multiplicty +<div><p>You can use ‘Poisson’ which uses the system multiplicity given by Moe and maps this to single/binary/triple/quad fractions.</p> <p>Alternatively, ‘data’ takes the fractions directly @@ -277,13 +307,13 @@ combined (and there are NO quadruples).</p> </div></blockquote> <div class="line-block"> <div class="line"><strong>normalize_multiplicities</strong>: -‘norm’: normalize so the whole population is 1.0 +‘norm’: normalise so the whole population is 1.0 after implementing the appropriate fractions S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) - given a mix of multiplities, you can either (noting that + given a mix of multiplicities, you can either (noting that here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) ) note: if you only set one multiplicity_modulator - to 1, and all the others to 0, then normalizing + to 1, and all the others to 0, then normalising will mean that you effectively have the same number of stars as single, binary, triple or quad (whichever is non-zero) i.e. the multiplicity fraction is ignored. @@ -293,7 +323,7 @@ combined (and there are NO quadruples).</p> <blockquote> <div><dl> <dt>‘raw’<span class="classifier">stick to what is predicted, i.e.</span></dt><dd><p>S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) -without normalization +without normalisation (in which case the total probability < 1.0 unless all you use single, binary, triple and quadruple)</p> </dd> @@ -358,10 +388,10 @@ q extrapolation (below 0.15) method <div class="line"><strong>_end_time_evolution</strong>: Variable storing the end timestamp of the population evolution. Set by the object itself</div> </div> <div class="line-block"> -<div class="line"><strong>_errors_exceeded</strong>: Variable storing a boolean flag whether the amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the commandline arguments of the failing systems will not be stored in the failed_system_log files.</div> +<div class="line"><strong>_errors_exceeded</strong>: Variable storing a Boolean flag whether the amount 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.</div> </div> <div class="line-block"> -<div class="line"><strong>_errors_found</strong>: Variable storing a boolean flag whether errors by binary_c are encountered.</div> +<div class="line"><strong>_errors_found</strong>: Variable storing a Boolean flag whether errors by binary_c are encountered.</div> </div> <div class="line-block"> <div class="line"><strong>_evolution_type_options</strong>: List containing the evolution type options.</div> @@ -397,10 +427,10 @@ q extrapolation (below 0.15) method <div class="line"><strong>_start_time_evolution</strong>: Variable storing the start timestamp of the population evolution. Set by the object itself.</div> </div> <div class="line-block"> -<div class="line"><strong>_store_memaddr</strong>: Memory adress of the store object for binary_c.</div> +<div class="line"><strong>_store_memaddr</strong>: Memory address of the store object for binary_c.</div> </div> <div class="line-block"> -<div class="line"><strong>_system_generator</strong>: Function object that contains the system generator function. This can be from a grid, or a source file, or a montecarlo grid.</div> +<div class="line"><strong>_system_generator</strong>: Function object that contains the system generator function. This can be from a grid, or a source file, or a Monte Carlo grid.</div> </div> <div class="line-block"> <div class="line"><strong>_total_mass_run</strong>: To count the total mass that thread/process has ran</div> @@ -449,9 +479,9 @@ q extrapolation (below 0.15) method provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/hpc_functions.html b/docs/build/html/hpc_functions.html index abc4fe870430b2038715a873b93e7684901b0107..b615bb2a71ae2d5bfec9d4730af13be485c03f98 100644 --- a/docs/build/html/hpc_functions.html +++ b/docs/build/html/hpc_functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,10 +174,34 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.hpc_functions"> + +<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="module-binarycpython.utils.hpc_functions"> <span id="hpc-functions-module"></span><h1>hpc_functions module<a class="headerlink" href="#module-binarycpython.utils.hpc_functions" title="Permalink to this headline">¶</a></h1> <p>File containing functions for HPC computing, distributed tasks on clusters etc.</p> -<p>Functions that the slurm and condor subroutines of the population object use.</p> +<p>Functions that the Slurm and Condor subroutines of the population object use.</p> <p>Mainly divided in 2 sections: Slurm and Condor</p> </div> @@ -212,9 +239,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 43b32b8fef3b5c77e0c831bce6a8197b64a99a24..07a6be2bccf170df6fbb6dccd451cc5baa7126fe 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -155,7 +158,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="welcome-to-binary-c-python-s-documentation"> + +<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="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"> @@ -297,7 +324,7 @@ </li> <li class="toctree-l1"><a class="reference internal" href="grid_options_descriptions.html">Population grid code options</a><ul> <li class="toctree-l2"><a class="reference internal" href="grid_options_descriptions.html#public-options">Public options</a></li> -<li class="toctree-l2"><a class="reference internal" href="grid_options_descriptions.html#moe-distefano-sampler-options">Moe & Distefano sampler options</a></li> +<li class="toctree-l2"><a class="reference internal" href="grid_options_descriptions.html#moe-di-stefano-sampler-options">Moe & di Stefano sampler options</a></li> <li class="toctree-l2"><a class="reference internal" href="grid_options_descriptions.html#private-options">Private options</a></li> </ul> </li> @@ -348,9 +375,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/modules.html b/docs/build/html/modules.html index 17ba62ad59eafe2f147c730b1634f684b3d2c769..af71bd8bcce0ce404fb33faeecabe85baa47acd1 100644 --- a/docs/build/html/modules.html +++ b/docs/build/html/modules.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -169,7 +172,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="binarycpython-code"> + +<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="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"> @@ -223,9 +250,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/notebook_population.html b/docs/build/html/notebook_population.html new file mode 100644 index 0000000000000000000000000000000000000000..ff600f916c7761075de17d326c86358f5ad66cb5 --- /dev/null +++ b/docs/build/html/notebook_population.html @@ -0,0 +1,790 @@ + + +<!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>Title page — binary_c-python documentation</title> + + + + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + + + + + + + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> + + + <script type="text/javascript" id="documentation_options" data-url_root="./" 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 src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> + + <script type="text/javascript" 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="Notebooks" href="notebooks.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" alt="Documentation 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"><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"><a class="reference internal" href="modules.html">Binarycpython code</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="examples.html">Examples</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="general_examples.html">Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_example.html">Example of population script</a></li> +<li class="toctree-l2 current"><a class="reference internal" href="notebooks.html">Notebooks</a><ul class="current"> +<li class="toctree-l3 current"><a class="current reference internal" href="#">Title page</a></li> +</ul> +</li> +</ul> +</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" class="icon icon-home"></a> »</li> + + <li><a href="examples.html">Examples</a> »</li> + + <li><a href="notebooks.html">Notebooks</a> »</li> + + <li>Title page</li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="_sources/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 */ + +/* remove conflicting styling from Sphinx themes */ +div.nbinput.container div.prompt *, +div.nboutput.container div.prompt *, +div.nbinput.container div.input_area pre, +div.nboutput.container div.output_area pre, +div.nbinput.container div.input_area .highlight, +div.nboutput.container div.output_area .highlight { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +div.nbinput.container > div[class*=highlight], +div.nboutput.container > div[class*=highlight] { + margin: 0; +} + +div.nbinput.container div.prompt *, +div.nboutput.container div.prompt * { + background: none; +} + +div.nboutput.container div.output_area .highlight, +div.nboutput.container div.output_area pre { + background: unset; +} + +div.nboutput.container div.output_area div.highlight { + color: unset; /* override Pygments text color */ +} + +/* avoid gaps between output lines */ +div.nboutput.container div[class*=highlight] pre { + line-height: normal; +} + +/* input/output containers */ +div.nbinput.container, +div.nboutput.container { + display: -webkit-flex; + display: flex; + align-items: flex-start; + margin: 0; + width: 100%; +} +@media (max-width: 540px) { + div.nbinput.container, + div.nboutput.container { + flex-direction: column; + } +} + +/* input container */ +div.nbinput.container { + padding-top: 5px; +} + +/* last container */ +div.nblast.container { + padding-bottom: 5px; +} + +/* input prompt */ +div.nbinput.container div.prompt pre { + color: #307FC1; +} + +/* output prompt */ +div.nboutput.container div.prompt pre { + color: #BF5B3D; +} + +/* all prompts */ +div.nbinput.container div.prompt, +div.nboutput.container div.prompt { + width: 4.5ex; + padding-top: 5px; + position: relative; + user-select: none; +} + +div.nbinput.container div.prompt > div, +div.nboutput.container div.prompt > div { + position: absolute; + right: 0; + margin-right: 0.3ex; +} + +@media (max-width: 540px) { + div.nbinput.container div.prompt, + div.nboutput.container div.prompt { + width: unset; + text-align: left; + padding: 0.4em; + } + div.nboutput.container div.prompt.empty { + padding: 0; + } + + div.nbinput.container div.prompt > div, + div.nboutput.container div.prompt > div { + position: unset; + } +} + +/* disable scrollbars on prompts */ +div.nbinput.container div.prompt pre, +div.nboutput.container div.prompt pre { + overflow: hidden; +} + +/* input/output area */ +div.nbinput.container div.input_area, +div.nboutput.container div.output_area { + -webkit-flex: 1; + flex: 1; + overflow: auto; +} +@media (max-width: 540px) { + div.nbinput.container div.input_area, + div.nboutput.container div.output_area { + width: 100%; + } +} + +/* input area */ +div.nbinput.container div.input_area { + border: 1px solid #e0e0e0; + border-radius: 2px; + /*background: #f5f5f5;*/ +} + +/* override MathJax center alignment in output cells */ +div.nboutput.container div[class*=MathJax] { + text-align: left !important; +} + +/* override sphinx.ext.imgmath center alignment in output cells */ +div.nboutput.container div.math p { + text-align: left; +} + +/* standard error */ +div.nboutput.container div.output_area.stderr { + background: #fdd; +} + +/* ANSI colors */ +.ansi-black-fg { color: #3E424D; } +.ansi-black-bg { background-color: #3E424D; } +.ansi-black-intense-fg { color: #282C36; } +.ansi-black-intense-bg { background-color: #282C36; } +.ansi-red-fg { color: #E75C58; } +.ansi-red-bg { background-color: #E75C58; } +.ansi-red-intense-fg { color: #B22B31; } +.ansi-red-intense-bg { background-color: #B22B31; } +.ansi-green-fg { color: #00A250; } +.ansi-green-bg { background-color: #00A250; } +.ansi-green-intense-fg { color: #007427; } +.ansi-green-intense-bg { background-color: #007427; } +.ansi-yellow-fg { color: #DDB62B; } +.ansi-yellow-bg { background-color: #DDB62B; } +.ansi-yellow-intense-fg { color: #B27D12; } +.ansi-yellow-intense-bg { background-color: #B27D12; } +.ansi-blue-fg { color: #208FFB; } +.ansi-blue-bg { background-color: #208FFB; } +.ansi-blue-intense-fg { color: #0065CA; } +.ansi-blue-intense-bg { background-color: #0065CA; } +.ansi-magenta-fg { color: #D160C4; } +.ansi-magenta-bg { background-color: #D160C4; } +.ansi-magenta-intense-fg { color: #A03196; } +.ansi-magenta-intense-bg { background-color: #A03196; } +.ansi-cyan-fg { color: #60C6C8; } +.ansi-cyan-bg { background-color: #60C6C8; } +.ansi-cyan-intense-fg { color: #258F8F; } +.ansi-cyan-intense-bg { background-color: #258F8F; } +.ansi-white-fg { color: #C5C1B4; } +.ansi-white-bg { background-color: #C5C1B4; } +.ansi-white-intense-fg { color: #A1A6B2; } +.ansi-white-intense-bg { background-color: #A1A6B2; } + +.ansi-default-inverse-fg { color: #FFFFFF; } +.ansi-default-inverse-bg { background-color: #000000; } + +.ansi-bold { font-weight: bold; } +.ansi-underline { text-decoration: underline; } + + +div.nbinput.container div.input_area div[class*=highlight] > pre, +div.nboutput.container div.output_area div[class*=highlight] > pre, +div.nboutput.container div.output_area div[class*=highlight].math, +div.nboutput.container div.output_area.rendered_html, +div.nboutput.container div.output_area > div.output_javascript, +div.nboutput.container div.output_area:not(.rendered_html) > img{ + padding: 5px; + margin: 0; +} + +/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */ +div.nbinput.container div.input_area > div[class^='highlight'], +div.nboutput.container div.output_area > div[class^='highlight']{ + overflow-y: hidden; +} + +/* hide copybtn icon on prompts (needed for 'sphinx_copybutton') */ +.prompt a.copybtn { + display: none; +} + +/* Some additional styling taken form the Jupyter notebook CSS */ +div.rendered_html table { + border: none; + border-collapse: collapse; + border-spacing: 0; + color: black; + font-size: 12px; + table-layout: fixed; +} +div.rendered_html thead { + border-bottom: 1px solid black; + vertical-align: bottom; +} +div.rendered_html tr, +div.rendered_html th, +div.rendered_html td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +div.rendered_html th { + font-weight: bold; +} +div.rendered_html tbody tr:nth-child(odd) { + background: #f5f5f5; +} +div.rendered_html tbody tr:hover { + background: rgba(66, 165, 245, 0.2); +} + +/* 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="Title-page"> +<h1>Title page<a class="headerlink" href="#Title-page" title="Permalink to this headline">¶</a></h1> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="kn">import</span> <span class="nn">os</span> +<span class="kn">from</span> <span class="nn">binarycpython.utils.grid</span> <span class="kn">import</span> <span class="n">Population</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">get_help_all</span><span class="p">,</span> + <span class="n">get_help</span><span class="p">,</span> + <span class="n">create_hdf5</span><span class="p">,</span> + <span class="n">output_lines</span><span class="p">,</span> +<span class="p">)</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> + +</pre></div> +</div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="c1">#########################################################</span> +<span class="c1"># This file serves as an example for running a population.</span> +<span class="c1"># The use of help(<function>) is a good way to inspect what parameters are there to use</span> +<span class="c1">#########################################################</span> + +<span class="c1"># Create population object</span> +<span class="n">example_pop</span> <span class="o">=</span> <span class="n">Population</span><span class="p">()</span> + +<span class="c1"># If you want verbosity, set this before other things</span> +<span class="n">example_pop</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">verbose</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> + +<span class="c1"># Setting values can be done via .set(<parameter_name>=<value>)</span> +<span class="c1"># Values that are known to be binary_c_parameters are loaded into bse_options.</span> +<span class="c1"># Those that are present in the default grid_options are set in grid_options</span> +<span class="c1"># All other values that you set are put in a custom_options dict</span> +<span class="n">example_pop</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> + <span class="c1"># binary_c physics options</span> + <span class="n">M_1</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="c1"># bse_options</span> + <span class="n">separation</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="c1"># bse_options</span> + <span class="n">orbital_period</span><span class="o">=</span><span class="mi">45000000080</span><span class="p">,</span> <span class="c1"># bse_options</span> + <span class="n">max_evolution_time</span><span class="o">=</span><span class="mi">15000</span><span class="p">,</span> <span class="c1"># bse_options</span> + <span class="n">eccentricity</span><span class="o">=</span><span class="mf">0.02</span><span class="p">,</span> <span class="c1"># bse_options</span> + <span class="c1"># Set companion to low mass</span> + <span class="n">M_2</span><span class="o">=</span><span class="mf">0.08</span><span class="p">,</span> <span class="c1"># Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.</span> + <span class="c1"># grid_options</span> + <span class="n">amt_cores</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="c1"># grid_options</span> + <span class="n">verbose</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="c1"># verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff</span> + <span class="c1"># Custom options # TODO: need to be set in grid_options probably</span> + <span class="n">data_dir</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">temp_dir</span><span class="p">(),</span> <span class="s2">"example_python_population_result"</span> + <span class="p">),</span> <span class="c1"># custom_options</span> + <span class="n">base_filename</span><span class="o">=</span><span class="s2">"example_pop.dat"</span><span class="p">,</span> <span class="c1"># custom_options</span> +<span class="p">)</span> +</pre></div> +</div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></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="c1"># EXAMPLE PARSE_FUNCTION</span> + + <span class="c1"># extract info from the population instance</span> + + <span class="c1"># Get some information from the</span> + <span class="n">data_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="n">base_filename</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">"base_filename"</span><span class="p">]</span> + + <span class="c1"># Check directory, make if necessary</span> + <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">data_dir</span><span class="p">,</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> + + <span class="n">seperator</span> <span class="o">=</span> <span class="s2">" "</span> + + <span class="c1"># Create filename</span> + <span class="n">outfilename</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">data_dir</span><span class="p">,</span> <span class="n">base_filename</span><span class="p">)</span> + + <span class="n">parameters</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"time"</span><span class="p">,</span> <span class="s2">"mass"</span><span class="p">,</span> <span class="s2">"zams_mass"</span><span class="p">,</span> <span class="s2">"probability"</span><span class="p">,</span> <span class="s2">"radius"</span><span class="p">,</span> <span class="s2">"stellar_type"</span><span class="p">]</span> + + <span class="c1"># Go over the output.</span> + <span class="k">for</span> <span class="n">el</span> <span class="ow">in</span> <span class="n">output_lines</span><span class="p">(</span><span class="n">output</span><span class="p">):</span> + <span class="n">headerline</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="mi">0</span><span class="p">]</span> + + <span class="c1"># CHeck the header and act accordingly</span> + <span class="k">if</span> <span class="n">headerline</span> <span class="o">==</span> <span class="s2">"MY_STELLAR_DATA"</span><span class="p">:</span> + <span class="n">values</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="mi">1</span><span class="p">:]</span> + <span class="nb">print</span><span class="p">(</span><span class="n">values</span><span class="p">)</span> + + <span class="k">if</span> <span class="ow">not</span> <span class="nb">len</span><span class="p">(</span><span class="n">parameters</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">values</span><span class="p">):</span> + <span class="nb">print</span><span class="p">(</span><span class="s2">"Amount of column names isnt equal to amount of columns"</span><span class="p">)</span> + <span class="k">raise</span> <span class="ne">ValueError</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">outfilename</span><span class="p">):</span> + <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">outfilename</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="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">seperator</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">parameters</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">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">outfilename</span><span class="p">,</span> <span class="s2">"a"</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">seperator</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">values</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"># Creating a parsing function</span> +<span class="n">example_pop</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="c1"># Setting the parse function thats used in the evolve_population</span> +<span class="p">)</span> +</pre></div> +</div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="c1">### Custom logging</span> +<span class="c1"># Log the moment when the star turns into neutron</span> +<span class="n">example_pop</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> + <span class="n">C_logging_code</span><span class="o">=</span><span class="s2">"""</span> +<span class="s2">if(stardata->star[0].stellar_type >= 13)</span> +<span class="s2">{</span> +<span class="s2"> if (stardata->model.time < stardata->model.max_evolution_time)</span> +<span class="s2"> {</span> +<span class="s2"> Printf("MY_STELLAR_DATA </span><span class="si">%30.12e</span><span class="s2"> </span><span class="si">%g</span><span class="s2"> </span><span class="si">%g</span><span class="s2"> </span><span class="si">%g</span><span class="s2"> </span><span class="si">%g</span><span class="s2"> </span><span class="si">%d</span><span class="se">\\</span><span class="s2">n",</span> +<span class="s2"> //</span> +<span class="s2"> stardata->model.time, // 1</span> +<span class="s2"> stardata->star[0].mass, // 2</span> +<span class="s2"> stardata->common.zero_age.mass[0], // 4</span> +<span class="s2"> stardata->model.probability, // 5</span> +<span class="s2"> stardata->star[0].radius, // 6</span> +<span class="s2"> stardata->star[0].stellar_type // 7</span> +<span class="s2"> );</span> +<span class="s2"> };</span> +<span class="s2"> /* Kill the simulation to save time */</span> +<span class="s2"> stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;</span> +<span class="s2">};</span> +<span class="s2">"""</span> +<span class="p">)</span> +</pre></div> +</div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="c1"># Add grid variables</span> +<span class="n">resolution</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"M_1"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s2">"q"</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="s2">"per"</span><span class="p">:</span> <span class="mi">40</span><span class="p">}</span> + +<span class="c1"># Mass</span> +<span class="n">example_pop</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">"lnm1"</span><span class="p">,</span> + <span class="n">longname</span><span class="o">=</span><span class="s2">"Primary mass"</span><span class="p">,</span> + <span class="n">valuerange</span><span class="o">=</span><span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">150</span><span class="p">],</span> + <span class="n">resolution</span><span class="o">=</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">resolution</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]),</span> + <span class="n">spacingfunc</span><span class="o">=</span><span class="s2">"const(math.log(2), math.log(150), </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">resolution</span><span class="p">[</span><span class="s2">"M_1"</span><span class="p">]),</span> + <span class="n">precode</span><span class="o">=</span><span class="s2">"M_1=math.exp(lnm1)"</span><span class="p">,</span> + <span class="n">probdist</span><span class="o">=</span><span class="s2">"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1"</span><span class="p">,</span> + <span class="n">dphasevol</span><span class="o">=</span><span class="s2">"dlnm1"</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">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="p">)</span> + +<span class="c1"># # Mass ratio</span> +<span class="c1"># test_pop.add_grid_variable(</span> +<span class="c1"># name="q",</span> +<span class="c1"># longname="Mass ratio",</span> +<span class="c1"># valuerange=["0.1/M_1", 1],</span> +<span class="c1"># resolution="{}".format(resolution['q']),</span> +<span class="c1"># spacingfunc="const(0.1/M_1, 1, {})".format(resolution['q']),</span> +<span class="c1"># probdist="flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])",</span> +<span class="c1"># dphasevol="dq",</span> +<span class="c1"># precode="M_2 = q * M_1",</span> +<span class="c1"># parameter_name="M_2",</span> +<span class="c1"># condition="", # Impose a condition on this grid variable. Mostly for a check for yourself</span> +<span class="c1"># )</span> + +<span class="c1"># #</span> +<span class="c1"># test_pop.add_grid_variable(</span> +<span class="c1"># name="log10per", # in days</span> +<span class="c1"># longname="log10(Orbital_Period)",</span> +<span class="c1"># valuerange=[0.15, 5.5],</span> +<span class="c1"># resolution="{}".format(resolution["per"]),</span> +<span class="c1"># spacingfunc="const(0.15, 5.5, {})".format(resolution["per"]),</span> +<span class="c1"># precode="""orbital_period = 10** log10per</span> +<span class="c1"># sep = calc_sep_from_period(M_1, M_2, orbital_period)</span> +<span class="c1"># sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)</span> +<span class="c1"># sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)""",</span> +<span class="c1"># probdist="sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)",</span> +<span class="c1"># parameter_name="orbital_period",</span> +<span class="c1"># dphasevol="dlog10per",</span> +<span class="c1"># )</span> + +</pre></div> +</div> +</div> +<p>Exporting of all the settings can be done with .export_all_info() on default it exports everything, but can be supressed by turning it off: population settings (bse_options, grid_options, custom_options), turn off with include_population settings=False binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults). turn off with include_binary_c_defaults=False include_binary_c_version_info (all the compilation info, and information about the compiled +parameters), turn off with include_binary_c_version_info=False include_binary_c_help_all (all the help information for all the binary_c parameters), turn off with include_binary_c_help_all=Fase On default it will write this to the custom_options[‘data_dir’], but that can be overriden by setting use_datadir=False and providing an outfile=<></p> +<div class="nbinput docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="n">example_pop</span><span class="o">.</span><span class="n">export_all_info</span><span class="p">()</span> +</pre></div> +</div> +</div> +<div class="nboutput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]: +</pre></div> +</div> +<div class="output_area docutils container"> +<div class="highlight"><pre> +'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json' +</pre></div></div> +</div> +<p>Executing a single system This uses the M_1 orbital period etc set with the set function</p> +<div class="nbinput docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="n">output</span> <span class="o">=</span> <span class="n">example_pop</span><span class="o">.</span><span class="n">evolve_single</span><span class="p">()</span> +<span class="nb">print</span><span class="p">(</span><span class="n">output</span><span class="p">)</span> +</pre></div> +</div> +</div> +<div class="nboutput nblast docutils container"> +<div class="prompt empty docutils container"> +</div> +<div class="output_area docutils container"> +<div class="highlight"><pre> +Creating the code for the shared library for the custom logging +['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13'] +None +</pre></div></div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="c1">## Executing a population</span> +<span class="c1">## This uses the values generated by the grid_variables</span> +<span class="n">example_pop</span><span class="o">.</span><span class="n">evolve</span><span class="p">()</span> <span class="c1"># TODO: update this function call</span> +</pre></div> +</div> +</div> +<p>Wrapping up the results to an hdf5 file can be done by using the create_hdf5 () This function takes the settings file (ending in _settings.json) and the data files (ending in .dat) from the data_dir and packing them into an hdf5 file, which is then written into the same data_dir directory</p> +<div class="nbinput docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span><span class="n">create_hdf5</span><span class="p">(</span><span class="n">data_dir</span><span class="o">=</span><span class="n">example_pop</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="n">name</span><span class="o">=</span><span class="s2">"example_pop.hdf5"</span><span class="p">)</span> + +</pre></div> +</div> +</div> +<div class="nboutput nblast docutils container"> +<div class="prompt empty docutils container"> +</div> +<div class="output_area docutils container"> +<div class="highlight"><pre> +Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5 +Adding settings to HDF5 file +Adding data to HDF5 file +</pre></div></div> +</div> +<div class="nbinput nblast docutils container"> +<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]: +</pre></div> +</div> +<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre> +<span></span> +</pre></div> +</div> +</div> +</div> + + + </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="notebooks.html" class="btn btn-neutral float-left" title="Notebooks" 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: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.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/notebook_population.ipynb b/docs/build/html/notebook_population.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..8d2bdbf982952c3a9debf9213d52656f2d8fa76e --- /dev/null +++ b/docs/build/html/notebook_population.ipynb @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "bbbaafbb-fd7d-4b73-a970-93506ba35d71", + "metadata": {}, + "source": [ + "# Title page\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6b8673-a2b5-4b50-ad1b-e90671f57470", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from binarycpython.utils.grid import Population\n", + "from binarycpython.utils.functions import (\n", + " get_help_all,\n", + " get_help,\n", + " create_hdf5,\n", + " output_lines,\n", + ")\n", + "from binarycpython.utils.custom_logging_functions import temp_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ab50b7-591f-4883-af09-116d1835a751", + "metadata": {}, + "outputs": [], + "source": [ + "#########################################################\n", + "# This file serves as an example for running a population.\n", + "# The use of help(<function>) is a good way to inspect what parameters are there to use\n", + "#########################################################\n", + "\n", + "# Create population object\n", + "example_pop = Population()\n", + "\n", + "# If you want verbosity, set this before other things\n", + "example_pop.set(verbose=1)\n", + "\n", + "# Setting values can be done via .set(<parameter_name>=<value>)\n", + "# Values that are known to be binary_c_parameters are loaded into bse_options.\n", + "# Those that are present in the default grid_options are set in grid_options\n", + "# All other values that you set are put in a custom_options dict\n", + "example_pop.set(\n", + " # binary_c physics options\n", + " M_1=10, # bse_options\n", + " separation=0, # bse_options\n", + " orbital_period=45000000080, # bse_options\n", + " max_evolution_time=15000, # bse_options\n", + " eccentricity=0.02, # bse_options\n", + " # Set companion to low mass\n", + " M_2=0.08, # Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.\n", + " # grid_options\n", + " amt_cores=2, # grid_options\n", + " verbose=1, # verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff\n", + " # Custom options # TODO: need to be set in grid_options probably\n", + " data_dir=os.path.join(\n", + " temp_dir(), \"example_python_population_result\"\n", + " ), # custom_options\n", + " base_filename=\"example_pop.dat\", # custom_options\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c986215-93b1-4e30-ad79-f7c397e9ff7d", + "metadata": {}, + "outputs": [], + "source": [ + "def parse_function(self, output):\n", + " # EXAMPLE PARSE_FUNCTION\n", + "\n", + " # extract info from the population instance\n", + "\n", + " # Get some information from the\n", + " data_dir = self.custom_options[\"data_dir\"]\n", + " base_filename = self.custom_options[\"base_filename\"]\n", + "\n", + " # Check directory, make if necessary\n", + " os.makedirs(data_dir, exist_ok=True)\n", + "\n", + " seperator = \" \"\n", + "\n", + " # Create filename\n", + " outfilename = os.path.join(data_dir, base_filename)\n", + "\n", + " parameters = [\"time\", \"mass\", \"zams_mass\", \"probability\", \"radius\", \"stellar_type\"]\n", + "\n", + " # Go over the output.\n", + " for el in output_lines(output):\n", + " headerline = el.split()[0]\n", + "\n", + " # CHeck the header and act accordingly\n", + " if headerline == \"MY_STELLAR_DATA\":\n", + " values = el.split()[1:]\n", + " print(values)\n", + "\n", + " if not len(parameters) == len(values):\n", + " print(\"Amount of column names isnt equal to amount of columns\")\n", + " raise ValueError\n", + "\n", + " if not os.path.exists(outfilename):\n", + " with open(outfilename, \"w\") as f:\n", + " f.write(seperator.join(parameters) + \"\\n\")\n", + "\n", + " with open(outfilename, \"a\") as f:\n", + " f.write(seperator.join(values) + \"\\n\")\n", + "\n", + "\n", + "\n", + "# Creating a parsing function\n", + "example_pop.set(\n", + " parse_function=parse_function, # Setting the parse function thats used in the evolve_population\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fa5188e-312f-4a05-aeda-0bd4c00629c8", + "metadata": {}, + "outputs": [], + "source": [ + "### Custom logging\n", + "# Log the moment when the star turns into neutron\n", + "example_pop.set(\n", + " C_logging_code=\"\"\"\n", + "if(stardata->star[0].stellar_type >= 13) \n", + "{\n", + " if (stardata->model.time < stardata->model.max_evolution_time)\n", + " {\n", + " Printf(\"MY_STELLAR_DATA %30.12e %g %g %g %g %d\\\\n\",\n", + " // \n", + " stardata->model.time, // 1\n", + " stardata->star[0].mass, // 2\n", + " stardata->common.zero_age.mass[0], // 4\n", + " stardata->model.probability, // 5\n", + " stardata->star[0].radius, // 6\n", + " stardata->star[0].stellar_type // 7\n", + " );\n", + " };\n", + " /* Kill the simulation to save time */\n", + " stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;\n", + "};\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd197154-a8ce-4865-8929-008d3483101a", + "metadata": {}, + "outputs": [], + "source": [ + "# Add grid variables\n", + "resolution = {\"M_1\": 20, \"q\": 20, \"per\": 40}\n", + "\n", + "# Mass\n", + "example_pop.add_grid_variable(\n", + " name=\"lnm1\",\n", + " longname=\"Primary mass\",\n", + " valuerange=[2, 150],\n", + " resolution=\"{}\".format(resolution[\"M_1\"]),\n", + " spacingfunc=\"const(math.log(2), math.log(150), {})\".format(resolution[\"M_1\"]),\n", + " precode=\"M_1=math.exp(lnm1)\",\n", + " probdist=\"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1\",\n", + " dphasevol=\"dlnm1\",\n", + " parameter_name=\"M_1\",\n", + " condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + ")\n", + "\n", + "# # Mass ratio\n", + "# test_pop.add_grid_variable(\n", + "# name=\"q\",\n", + "# longname=\"Mass ratio\",\n", + "# valuerange=[\"0.1/M_1\", 1],\n", + "# resolution=\"{}\".format(resolution['q']),\n", + "# spacingfunc=\"const(0.1/M_1, 1, {})\".format(resolution['q']),\n", + "# probdist=\"flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])\",\n", + "# dphasevol=\"dq\",\n", + "# precode=\"M_2 = q * M_1\",\n", + "# parameter_name=\"M_2\",\n", + "# condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + "# )\n", + "\n", + "# #\n", + "# test_pop.add_grid_variable(\n", + "# name=\"log10per\", # in days\n", + "# longname=\"log10(Orbital_Period)\",\n", + "# valuerange=[0.15, 5.5],\n", + "# resolution=\"{}\".format(resolution[\"per\"]),\n", + "# spacingfunc=\"const(0.15, 5.5, {})\".format(resolution[\"per\"]),\n", + "# precode=\"\"\"orbital_period = 10** log10per\n", + "# sep = calc_sep_from_period(M_1, M_2, orbital_period)\n", + "# sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)\n", + "# sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)\"\"\",\n", + "# probdist=\"sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)\",\n", + "# parameter_name=\"orbital_period\",\n", + "# dphasevol=\"dlog10per\",\n", + "# )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8c96b151-8c3b-4479-969f-6c2f898497a5", + "metadata": {}, + "source": [ + "Exporting of all the settings can be done with .export_all_info()\n", + "on default it exports everything, but can be supressed by turning it off:\n", + " population settings (bse_options, grid_options, custom_options), turn off with include_population\n", + " settings=False\n", + " binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults).\n", + " turn off with include_binary_c_defaults=False\n", + " include_binary_c_version_info (all the compilation info, and information about the compiled\n", + " parameters), turn off with include_binary_c_version_info=False\n", + " include_binary_c_help_all (all the help information for all the binary_c parameters),\n", + " turn off with include_binary_c_help_all=Fase\n", + "On default it will write this to the custom_options['data_dir'], but that can be overriden by\n", + " setting use_datadir=False and providing an outfile=<>" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ba83443c-64b4-4126-90b3-b1ca76c0f73d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_pop.export_all_info()" + ] + }, + { + "cell_type": "markdown", + "id": "ef5b51a1-e56d-4bec-a5c7-b9d5bceeceba", + "metadata": {}, + "source": [ + "Executing a single system\n", + "This uses the M_1 orbital period etc set with the set function" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "c0a9aed7-1fc9-4fe3-8bcf-4e987bfc00a9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating the code for the shared library for the custom logging\n", + "['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13']\n", + "None\n" + ] + } + ], + "source": [ + "output = example_pop.evolve_single()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea376c1-1e92-45af-8cab-9d7fdca564eb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "## Executing a population\n", + "## This uses the values generated by the grid_variables\n", + "example_pop.evolve() # TODO: update this function call" + ] + }, + { + "cell_type": "markdown", + "id": "ce937b07-7292-4bb1-b2e7-d69e51bdff6e", + "metadata": { + "tags": [] + }, + "source": [ + "Wrapping up the results to an hdf5 file can be done by using the create_hdf5\n", + "(<directory containing data and settings>) This function takes the settings file\n", + "(ending in _settings.json) and the data files (ending in .dat) from the data_dir\n", + "and packing them into an hdf5 file, which is then written into the same data_dir directory" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ad444138-f854-4fdb-8e18-49e35ac9c7e2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5\n", + "Adding settings to HDF5 file\n", + "Adding data to HDF5 file\n" + ] + } + ], + "source": [ + "create_hdf5(data_dir=example_pop.custom_options[\"data_dir\"], name=\"example_pop.hdf5\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34da69bc-fe60-4a9d-b07a-f6cd2f216964", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/build/html/notebooks.html b/docs/build/html/notebooks.html new file mode 100644 index 0000000000000000000000000000000000000000..ab64c80a4ccaf8be6605ac32383fe4398d56ad5d --- /dev/null +++ b/docs/build/html/notebooks.html @@ -0,0 +1,269 @@ + + +<!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>Notebooks — binary_c-python documentation</title> + + + + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + + + + + + + <!--[if lt IE 9]> + <script src="_static/js/html5shiv.min.js"></script> + <![endif]--> + + + <script type="text/javascript" id="documentation_options" data-url_root="./" 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 src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> + + <script type="text/javascript" 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="Title page" href="notebook_population.html" /> + <link rel="prev" title="Example of population script" href="population_example.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" alt="Documentation 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"><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"><a class="reference internal" href="modules.html">Binarycpython code</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="examples.html">Examples</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="general_examples.html">Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="population_example.html">Example of population script</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Notebooks</a><ul> +<li class="toctree-l3"><a class="reference internal" href="notebook_population.html">Title page</a></li> +</ul> +</li> +</ul> +</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" class="icon icon-home"></a> »</li> + + <li><a href="examples.html">Examples</a> »</li> + + <li>Notebooks</li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="_sources/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 */ + +/* 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="notebooks"> +<h1>Notebooks<a class="headerlink" href="#notebooks" title="Permalink to this headline">¶</a></h1> +<p>The notebooks.</p> +<div class="toctree-wrapper compound"> +<p class="caption"><span class="caption-text">Contents:</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="notebook_population.html">Title page</a></li> +</ul> +</div> +</div> + + + </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="Title page" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="population_example.html" class="btn btn-neutral float-left" title="Example of population script" 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: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. +<br><br> +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.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/objects.inv b/docs/build/html/objects.inv index 77dbc4543a4042b06b62f79925729c970f39663e..4cb6e0762a38b40838d01448dffae4e83435d428 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 a24848261512bb924cadba61dffb142a1cb72551..b6caf948e3bb3eb2893d6fef642c80586974eb6d 100644 --- a/docs/build/html/plot_functions.html +++ b/docs/build/html/plot_functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.plot_functions"> + +<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="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> @@ -182,10 +209,10 @@ plotting functions master function: plot_system</p> </dd> </dl> -<p>All the loose components here can ofcourse be used in other routines if you want.</p> -<p>There is no preloaded matplotlib rc, you should do that yourself</p> -<p>These plotting routines are designed for binary systems, and admittingly they are here mostly for -inspirational purposes, since one would problably want to customize the plots. +<p>All the loose components here can of course be used in other routines if you want.</p> +<p>There is no pre loaded matplotlib rc, you should do that yourself</p> +<p>These plotting routines are designed for binary systems, and admittedly they are here mostly for +inspirational purposes, since one would probably want to customise the plots. Regardless, having some plotting routines in here seemed like a nice idea</p> <dl class="simple"> <dt>Tasks</dt><dd><p>TODO: This module is not finished yet. @@ -446,9 +473,9 @@ This is not included in all the plotting routines.</p></li> provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/population_example.html b/docs/build/html/population_example.html index 647eecf5aca06d295edbc0eec7a434a3f1fddbac..354a841484911274ecad9d6c728c06f22abd3e1c 100644 --- a/docs/build/html/population_example.html +++ b/docs/build/html/population_example.html @@ -30,13 +30,16 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" 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="next" title="Notebooks" href="notebooks.html" /> <link rel="prev" title="Examples" href="general_examples.html" /> </head> @@ -89,6 +92,7 @@ <li class="toctree-l1 current"><a class="reference internal" href="examples.html">Examples</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="general_examples.html">Examples</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Example of population script</a></li> +<li class="toctree-l2"><a class="reference internal" href="notebooks.html">Notebooks</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li> @@ -162,7 +166,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="example-of-population-script"> + +<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="example-of-population-script"> <h1>Example of population script<a class="headerlink" href="#example-of-population-script" title="Permalink to this headline">¶</a></h1> <p>The source code of a script to run a population of stars.</p> <div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1 @@ -580,7 +608,7 @@ <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="notebooks.html" class="btn btn-neutral float-right" title="Notebooks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="general_examples.html" class="btn btn-neutral float-left" title="Examples" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> @@ -606,9 +634,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/py-modindex.html b/docs/build/html/py-modindex.html index 95e0b1124fc91a4120cfe5ca0521018a863bd561..eb74bf0b4902dcd64eee1812c38dc848bd4a4864 100644 --- a/docs/build/html/py-modindex.html +++ b/docs/build/html/py-modindex.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -252,9 +255,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/readme_link.html b/docs/build/html/readme_link.html index 04e576c67b05db4e1760c16aad69858c7d56375c..e97273eb05acdca514386b29f76e8d4b2583e1cd 100644 --- a/docs/build/html/readme_link.html +++ b/docs/build/html/readme_link.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -172,7 +175,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="python-module-for-binary-c"> + +<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="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> @@ -307,9 +334,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/run_system_wrapper.html b/docs/build/html/run_system_wrapper.html index cbbe4564c5b75d36b762011d0fd98ae17de2899e..6a5470eb05353d492b3e1ed48a89bd183a3c22e3 100644 --- a/docs/build/html/run_system_wrapper.html +++ b/docs/build/html/run_system_wrapper.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.run_system_wrapper"> + +<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="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> @@ -184,7 +211,7 @@ Mostly as a useful utility function that handles all the setup of argument lists <ul class="simple"> <li><p>run_system(M_1=10): will run a system with ZAMS mass 1 = 10</p></li> <li><dl class="simple"> -<dt>run_system(M_1=10, log_filename=â€~/example_log.txtâ€): Will run a system</dt><dd><p>and write the logfile too</p> +<dt>run_system(M_1=10, log_filename=â€~/example_log.txtâ€): Will run a system</dt><dd><p>and write the log file too</p> </dd> </dl> </li> @@ -203,8 +230,8 @@ Several extra arguments can be passed through the kwargs:</p> <dt>Kwargs:</dt><dd><dl class="simple"> <dt>custom_logging_code: Should contain a string containing the c-code for the shared library.</dt><dd><p>If this is provided binary_c will use that custom logging code to output its data</p> </dd> -<dt>log_filename: Should contain name of the binary_c system logfile.</dt><dd><p>Passing this will make sure that the filename gets written for a run -(its default behaviour is NOT to write a logfile for a system)</p> +<dt>log_filename: Should contain name of the binary_c system log file.</dt><dd><p>Passing this will make sure that the filename gets written for a run +(its default behaviour is NOT to write a log file for a system)</p> </dd> <dt>parse_function (function): should contain a function that parses the output.</dt><dd><p>The parse function should take 1 required parameter: the output of the binaryc run Passing this will call the parse_function by passing it the output of the binary_c call @@ -256,9 +283,9 @@ and returns what the parse_function returns</p> provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/search.html b/docs/build/html/search.html index 1de40c2f8930e348f4fcbbf004cea0e5866038a7..fe57033668fb6bed7e6a042de6314d541254d00c 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -31,6 +31,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -191,9 +194,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 70adfe8322f7c623ed6a27b6646c3048481a450e..e8f9060ba06422c87323c712a3724571fc34681b 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","examples","functions","general_examples","grid","grid_options_defaults","grid_options_descriptions","hpc_functions","index","modules","plot_functions","population_example","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":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["binary_c_parameters.rst","custom_logging_functions.rst","distribution_functions.rst","examples.rst","functions.rst","general_examples.rst","grid.rst","grid_options_defaults.rst","grid_options_descriptions.rst","hpc_functions.rst","index.rst","modules.rst","plot_functions.rst","population_example.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,"-"],distribution_functions:[2,0,0,"-"],functions:[4,0,0,"-"],grid:[6,0,0,"-"],grid_options_defaults:[7,0,0,"-"],hpc_functions:[9,0,0,"-"],plot_functions:[12,0,0,"-"],run_system_wrapper:[15,0,0,"-"],spacing_functions:[16,0,0,"-"],stellar_types:[17,0,0,"-"],useful_funcs:[18,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.distribution_functions":{"const":[2,1,1,""],Arenou2010_binary_fraction:[2,1,1,""],Izzard2012_period_distribution:[2,1,1,""],Kroupa2001:[2,1,1,""],Moe_de_Stefano_2017_multiplicity_fractions:[2,1,1,""],Moe_de_Stefano_2017_pdf:[2,1,1,""],build_q_table:[2,1,1,""],calc_P_integral:[2,1,1,""],calc_e_integral:[2,1,1,""],calc_total_probdens:[2,1,1,""],calculate_constants_three_part_powerlaw:[2,1,1,""],cosmic_SFH_madau_dickinson2014:[2,1,1,""],duquennoy1991:[2,1,1,""],fill_data:[2,1,1,""],flat:[2,1,1,""],flatsections:[2,1,1,""],gaussian:[2,1,1,""],gaussian_func:[2,1,1,""],gaussian_normalizing_const:[2,1,1,""],get_integration_constant_q:[2,1,1,""],get_max_multiplicity:[2,1,1,""],imf_chabrier2003:[2,1,1,""],imf_scalo1986:[2,1,1,""],imf_scalo1998:[2,1,1,""],imf_tinsley1980:[2,1,1,""],interpolate_in_mass_izzard2012:[2,1,1,""],ktg93:[2,1,1,""],linear_extrapolation_q:[2,1,1,""],merge_multiplicities:[2,1,1,""],normalize_dict:[2,1,1,""],number:[2,1,1,""],poisson:[2,1,1,""],powerlaw:[2,1,1,""],powerlaw_constant:[2,1,1,""],powerlaw_extrapolation_q:[2,1,1,""],prepare_dict:[2,1,1,""],raghavan2010_binary_fraction:[2,1,1,""],sana12:[2,1,1,""],set_opts:[2,1,1,""],three_part_powerlaw:[2,1,1,""]},"binarycpython.utils.functions":{BinaryCEncoder:[4,2,1,""],Capturing:[4,2,1,""],binarycDecoder:[4,2,1,""],binaryc_json_serializer:[4,1,1,""],call_binary_c_config:[4,1,1,""],catchtime:[4,2,1,""],convert_bytes:[4,1,1,""],count_keys_recursive:[4,1,1,""],create_arg_string:[4,1,1,""],create_hdf5:[4,1,1,""],custom_sort_dict:[4,1,1,""],example_parse_output:[4,1,1,""],extract_ensemble_json_from_string:[4,1,1,""],filter_arg_dict:[4,1,1,""],get_arg_keys:[4,1,1,""],get_defaults:[4,1,1,""],get_help:[4,1,1,""],get_help_all:[4,1,1,""],get_help_super:[4,1,1,""],get_moe_distefano_dataset:[4,1,1,""],get_size:[4,1,1,""],handle_ensemble_string_to_json:[4,1,1,""],imports:[4,1,1,""],inspect_dict:[4,1,1,""],is_capsule:[4,1,1,""],load_logfile:[4,1,1,""],make_build_text:[4,1,1,""],merge_dicts:[4,1,1,""],multiply_values_dict:[4,1,1,""],output_lines:[4,1,1,""],parse_binary_c_version_info:[4,1,1,""],recursive_change_key_to_float:[4,1,1,""],recursive_change_key_to_string:[4,1,1,""],remove_file:[4,1,1,""],return_binary_c_version_info:[4,1,1,""],subtract_dicts:[4,1,1,""],temp_dir:[4,1,1,""],update_dicts:[4,1,1,""],verbose_print:[4,1,1,""],write_binary_c_parameter_descriptions_to_rst_file:[4,1,1,""]},"binarycpython.utils.functions.BinaryCEncoder":{"default":[4,3,1,""]},"binarycpython.utils.functions.Capturing":{__enter__:[4,3,1,""],__exit__:[4,3,1,""]},"binarycpython.utils.functions.binarycDecoder":{decode:[4,3,1,""]},"binarycpython.utils.functions.catchtime":{__enter__:[4,3,1,""],__exit__:[4,3,1,""]},"binarycpython.utils.grid":{Population:[6,2,1,""]},"binarycpython.utils.grid.Population":{Moe_de_Stefano_2017:[6,3,1,""],add_grid_variable:[6,3,1,""],evolve:[6,3,1,""],evolve_population:[6,3,1,""],evolve_single:[6,3,1,""],export_all_info:[6,3,1,""],format_ensemble_results:[6,3,1,""],get_stream_logger:[6,3,1,""],last_grid_variable:[6,3,1,""],parse_cmdline:[6,3,1,""],return_all_info:[6,3,1,""],return_population_settings:[6,3,1,""],set:[6,3,1,""],set_moe_distefano_settings:[6,3,1,""],system_queue_filler:[6,3,1,""],write_binary_c_calls_to_file:[6,3,1,""]},"binarycpython.utils.grid_options_defaults":{grid_options_description_checker:[7,1,1,""],grid_options_help:[7,1,1,""],print_option_descriptions:[7,1,1,""],write_grid_options_to_rst_file:[7,1,1,""]},"binarycpython.utils.plot_functions":{color_by_index:[12,1,1,""],dummy:[12,1,1,""],parse_function_hr_diagram:[12,1,1,""],parse_function_masses:[12,1,1,""],parse_function_orbit:[12,1,1,""],plot_HR_diagram:[12,1,1,""],plot_masses:[12,1,1,""],plot_orbit:[12,1,1,""],plot_system:[12,1,1,""]},"binarycpython.utils.run_system_wrapper":{run_system:[15,1,1,""]},"binarycpython.utils.spacing_functions":{"const":[16,1,1,""]},"binarycpython.utils.useful_funcs":{calc_period_from_sep:[18,1,1,""],calc_sep_from_period:[18,1,1,""],maximum_mass_ratio_for_RLOF:[18,1,1,""],minimum_period_for_RLOF:[18,1,1,""],minimum_separation_for_RLOF:[18,1,1,""],ragb:[18,1,1,""],roche_lobe:[18,1,1,""],rzams:[18,1,1,""],zams_collision:[18,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:{"0001":18,"0007":2,"001":0,"002":5,"054":2,"0820":0,"08msun":0,"0902":0,"100":[0,2],"1000":[5,8],"100000000000":5,"115":2,"125":0,"12500":0,"12e":[1,13],"13e3":0,"1403":2,"150":13,"15000":[0,5,13],"15msun":2,"190":0,"1951":0,"1972":0,"1975":0,"197x":0,"1980":2,"1983":18,"1986":[0,2],"1989":0,"1991":2,"1993":0,"1996":18,"1998":[0,2],"1999":0,"1ckzg0p9":[10,14],"1e2":0,"1e9":0,"200":0,"2000":0,"2001":2,"2002":0,"2003":[0,2],"2004":0,"2005":0,"2009":0,"2010":[0,2,8],"2012":[0,2],"2013":0,"2014":[0,2],"2015":0,"2016":0,"2017":[0,8],"2018":[0,1],"2019":0,"2020":0,"2021":0,"20210720":0,"257":18,"25msun":0,"281":18,"2969346":2,"2msun":0,"3000":0,"30e4":0,"3msun":2,"4000":0,"42msun":0,"44msun":0,"45000000080":13,"4530":5,"45msun":0,"4e3":0,"500":0,"5msun":0,"600000":0,"6044":0,"625":0,"6944":0,"6e1":2,"6e5":0,"6msun":0,"7619":0,"763":2,"78125":0,"795":2,"80msol":2,"boolean":[0,4,6,8,12,18],"break":0,"case":[0,4,8],"catch":[4,5,8],"char":8,"class":[4,6],"const":[2,6,13,16],"default":[0,1,2,4,5,6,7,8,13,15],"export":[4,6,13],"float":[0,2,4,16,18],"function":[0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,18],"import":[4,5,6,13],"int":[0,1,2,4,6,7,8,16,18],"long":[0,4,6,8,17],"new":[0,2,4,6],"null":[0,4],"paczy\u0144ski":0,"public":[7,10],"return":[1,2,4,6,7,8,12,15,16,18],"short":[0,17],"super":0,"switch":0,"throw":[10,14],"true":[0,4,6,7,8,12,13],"try":[0,6,10,14],"while":0,And:[7,10,14,18],For:[0,4,10,12,14],Gas:0,Its:8,NOT:[0,6,15],Not:[8,13],One:0,Pms:12,That:0,The:[0,1,2,4,5,6,8,10,12,13,14,15],Then:[4,10,14],There:[2,5,6,7,8,12],These:[4,8,12],Use:[0,5,6],Used:[0,8,12],Useful:[0,6,7],Uses:[0,16],Was:0,Will:[0,4,6,13,15],With:7,__enter__:4,__exit__:4,_actually_evolve_system:8,_binary_c_bind:[4,5,18],_binary_c_config_execut:8,_binary_c_dir:8,_binary_c_execut:8,_binary_c_shared_librari:8,_commandline_input:8,_count:8,_custom_logging_shared_library_fil:8,_end_time_evolut:8,_errors_exceed:8,_errors_found:8,_evolution_type_opt:8,_failed_count:8,_failed_prob:8,_failed_systems_error_cod:8,_generate_grid_cod:8,_grid_vari:8,_loaded_ms_data:8,_main_pid:8,_population_id:8,_probtot:8,_process_run_population_grid:8,_repeat:8,_set:[6,13],_set_ms_grid:8,_start_time_evolut:8,_store_memaddr:8,_system_gener:8,_total_mass_run:8,_total_probability_weighted_mass_run:8,_total_starcount:8,_zero_prob_stars_skip:8,abat:0,abbrevi:17,about:[4,6,7,13,18],abov:[0,2,4,5,6],absolut:0,abund:0,acceler:0,accept:[4,13],access:8,accord:[0,2],accordingli:13,account:[0,8],accret:0,accretion_limit_dynamical_multipli:0,accretion_limit_eddington_lmms_multipli:0,accretion_limit_eddington_steady_multipli:0,accretion_limit_eddington_wd_to_remnant_multipli:0,accretion_limit_thermal_multipli:0,accretor:[0,18],acess:2,act:[0,8,13],activ:[0,10,14],actual:[0,4,6,8,10,12,14],adam:0,adapt:0,add:[2,4,6,8,12,13,16,18],add_grid_vari:[6,13],added:4,admittingli:12,adress:[1,5,8,18],affect:0,after:[0,6,8],ag89:0,again:[4,6,8,10,14],against:12,agb:0,agb_3dup_algorithm:0,agb_core_algorithm:0,agb_core_algorithm_default:0,agb_core_algorithm_hurlei:0,agb_core_algorithm_karaka:0,agb_luminosity_algorithm:0,agb_luminosity_algorithm_default:0,agb_luminosity_algorithm_hurlei:0,agb_luminosity_algorithm_karaka:0,agb_radius_algorithm:0,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,age:0,aging:0,albedo:0,algorithm:10,algothim:0,all:[0,1,2,4,5,6,7,8,10,11,12,13,14,15],all_info:6,allow:[0,2,4,5,8],allow_nan:4,along:[0,7,8],alot:[8,13],alpha:0,alpha_c:0,alphacb:0,alreadi:6,also:[0,4,5,6,7,10,14,18],altern:[0,8],alwai:[0,2,8],amanda:0,amax:2,amin:2,amount:[0,4,6,7,8,13,16],amt_cor:[6,8,13],analys:15,analyt:6,andrew:[10,14],andronov:0,angelou_lithium_cheb_decay_tim:0,angelou_lithium_cheb_massfrac:0,angelou_lithium_cheb_tim:0,angelou_lithium_decay_funct:0,angelou_lithium_decay_tim:0,angelou_lithium_eagb_decay_tim:0,angelou_lithium_eagb_massfrac:0,angelou_lithium_eagb_tim:0,angelou_lithium_gb_decay_tim:0,angelou_lithium_gb_massfrac:0,angelou_lithium_gb_tim:0,angelou_lithium_hg_decay_tim:0,angelou_lithium_hg_massfrac:0,angelou_lithium_hg_tim:0,angelou_lithium_lmms_decay_tim:0,angelou_lithium_lmms_massfrac:0,angelou_lithium_lmms_tim:0,angelou_lithium_ms_decay_tim:0,angelou_lithium_ms_massfrac:0,angelou_lithium_ms_tim:0,angelou_lithium_tpagb_decay_tim:0,angelou_lithium_tpagb_massfrac:0,angelou_lithium_tpagb_tim:0,angelou_lithium_vrot_trigg:0,angelou_lithium_vrotfrac_trigg:0,angular:[0,12],ani:[0,2,4,6,10,14],anoth:0,ansi:0,anyth:[0,8],anywai:6,anywher:6,api:[0,4],api_log_filename_prefix:0,append:[1,4],appli:0,approach:5,appropri:[0,8],approxim:0,aren:[2,8],arenou2010_binary_fract:2,arg:[2,4,12],arg_dict:4,argopt:0,argpair:4,argstr:5,argument:[0,2,4,5,6,8,13,15],argument_of_periastron:0,argument_of_periastron_quadrupl:0,argument_of_periastron_tripl:0,around:[0,5],arrai:[2,4,5,8],artifici:0,artificial_accretion_end_tim:0,artificial_accretion_ignor:0,artificial_accretion_start_tim:0,artificial_angular_momentum_accretion_r:0,artificial_mass_accretion_r:0,artificial_orbital_angular_momentum_accretion_r:0,arxiv:[0,2],asarrai:5,asign:6,ask:[0,18],asplund:0,assum:[0,12],ast871:0,astronomi:0,astropi:[10,12,14],atom:4,attempt:[4,6],auto:11,autogen_c_logging_cod:[1,5],autogener:[1,5],automat:[0,1,5,7,10,14],avaibl:[10,14],avail:[0,4,8,12],awai:0,axi:[0,12],b_1:0,b_2:0,b_3:0,b_4:0,b_inclination1:0,b_inclination2:0,b_inclination3:0,b_inclination4:0,back:[0,4],background:5,backward:0,bagb:0,barn:0,base:[0,2,4,5,6,10,12,14,18],base_filenam:[6,13],basic:[5,6],batchmod:0,beasor:0,becaus:[0,2,5,6,8,10,14],becom:[0,1,2,4],been:[0,6,8],befor:[0,6,8,10,13,14],behaviour:[4,15],behind:5,belczynski:0,below:[0,8,13],berro:0,bertolami:0,best:[6,8,10,14],beta:0,beta_reverse_nova:0,beta_reverse_novae_geometri:0,better:[0,4,6],between:[0,2,16],bewar:6,bh_belczynski:0,bh_fryer12_delai:0,bh_fryer12_rapid:0,bh_hurley2002:0,bh_prescript:0,bh_spera2015:0,big:[0,8],bin:[0,5,10,14],binari:[2,5,6,8,10,12,13,14,18],binary_c2:[10,14],binary_c:[1,2,4,5,6,8,12,13,15],binary_c_cal:6,binary_c_default:13,binary_c_inline_config:1,binary_c_log_cod:[1,5],binary_c_macro:0,binary_c_output:4,binary_c_paramet:[0,13],binary_c_python:[4,6],binary_c_task_:0,binary_c_write_log_cod:1,binary_grid:0,binary_star:18,binaryc:[1,4,15],binaryc_config:1,binaryc_json_seri:4,binarycdecod:4,binarycencod:4,binarycpython:[1,2,4,5,6,7,10,12,13,14,15,16,18],bind:0,birth:0,bit:2,bivari:0,black:0,black_hol:0,bloecker:0,blog:1,boltzman:12,boltzmann:0,bondi:0,bondi_hoyle_accretion_factor:0,bool:[4,6,7,12],born:0,bosswissam:4,both:[0,4],bottom:0,bound:[2,16],boundari:2,brake:0,branch:[0,4],branch_david:0,branchpoint:6,breakup:0,broken:0,bse:[0,2],bse_opt:[6,13],bsf:0,buffer:0,build:[0,1,4],build_q_tabl:2,built:[0,1,4,10,14],burn:0,busso:0,bye:0,c13_eff:0,c_auto_log:[8,13],c_log:0,c_logging_cod:[8,13],calc_e_integr:2,calc_p_integr:2,calc_period_from_sep:18,calc_sep_from_period:[13,18],calc_total_probden:2,calcul:[0,2,4,6,8,18],calculate_constants_three_part_powerlaw:2,call:[0,1,4,6,8,12,13,15],call_binary_c_config:4,can:[0,1,2,4,5,6,8,10,12,13,14,15],cannot:6,canon:8,cap:0,capsul:4,captur:[0,4],carbon:0,carbon_oxygen_white_dwarf:0,carlo:0,carrasco:0,carri:0,cast:[4,5],catchtim:4,categor:4,caught:4,caus:18,cbdisc:0,cbdisc_albedo:0,cbdisc_alpha:0,cbdisc_eccentricity_pumping_dermin:0,cbdisc_eccentricity_pumping_method:0,cbdisc_eccentricity_pumping_non:0,cbdisc_end_evolution_after_disc:0,cbdisc_fail_ring_inside_separ:0,cbdisc_gamma:0,cbdisc_init_djdm:0,cbdisc_init_dm:0,cbdisc_inner_edge_strip:0,cbdisc_inner_edge_stripping_timescal:0,cbdisc_kappa:0,cbdisc_mass_loss_constant_r:0,cbdisc_mass_loss_fuv_multipli:0,cbdisc_mass_loss_inner_l2_cross_multipli:0,cbdisc_mass_loss_inner_viscous_accretion_method:0,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,cbdisc_mass_loss_inner_viscous_multipli:0,cbdisc_mass_loss_ism_pressur:0,cbdisc_mass_loss_ism_ram_pressure_multipli:0,cbdisc_mass_loss_xray_multipli:0,cbdisc_max_lifetim:0,cbdisc_minimum_evaporation_timescal:0,cbdisc_minimum_fr:0,cbdisc_minimum_luminos:0,cbdisc_minimum_mass:0,cbdisc_no_wind_if_cbdisc:0,cbdisc_outer_edge_strip:0,cbdisc_outer_edge_stripping_timescal:0,cbdisc_resonance_damp:0,cbdisc_resonance_multipli:0,cbdisc_torquef:0,cbdisc_viscous_l2_coupl:0,cbdisc_viscous_photoevaporative_coupl:0,cbdisc_viscous_photoevaporative_coupling_inst:0,cbdisc_viscous_photoevaporative_coupling_non:0,cbdisc_viscous_photoevaporative_coupling_visc:0,cee:0,cemp:0,cemp_cfe_minimum:0,center:6,central_object:0,certain:[3,8,10,14],cf_amanda_log:0,cflag:[10,14],chabrier:2,chandrasekhar:0,chandrasekhar_mass:0,chang:[0,1,2,4,6,7,8,10,13,14],chapter:[0,3,8,11],cheb:0,check:[0,2,4,6,7,13,18],check_circular:4,chemic:0,chen:0,child:4,choic:[0,2,6,12],choos:[0,5,12],chosen:6,circular:0,circumbinari:0,circumstanti:0,claei:0,clark:0,clean:[1,6,10,14],clean_up_custom_logging_fil:6,clear:4,clock:4,clone:[10,14],close:0,cloud:0,cls:4,cluster:9,cmdline:6,code:[0,1,3,5,6,7,10,12,13,14,15],collaps:0,collapsar:0,collect:18,collid:18,color:12,color_by_index:12,colour:0,colour_log:0,column:[5,12,13],com:[1,4],combin:[1,4,6,8],combine_ensemble_with_thread_join:8,come:[2,10,14,16],comenv_bs:0,comenv_disc_angmom_fract:0,comenv_disc_mass_fract:0,comenv_ejection_spin_method:0,comenv_ejection_spin_method_do_noth:0,comenv_ejection_spin_method_sychron:0,comenv_ejection_spin_method_synchron:0,comenv_merger_spin_method:0,comenv_merger_spin_method_breakup:0,comenv_merger_spin_method_conserve_angmom:0,comenv_merger_spin_method_conserve_omega:0,comenv_merger_spin_method_specif:0,comenv_ms_accret:0,comenv_ms_accretion_fract:0,comenv_ms_accretion_mass:0,comenv_nandez2016:0,comenv_nelemans_tout:0,comenv_ns_accret:0,comenv_ns_accretion_fract:0,comenv_ns_accretion_mass:0,comenv_post_eccentr:0,comenv_prescript:0,comenv_splitmass:0,comenv_undef:0,command:[0,1,6,8,10,14],commandlin:[6,8,13],commit:4,common:[0,13],companion:[0,13],compar:[0,8],compil:[1,5,10,13,14],compile_shared_lib:1,complain:13,complex:[5,6,8,12],compon:[4,12],comput:[0,9],condit:[5,6,13],condor:[6,8,9],condor_grid:6,config:[1,4,8,10,14],config_fil:1,configur:[2,5,6,13],conserv:0,consid:[0,1,2,4,6,8,12],constant:[0,2,12],construct:[0,1,5],conta:7,contain:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17],content:[4,10],context:4,continu:6,control:0,convect:0,converg:0,convert:[2,4,6],convert_byt:4,cool:0,copi:[0,6,18],core:[0,6,8,12],core_helium_burn:0,core_mass:0,correct:[2,6,12,18],correctli:[5,10,12,13,14],correspond:12,corretor:0,cosmic:2,cosmic_sfh_madau_dickinson2014:2,could:[0,4],count:[4,8],count_keys_recurs:4,counter:8,coupl:0,coverag:[10,14],cowd:0,cpu:0,crap_paramet:0,creat:[2,4,6,13],create_and_load_logging_funct:[1,5],create_arg_str:4,create_hdf5:[4,13],critic:0,cross:0,ctype:1,cuntz:0,current:[0,4,10,14],custom:[0,1,4,5,6,8,12,13,15],custom_log:[5,6,8],custom_logging_cod:[1,5,15],custom_logging_func_memaddr:[5,8],custom_logging_funct:[5,8,10,11,13],custom_logging_info:6,custom_opt:[6,13],custom_sort_dict:4,custom_tmp_dir:1,cut:5,cvode:0,d1ed5b6c1:0,dai:[0,2,5,13,18],damp:0,dat:[0,4,13],data:[0,4,5,6,8,13,15],data_dict:2,data_dir:[4,6,8,13],datadir:6,datafram:[5,12],dataset:4,date:6,david:[0,10,14],david_logging_funct:0,dd7:0,deactiv:0,deal:4,death:0,debug:[0,8],decai:0,decid:[0,4,5],decod:4,decreas:0,deeper:6,def:[5,13],default_to_metal:0,defaultdict:4,defer:0,defin:[0,1,2,6,12],definit:[1,18],degener:0,degre:0,delta_mcmin:0,den:0,densiti:2,depend:[0,2,10,12,14],deprec:0,dermin:0,describ:[0,2,5,8],descript:[0,2,4,8,10,11],design:[6,12],desir:0,destruct:6,detail:[0,4],detect:0,determin:[0,6,18],deton:0,dev:0,develop:1,deviat:2,dewi:0,dex:0,df2:5,diagnost:8,diagram:[0,12],dickonson:2,dict2:4,dict:[1,2,4,6,7,13,17],dict_1:4,dict_2:4,dictionari:[1,2,4,6,7,8,12,17],did:[4,10,14],differ:[0,4,6,10,12,14],dimmer:0,dir:[10,14],direct:[0,6],directli:[4,5,8],director:8,directori:[0,4,6,8,10,13,14],disabl:0,disable_debug:0,disable_end_log:0,disable_ev:0,disc:0,disc_legacy_log:0,disc_log2d:0,disc_log:0,disc_log_directori:0,disc_log_dt:0,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,disc_stripping_timescale_infinit:0,disc_stripping_timescale_inst:0,disc_stripping_timescale_orbit:0,disc_stripping_timescale_visc:0,disc_timestep_factor:0,discs_circumbinary_from_comenv:0,discs_circumbinary_from_wind:0,disk:[0,6],dispers:0,displai:0,dist:[10,14],distefano:[2,4,6,10],distribut:[0,2,6,9],distribution_funct:[10,11],distributoon:2,divid:9,dlnm1:[6,13],dlog10per:13,dlogp:2,doc:[4,7,10,14],doc_fetch:2,docstr:[10,12,14],document:[4,7,8,11],doe:[0,2,4,6,8,18],doesn:[6,8],doesnt:[5,7],doing:[0,1,6,7,10,14],don:8,done:[0,4,5,6,10,13,14],donm:13,donor:[0,18],donor_limit_dynamical_multipli:0,donor_limit_envelope_multipli:0,donor_limit_thermal_multipli:0,donor_rate_algorithm_bs:0,donor_rate_algorithm_claeys2014:0,dont:[2,4,5,6],dphasevol:[6,13],dr2:0,dr3:0,drai:0,dredg:0,dstep:2,dtfac:0,dtlimit:4,dtm:[1,13],dtype:5,due:[10,14],dummi:[2,12],dump:[0,4],dumpvers:0,duquennoi:2,duquennoy1991:2,dure:0,dust:0,dwarf:0,dynam:0,e2_hurley_2002:0,e2_izzard:0,e2_mint:0,e2_prescript:0,each:[0,2,4,6,8],eagb:0,eagb_wind_beasor_etal_2020:0,eagb_wind_bs:0,eagb_wind_goldman_etal_2017:0,eagbwind:0,eagbwindfac:0,earli:0,early_asymptotic_giant_branch:0,easi:4,easier:[4,5],ecc2:2,ecc3:2,ecc:[2,5,6],eccentr:[0,2,5,12,13,18],eccentric_rlof_model:0,eccentricity_quadrupl:0,eccentricity_tripl:0,echo:0,eddington:0,edg:[0,6],edu:0,effect:[0,2,8],effective_metal:0,effici:0,egg:[10,14],eggleton:[0,18],either:[0,4,5,6,8,10,14,15],eject:0,eld:0,eldridg:0,electon:0,electron:0,element:[0,1,4,8,12],email:4,emp:0,emp_feh_maximum:0,emp_logg_maximum:0,emp_minimum_ag:0,empti:[4,7],enabl:0,encod:4,encount:8,end:[0,2,4,8,13],end_index:2,energi:0,enhanc:0,enlarg:0,enough:2,ensembl:[0,4,6,8],ensemble_def:0,ensemble_dictionari:6,ensemble_dt:0,ensemble_factor_in_probability_weighted_mass:8,ensemble_filter_:0,ensemble_filters_off:0,ensemble_json:4,ensemble_legacy_ensembl:0,ensemble_list:6,ensemble_logdt:0,ensemble_logtim:0,ensemble_macro:0,ensemble_output_:8,ensemble_startlogtim:0,ensure_ascii:4,enter:[0,10,14],enthalpi:0,entir:5,entri:4,entrypoint:6,env:[10,12,14],envelop:0,equal:[4,13],equat:0,equation_of_state_algorithm:0,equation_of_state_paczynski:0,equatori:0,equival:8,errno:[10,14],error:[0,4,8,10,14],esa:2,escap:0,escape_fract:0,escape_veloc:0,eta:0,etal:0,etc:[0,4,6,9,10,12,13,14,15],euler:0,evalu:[2,6,18],evan:0,evapor:0,evaporate_escaped_orbiting_object:0,event:0,everi:[0,10,14],everyth:[6,8,13],everytim:[10,14],evid:0,evolut:[0,1,5,6,8,12],evolution_split:0,evolution_splitting_maxdepth:0,evolution_splitting_sn_eccentricity_threshold:0,evolution_splitting_sn_n:0,evolution_typ:8,evolutionari:0,evolv:[0,6,8,13],evolve_popul:[6,13],evolve_singl:[6,13],exact:[1,4,8],exactli:0,exampl:[1,2,4,6,15],example_head:4,example_header_1:5,example_header_2:5,example_log:15,example_log_co:1,example_parse_output:[4,5],example_pop:13,example_python_population_result:13,exce:[0,8],except:[4,6,7,8,12],execut:[0,6,8,10,13,14],exist:[0,6,7,13],exist_ok:[4,13],exit:[0,4],exp:[6,13],expand:15,expect:[10,14],experiment:[0,4],explain:4,explicilti:1,explicitli:0,explod:0,explos:0,expoenti:0,expon:0,export_all_info:[6,13],express:0,extend:[10,14],extern:0,extra:[0,6,8,15],extra_text:7,extract:[4,13],extract_ensemble_json_from_str:4,extrapol:[2,8],fabian:0,fabian_imf_log:0,fabian_imf_log_tim:0,fabian_imf_log_timestep:0,factor:[0,2,4,8],fade:0,fail:[0,4,8,10,14],fail_sil:4,failed_system:8,failed_system_log:8,failed_systems_threshold:8,failur:0,fals:[0,4,6,8,12,13],fancy_parsing_funct:15,far:0,farmer:0,fase:13,fast:0,feed:8,ferguson:0,few:0,field:0,fig:[0,2],figur:[8,12],file:[0,1,4,6,7,8,9,10,12,13,14],file_log:0,filehandl:7,filenam:[0,1,4,5,6,8,13,15],filenotfounderror:[10,14],filepath:[1,4],filesystem:4,fill:6,fill_data:2,filter:[0,4],filter_arg_dict:4,filter_valu:4,fin:0,find:[4,6,8,10,14],finish:[4,12],first:[0,2,4,6,10,14,18],first_giant_branch:0,fishlock:0,fit:[0,2,4,6,18],fix:[0,2,4,6,12],flag:[0,1,4,8],flash:0,flat:[2,8],flatsect:[2,13],flaw:6,float64:5,float_overflow_check:0,flto:[10,14],fold:2,follow:[0,2,4,8,10,12,14],forc:[0,10,14],force_circularization_on_rlof:0,force_corotation_of_primary_and_orbit:0,forloop:6,form:[0,4,6,7],formal:0,format:[0,2,4,5,6,13],format_ensemble_result:6,formula:0,forward:0,found:[2,10,14],four:0,fpic:1,fraction:[0,2,8],frequenc:0,friction:0,fring:0,from:[0,2,4,5,6,8,12,13,18],from_binary_c_config:1,from_dict:5,ftz:[10,14],full:[4,6,8],full_path:4,fulli:[6,13],func_memaddr:5,functon:6,further:2,fuv:0,gaia:[0,2],gaia_colour_transform_method:0,gaia_conversion_ubvri_bivariate_jordi2010:0,gaia_conversion_ubvri_riello2020:0,gaia_conversion_ubvri_univariate_evans2018:0,gaia_conversion_ubvri_univariate_jordi2010:0,gaia_conversion_ugriz_bivariate_jordi2010:0,gaia_conversion_ugriz_riello2020:0,gaia_conversion_ugriz_univariate_evans2018:0,gaia_conversion_ugriz_univariate_jordi2010:0,gaia_l_binwidth:0,gaia_teff_binwidth:0,gain:8,galact:0,gallino:0,gamma:0,gap:0,garcia:0,gauss:0,gaussian:2,gaussian_func:2,gaussian_normalizing_const:2,gb_reimers_eta:0,gb_wind_beasor_etal_2020:0,gb_wind_goldman_etal_2017:0,gb_wind_reim:0,gb_wind_schroeder_cuntz_2005:0,gbwind:0,gbwindfac:0,gcc:[1,10,14],gce:0,gener:[0,1,2,4,5,6,7,8,12,13],general_info:4,geometr:0,gerosa:0,get:[0,2,4,5,6,7,10,13,14,15,18],get_arg_kei:4,get_default:4,get_help:[4,13],get_help_al:[4,6,13],get_help_sup:4,get_integration_constant_q:2,get_max_multipl:2,get_moe_distefano_dataset:4,get_siz:4,get_stream_logg:6,gettempdir:5,giant:0,giant_branch:0,git:[0,4],git_branch:4,git_build:4,github:4,gitlab:10,give:[0,2,4,5,18],given:[0,1,2,4,5,6,8,15,18],globablli:2,global:[0,2],global_dict:2,gmax:2,gmin:2,goe:[0,4,6,12],gogo:0,going:[10,14],goldman:0,gonna:2,good:[0,8,13,18],gov:0,gravit:0,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,gravitational_radiation_modulator_:0,gravitational_radiation_modulator_j:0,gravitational_radiation_non:0,grb:0,great:0,greater:0,grevess:0,grid:[0,4,6,10,11,13],grid_class:[10,11],grid_cod:6,grid_opt:[6,8,13],grid_options_default:7,grid_options_defaults_dict:7,grid_options_descript:7,grid_options_description_check:7,grid_options_help:7,grid_vari:[8,13],grid_variable_numb:6,gridcod:6,gridcode_filenam:8,gridtyp:6,group:4,gsl:[10,14],gsl_dir:[10,14],guess:[0,2],h5py:[10,14],hachisu:0,hachisu_disk_wind:0,hachisu_ignore_qcrit:0,hachisu_qcrit:0,hack:7,had:6,half:0,hall:0,handi:0,handl:[0,4,6,8,13,15,18],handle_ensemble_string_to_json:4,happen:0,has:[0,1,4,5,6,8],have:[0,2,4,5,6,7,8,10,12,13,14],hbb:0,hbbtfac:0,hdf5:[4,13],hdf5file:4,header:[1,4,5,13],headerlin:13,headlin:8,hegb:0,hehg:0,height:[2,13],helium:0,helium_flash_mass_loss:0,helium_white_dwarf:0,help:[0,4,7,13],help_al:0,hem:0,henc:0,hendrik:[10,14],here:[1,4,5,6,8,12,13],hertzsprung:0,hertzsprung_gap:0,hertzstrpung:0,heuvel:0,hewd:0,hewd_hewd_ignition_mass:0,hex:8,high:[0,2],higher:[0,2,4,8,10,14],highest:6,his:2,histori:2,hold:8,hole:0,homogen:0,hopefulli:0,hot:0,how:[0,4,5,6,8],howev:0,hoyl:0,hpc:[6,9],hpc_function:[10,11],hr_diagram:12,hrd:0,hrdiag:0,hrdiag_output:0,html:[10,14],http:[0,1,2,4],hurlei:0,hut:0,hybrid:0,hydro:0,hydrogen:0,ibc:0,idea:12,idum:0,ignit:0,ignor:[0,5,6,8,10,14],iia:0,imf:[0,2],imf_chabrier2003:2,imf_scalo1986:2,imf_scalo1998:2,imf_tinsley1980:2,immedi:0,implement:[0,6,8],impli:0,impos:13,improv:2,inclin:0,inclination1:0,inclination2:0,inclination3:0,inclination4:0,inclini:0,incliniation_quadrupl:0,incliniation_tripl:0,includ:[0,1,2,4,5,6,10,12,14],include_binary_c_default:[6,13],include_binary_c_help_al:[6,13],include_binary_c_version_info:[6,13],include_default:6,include_popul:13,include_population_set:6,incom:0,increas:0,inde:0,indent:4,index:[0,2,10],indic:[0,2],individual_nova:0,induc:0,inertia:0,info:[4,6,10,12,13,14],inform:[0,1,4,6,7,12,13],init:6,init_abund:0,init_abund_dex:0,init_abund_mult:0,init_abunds_onli:0,initi:[0,2,6],initial_abundance_hash:6,initial_abundance_mix:0,initial_abunds_onli:0,inlin:5,inner:0,input:[1,2,4,6,8,10,12,18],input_dict:4,insert:6,insid:0,inspect:[4,12,13],inspect_dict:4,inspir:[1,5,12,18],instabl:0,instanc:[4,13],instant:0,instantli:0,instead:[0,4,8],integ:[0,6,8,18],integr:2,integrals_str:2,interact:[0,7],interfac:[4,10,14],interfer:[10,14],intern:[0,8],internal_buff:0,internal_buffering_off:0,internal_buffering_print:0,internal_buffering_stor:0,interpol:[2,6],interpolate_in_mass_izzard2012:2,interpolator_nam:2,intershel:0,interstellar:0,intger:0,intro:0,invers:18,involv:0,inward:0,is_capsul:4,isn:[4,6],isnt:13,isotop:[0,4],isotope_hash:6,isotope_list:6,item:1,iter:4,its:[0,4,6,7,10,12,14,15],itself:[4,8,10,14],iwamoto:0,izzard2012_period_distribut:2,izzard:[0,10,14],jager:0,jaschek:2,jeff:[10,14],jia:0,job_queu:6,john:0,join:13,jordi:0,json:[4,6,8,13],jsondecod:4,jsonencod:4,jul:0,jupyt:[10,14],just:[0,2,4,5,6,8,18],kap:0,kappa:0,kaps_rentrop:0,karaka:0,keep:6,kei:[1,2,4,6,7,8,12],kelvin:0,keplerian:0,keypair:4,keyword:[12,15],kick:[0,8],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,13],kim:0,kind:0,kippenhahn:0,know:[0,1,6,7],known:[0,2,6,13,15],kroupa2001:[2,6],kroupa:2,ktg93:2,kwarg:[6,12,15],lambda:0,lambda_c:0,lambda_ce_dewi_tauri:0,lambda_ce_klencki_2020:0,lambda_ce_polytrop:0,lambda_ce_wang_2016:0,lambda_enthalpi:0,lambda_ionis:0,lambda_min:0,lambda_mult:0,lambda_multipli:0,lambda_v:2,lamer:0,landau:0,langer:0,larger:0,last:[2,6],last_grid_vari:6,late:5,latter:0,law:2,lbv:0,ld_library_path:[10,14],lead:0,least:[10,14],leav:0,left:0,legaci:0,legacy_yield:0,len:13,lengthen:0,less:[0,1,2],let:6,level:[1,4,6],li7:0,lib:[5,10,14],libbinary_c:8,libgsl:[10,14],libmemo:[10,14],librari:[0,1,5,6,8,15],library_path:[10,14],librinterpol:[10,14],lies:0,lifetim:0,lifshitz:0,like:[0,1,4,5,6,8,10,12,14,16],limit:[0,12],line:[1,4,5,6,8,10,12,14],linear2:8,linear:[0,2,8],linear_extrapolation_q:2,linearli:[6,16],linker:1,linspac:16,list:[0,1,2,4,8,15,16],list_arg:0,list_of_sub_kei:2,lit:0,lithium:0,lithium_gb_post_1dup:0,lithium_gb_post_heflash:0,lithium_hbb_multipli:0,lithium_t:0,littleton:0,liu:0,llnl:0,lnm1:[6,13],load:[0,1,4,5,6,8,12,13],load_logfil:4,lobe:[0,18],local:2,locat:[0,2,8,10,14],lodder:0,log10:[0,2,13],log10m1:8,log10p:2,log10per:13,log10pmin:2,log:[0,1,2,5,6,8,10,12,13,14,15,18],log_arg:8,log_args_dir:8,log_fil:8,log_filenam:[0,5,15],log_runtime_system:8,logarithm:2,logensembletim:0,logfil:[4,10,14,15],logg:0,logger:6,logging_dict:1,logging_lin:5,logic:[1,6,8],logmass:2,logp:2,logper:2,logperiod:2,long_spectral_typ:2,longer:0,longnam:[6,13],look:[1,4,10,14],lookback:0,loon:0,loop:6,loos:12,lose:0,loss:0,lost:0,lot:[4,15],low:[0,2,13],low_mass_m:0,low_mass_main_sequ:0,lower:[0,2,6,16],lsoda:0,lsun:[0,12],lugaro:0,luminos:[0,12],luminosity_1:12,luminosity_2:12,lynnett:0,m_1:[0,5,6,13,15],m_2:[0,5,13],m_3:0,m_4:0,m_max:[2,6],m_min:6,m_re:5,maccretor:0,machin:[8,10,14],macro:[0,4],madau:2,maeder:0,magellan:0,magnet:0,magnetic_braking_algorithm:0,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,magnetic_braking_gamma:0,magnitud:4,mai:0,main:[0,1,8,10,14],main_sequ:0,mainli:9,major:0,make:[0,1,2,4,5,6,8,10,12,13,14,15],make_build_text:4,makedir:[4,13],manag:[4,10,14],mani:[0,6,8],manufactur:0,map:8,maria:0,mass:[0,1,2,4,5,6,8,12,13,15,18],mass_1:[5,12],mass_2:[5,12],mass_accretion_for_eld:0,mass_accretor:18,mass_donor:18,mass_evolut:12,mass_for_hestar_ia_low:0,mass_for_hestar_ia_upp:0,mass_of_pmz:0,mass_str:2,massiv:[0,2],massless:0,massless_remn:0,master:[8,12],match:[0,4,12],materi:0,math:[6,13],matplotlib:[10,12,14],matter:0,mattsson:0,mattsson_mass_loss:0,mattsson_orich_tpagbwind:0,max:[0,2,13],max_bound:[2,16],max_evolution_tim:[0,1,5,13],max_hewd_mass:0,max_model_numb:0,max_multipl:2,max_neutron_star_mass:0,max_queue_s:8,max_stellar_angmom_chang:0,max_stellar_type_1:0,max_stellar_type_2:0,max_stellar_type_3:0,max_stellar_type_4:0,max_val:2,maximum:[0,2,8,18],maximum_mass_ratio_for_instant_rlof:0,maximum_mass_ratio_for_rlof:18,maximum_mcbagb_for_degenerate_carbon_ignit:0,maximum_nuclear_burning_timestep:0,maximum_timestep:0,maximum_timestep_factor:0,maxmimum:0,maxwellian:0,mayb:12,mayor:2,mc13_pocket_multipli:0,mch:0,mcmin:0,mdonor:0,mean:[0,2,4,6,8,10,14],meant:8,measur:4,medium:0,megaparsec:2,memaddr:5,memori:[1,5,6,8,18],menv:0,merg:[0,2,4,8],merge_dict:4,merge_multipl:2,merger:0,merger_angular_momentum_factor:0,merger_mass_loss_fract:0,mesa:[10,14],mesasdk_init:[10,14],mesasdk_root:[10,14],messag:4,mestel:0,met:6,metal:[0,2,5,18],method:[0,5,6,8],meynet:0,might:[4,6,10,14],milki:0,miller:0,min:[2,13],min_bound:[2,16],min_p:2,min_per:2,min_val:2,mind:5,minimal_verbos:4,minimum:[0,2,4,8,18],minimum_co_core_mass_for_carbon_ignit:0,minimum_co_core_mass_for_neon_ignit:0,minimum_donor_menv_for_comenv:0,minimum_envelope_mass_for_third_dredgeup:0,minimum_helium_ignition_core_mass:0,minimum_mcbagb_for_nondegenerate_carbon_ignit:0,minimum_orbital_period_for_instant_rlof:0,minimum_period_for_rlof:18,minimum_separation_for_instant_rlof:0,minimum_separation_for_rlof:18,minimum_time_between_pn:0,minimum_timestep:0,mint:0,mint_data_cleanup:0,mint_dir:0,mint_disable_grid_load_warn:0,mint_kippenhahn:0,mint_kippenhahn_companion_stellar_typ:0,mint_kippenhahn_stellar_typ:0,mint_maximum_shell_mass:0,mint_metal:0,mint_minimum_shell_mass:0,mint_ms_rejuven:0,mint_nuclear_burn:0,mint_remesh:0,mint_use_zams_profil:0,mira:0,misc:10,miscellan:4,miss:[0,4,7],mix:[0,4,8],mixtur:0,mmax:2,mmin:[2,8],mnra:18,model:[0,1,5,8,13],modifi:0,modul:[0,7,8,11],modulo:8,moe:[2,4,6,10],moe_de_stefano_2017:6,moe_de_stefano_2017_multiplicity_fract:2,moe_de_stefano_2017_pdf:2,moment:[0,13,16],momenta:[0,12],momentum:0,mont:0,monte_carlo_kick:0,montecarlo:8,more:[0,1,4,5,6,8,10,12,14,16],most:4,mostli:[4,5,7,8,12,13,15],move:0,msun:[0,2,5],much:[0,4],mulitpli:8,multipl:[0,2,4,8],multiplc:0,multipli:[0,4,8],multiplicity_arrai:2,multiplicity_fraction_funct:8,multiplicity_model:8,multiplicity_modul:8,multiplicti:8,multiply_values_dict:4,multiprocess:[6,8],multithread:8,must:[0,2],my_header_lin:13,my_sss2:5,my_stellar_data:[1,5,13],myr:[0,5],n100:0,n100_z0:0,n100h:0,n100l:0,n10:0,n150:0,n1600:0,n1600c:0,n200:0,n20:0,n300c:0,n40:0,naked_helium_star_giant_branch:0,naked_helium_star_hertzsprung_gap:0,naked_main_sequence_helium_star:0,name:[1,4,5,6,7,13,15,17],natur:0,nauenberg:0,nearer:0,nebula:0,necessari:[4,5,6,13],need:[0,2,5,6,10,13,14],neg:[0,4],neither:[0,6],neleman:0,nelemans_gamma:0,nelemans_max_frac_j_chang:0,nelemans_minq:0,nelemans_n_comenv:0,nelemans_recalc_eccentr:0,nemp:0,nemp_cfe_minimum:0,nemp_nfe_minimum:0,nenamg:0,neon:0,nest:[4,6],network:0,neutrn:0,neutron:[0,13],neutron_star:0,never:0,newer:[0,2],newli:0,newopt:2,newton:0,next:4,nice:[1,6,12,13],nieuwenhuijzen:0,nieuwenhuijzen_windfac:0,nmax:2,no_thermohaline_mix:0,noecho:0,noechonow:0,noel:0,nolowq:8,nomin:0,non:[0,8],nonconservative_angmom_gamma:0,none:[0,1,2,4,5,6,7,8,18],nonzero:8,nor:0,norm:8,normal:[0,2,4,8],normalis:2,normalize_dict:2,normalize_multipl:8,note:[0,5,8],notebook:[10,14],noth:[6,8],notifi:15,nova:0,nova_faml_multipli:0,nova_irradiation_multipli:0,nova_retention_algorithm_claeys2014:0,nova_retention_algorithm_const:0,nova_retention_algorithm_hillman2015:0,nova_retention_fract:0,nova_retention_method:0,nova_timestep_accelerator_index:0,nova_timestep_accelerator_max:0,nova_timestep_accelerator_num:0,now:[0,2,4,5],nuclear:0,nuclear_mass_hash:6,nuclear_mass_list:6,nucleosynthesi:[0,4],nucleosynthesis_sourc:4,nucreacmult:0,nucsyn:10,nucsyn_angelou_lithium:0,nucsyn_gce_outflow_check:0,nucsyn_hbb:0,nucsyn_metal:0,nucsyn_network:0,nucsyn_network_error:0,nucsyn_s_process:0,nucsyn_solv:0,nucsyn_third_dredge_up:0,nugi:0,number:[0,2,4,5,6,8,10,14],numer:4,numpi:[4,5,10,14,16],obj:4,object:[0,4,6,8,9,12,13],object_hook:4,object_pairs_hook:4,obtain:0,occur:[0,18],ofcours:12,off:[0,5,13],offset:0,ohio:0,old:8,old_solut:[10,14],omega:0,onc:0,one:[0,4,5,6,8,12],onewd:0,onli:[0,4,5,6,8,18],onset:0,onto:[0,2],opac:0,opacity_algorithm:0,opacity_algorithm_ferguson_op:0,opacity_algorithm_paczynski:0,opacity_algorithm_star:0,opal:0,open:13,opm:2,opt:[2,4],option:[0,1,2,4,5,6,10,11,13,14,18],orb:6,orbit:[0,2,12,13,18],orbit_evolut:12,orbital_inclin:0,orbital_inclinationi:0,orbital_period:[0,5,13,18],orbital_period_quadrupl:0,orbital_period_tripl:0,orbital_phas:0,orbital_phase_quadrupl:0,orbital_phase_tripl:0,orbiting_object:0,orbiting_objects_close_pc_threshold:0,orbiting_objects_log:0,orbiting_objects_tides_multipli:0,orbiting_objects_wind_accretion_multipli:0,order:[4,5,6],ordereddict:4,org:[0,2],origin:[10,14],other:[0,1,2,4,7,8,10,12,13,14],otherwis:[0,6,7,8],out:[4,7,8],outcom:0,outer:0,outfil:[6,13],outfile_nam:1,outfilenam:13,output:[1,4,5,6,8,10,12,13,14,15,18],output_dir:6,output_fil:[4,7],output_filenam:6,output_lin:[4,13],outsid:[0,2],outward:0,over:[4,6,13],overflow:0,overlap:4,overrid:[2,5],overriden:13,overshoot:0,overspin_algorithm:0,overspin_bs:0,overspin_massloss:0,own:[5,6,8,10,14],oxygen:0,oxygen_neon_white_dwarf:0,pack:13,packag:[4,10,14,16],paczynski:0,page:[0,10,14],pair:[0,4],panda:[4,5,10,12,14],pane:12,panel:0,paper:0,param_nam:4,paramet:[1,2,4,6,7,8,10,12,13,15,16,18],parameter_nam:[4,6,13],parameter_value_input_typ:4,pars:[4,5,6,12,13,15],parse_binary_c_version_info:4,parse_cmdlin:6,parse_const:4,parse_float:4,parse_funct:[6,8,13,15],parse_function_hr_diagram:12,parse_function_mass:12,parse_function_orbit:12,parse_int:4,parse_output:5,part:[2,5,6,18],partial:0,particularli:0,pasp:2,pass:[5,6,8,10,12,14,15],path:[4,8,10,13,14],patho:[10,14],pdf:[0,2,10,14],pend:0,per:[0,4,6,8,13,18],percentag:0,peret:0,perform:0,perhap:0,periastron:0,pericent:18,period:[0,2,5,12,13,18],period_str:2,perl:1,pgo:0,phase:0,phasevol:0,phdi:0,photoevapor:0,php:2,physic:13,pick:12,piec:[5,6],pinnsonneault:0,pisn:0,pkg:[10,14],place:0,placehold:12,plai:[0,6],plan:8,planetari:0,plaw2:8,pleas:[0,4],plot:[0,5,12],plot_funct:[10,11],plot_hr_diagram:12,plot_hr_diagram_singl:12,plot_mass:12,plot_orbit:12,plot_system:12,plot_typ:12,pls:6,plu:0,pms:12,pms_mass_1:12,pms_mass_2:12,pn_comenv_transition_tim:0,pn_fast_wind:0,pn_fast_wind_dm_agb:0,pn_fast_wind_dm_gb:0,pn_fast_wind_mdot_agb:0,pn_fast_wind_mdot_gb:0,pn_hall_fading_time_algorithm:0,pn_hall_fading_time_algorithm_maximum:0,pn_hall_fading_time_algorithm_minimum:0,pn_resolv:0,pn_resolve_maximum_envelope_mass:0,pn_resolve_minimum_effective_temperatur:0,pn_resolve_minimum_luminos:0,pne:0,pogg:0,point:[0,2,4,10,14],poisson:[2,8],pol:0,polytrop:0,popuation_id:8,popul:[0,2,6,7,9,10,14,16],population_set:6,posit:[0,2],possibl:[0,1,2,4,7,10,14],post:0,post_ce_adaptive_menv:0,post_ce_envelope_dm_eagb:0,post_ce_envelope_dm_gb:0,post_ce_envelope_dm_tpagb:0,post_ce_objects_have_envelop:0,post_sn_orbit_bs:0,post_sn_orbit_method:0,post_sn_orbit_tt98:0,postagb_legacy_log:0,potenti:0,power:[0,2],powerlaw:2,powerlaw_const:2,powerlaw_extrapolation_q:2,ppisn:0,ppisn_farmer19:0,ppisn_non:0,ppisn_prescript:0,ppn_envelope_mass:0,pre:[0,12],pre_events_stardata:0,pre_main_sequ:0,pre_main_sequence_fit_lob:0,precis:4,precod:[6,13],predefin:2,predict:8,predictor:0,prefer:[0,6],prefix:0,preload:12,prepar:2,prepare_dict:2,prescript:0,prescrit:0,present:[2,4,6,13],preserv:0,preset:12,pressur:0,prevent:[0,8],previou:4,previous_stardata:1,primari:[1,2,6,13,18],print:[4,5,7,8,13],print_help:4,print_info:7,print_option_descript:7,print_structur:4,printf:[1,5,13],prior:0,privat:[6,7,10],prob_dict:2,probability_weighted_mass:8,probabl:[0,1,2,6,7,8,13],probdist:[6,13],problabl:12,problem:0,process:[0,4,5,6,8],profil:0,progenitor:0,program:[10,14],project:0,proper:7,properli:0,properti:[0,4,8,12],prot1:0,prot2:0,prot3:0,prot4:0,provid:[0,2,6,8,13,15],pseudorandom:0,puls:[0,18],pulsat:0,pump:0,purpos:[8,12],put:[1,4,5,6,8,12,13],py_rinterpol:[10,14],pyenv:[10,14],pysiz:4,pytest:[10,14],python3:[5,10,14],python:[4,5],q_high_extrapolation_method:8,q_interpol:2,q_low_extrapolation_method:8,qcrit_bh:0,qcrit_bs:0,qcrit_cheb:0,qcrit_chen_han_formula:0,qcrit_chen_han_t:0,qcrit_cowd:0,qcrit_degenerate_bh:0,qcrit_degenerate_cheb:0,qcrit_degenerate_cowd:0,qcrit_degenerate_eagb:0,qcrit_degenerate_gb:0,qcrit_degenerate_hegb:0,qcrit_degenerate_hehg:0,qcrit_degenerate_hem:0,qcrit_degenerate_hewd:0,qcrit_degenerate_hg:0,qcrit_degenerate_lmm:0,qcrit_degenerate_m:0,qcrit_degenerate_n:0,qcrit_degenerate_onewd:0,qcrit_degenerate_tpagb:0,qcrit_eagb:0,qcrit_gb:0,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,qcrit_hehg:0,qcrit_hem:0,qcrit_hewd:0,qcrit_hg:0,qcrit_hjellming_webbink:0,qcrit_lmm:0,qcrit_m:0,qcrit_n:0,qcrit_onewd:0,qcrit_q_no_comenv:0,qcrit_temmink2021:0,qcrit_tpagb:0,qcrit_vos2018:0,qcrits_:0,qcrits_degenerate_:0,qdata:2,qlimit:2,quad:8,quadrat:0,quadrulpl:0,quadrupl:[0,2,8],quantiti:12,queue:[6,8],quit:[0,4],r_l:18,radi:0,radiat:0,radii:[0,18],radiu:[0,1,12,13,18],radius_1:12,radius_2:12,ragb:18,raghavan2010_binary_fract:2,raghavan:2,rai:0,railton:0,rais:[0,4,8,13],ram:0,ran:8,random:[0,8],random_se:0,random_skip:0,random_system:0,random_systems_se:0,rang:[0,2,6,8,16],rapidli:0,rappaport:0,rate:[0,2],rather:[0,4,6,8,10,14],ratio:[0,2,13,18],raw:[4,5,6,8,12,15],raw_output:4,reach:0,reaction:0,read:4,real:6,realli:[0,6,7,8],reason:0,rebuild:[0,10,14],rebuilt:[10,14],recalcul:0,reciev:4,recombin:0,recommend:[1,6],recompil:[10,14],recurs:[4,6],recursive_change_key_to_float:4,recursive_change_key_to_str:4,red:0,redhat:1,redshift:2,reduc:0,reduct:8,regardless:12,region:0,reignit:0,reimer:0,reinstal:[10,14],reject:0,rejects_in_log:0,rejuven:0,rel:0,relat:0,releas:[4,10,14],remain:0,remesh:0,remnant:0,remov:[0,4,6],remove_fil:4,renorm:2,rentrop:0,repeat:[0,8],repo:[10,14],report:0,repres:8,represent:[4,6],reproduc:0,requir:[0,2,4,5,12,13,15],reset:0,reset_pref:0,reset_star:0,reset_stars_default:0,resolut:[0,6,8,13],resolv:0,reson:0,respect:[0,2],respons:6,rest:[2,6],restructuredtext:4,result:[0,1,2,4,5,6,8,10,13,14],result_arrai:2,result_dict:2,result_example_head:5,result_example_header_1:5,result_example_header_2:5,retain:0,rethink:4,return_all_info:6,return_binary_c_version_info:[4,6],return_compilation_dict:1,return_help_al:4,return_maximum_mass_ratio_for_rlof:18,return_minimum_orbit_for_rlof:18,return_population_set:6,return_version_info:4,revap_in:0,revap_out:0,revers:[0,12],reverse_tim:0,revis:[0,4],rewrit:6,rhagavan:8,rich:0,riello:0,rin:0,ring:0,risk:6,ritter:0,rk2:0,rk4:0,rlof:[0,18],rlof_angular_momentum_transfer_model:0,rlof_angular_momentum_transfer_model_bs:0,rlof_angular_momentum_transfer_model_conserv:0,rlof_eccentric_as_circular:0,rlof_entry_threshold:0,rlof_f:0,rlof_interpolation_binary_c:0,rlof_interpolation_bs:0,rlof_interpolation_method:0,rlof_mdot_factor:0,rlof_mdot_modul:0,rlof_method:0,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,rlof_transition_objects_escap:0,rob:[0,2,18],robert:[10,14],roch:[0,18],roche_lob:18,rochelob:18,room:6,root:[10,14],rotat:[0,2],rotation:0,rotationally_enhanced_expon:0,rotationally_enhanced_mass_loss:0,rotationally_enhanced_massloss:0,rotationally_enhanced_massloss_angmom:0,rotationally_enhanced_massloss_langer_formula:0,rotationally_enhanced_massloss_langer_formula_and_angmom:0,rotationally_enhanced_massloss_non:0,rout:0,routin:[0,5,6,12],row:12,rring:0,rssd:2,rst:[4,7],rsun:12,rubric:6,run:[0,1,4,5,6,8,10,13,14,15],run_example_binari:5,run_example_binary_with_custom_log:5,run_example_binary_with_run_system:5,run_example_binary_with_writing_logfil:5,run_example_custom_logging_autogener:5,run_system:[5,12,15],run_system_wrapp:[5,10,11],run_zero_probability_system:8,runtim:[1,8],russel:0,rzam:18,s_option:8,sai:0,said:0,same:[0,4,5,8,10,13,14],sampl:[0,2,6,16],sample_valu:2,sampler:10,sana12:[2,13],sana:2,save:[0,1,2,13],save_pre_events_stardata:0,scalo:2,scanf:0,scene:5,scheme:0,schneider:0,schroeder:0,script:[3,5,10,14],sdb:0,sdist:[10,14],sdo:0,search:10,second:[0,2,4,12],secondari:[2,18],section:[2,4,9,10,14],see:[0,5,6,10,12,14],seed:0,seem:[10,12,14],seen:4,segment:16,seitenzahl2013_model:0,seitenzahl:0,select:[0,4,5],selected_head:[4,5],selector:0,self:[6,8,13],semi:0,sent:0,sentenc:1,sep:[2,5,6,13,18],sep_max:13,sep_min:13,separ:[0,2,4,5,12,13,18],separation_quadrupl:0,separation_tripl:0,separta:0,seper:[6,7,13],sequenc:0,seri:0,serial:4,serializ:[4,6],serv:[4,5,13],server:6,set:[0,1,2,4,6,7,8,10,12,13,14],set_moe_distefano_set:6,set_opt:2,settingsfil:4,setup:[10,14,15],sever:[5,7,8,12,15],sfh:2,shara:0,share:[1,5,8,15],shared_lib_filenam:5,shell:0,shorten:0,should:[0,1,2,5,6,7,8,10,12,13,14,15],shouldn:[0,4],show:[0,3,8,12],show_plot:12,show_stellar_typ:12,shown:[0,12],siess:0,sigma:2,silent:4,sill:0,simpl:13,simpli:0,simul:[0,1,13],simulation_:6,sinc:[4,12,13],singl:[0,2,6,8,12,13],sit:0,size:[4,6,8],skip:[0,4,8,10,14],skipkei:4,sliced_df:5,slope:2,slow:0,slower:0,slurm:[6,8,9],slurm_grid:6,small:0,small_envelope_method:0,small_envelope_method_bs:0,small_envelope_method_miller_bertolami:0,smaller:0,sn_impulse_liu2015:0,sn_impulse_non:0,sn_impulse_wheeler1975:0,sn_kick_companion_a:0,sn_kick_companion_aic_bh:0,sn_kick_companion_bh_bh:0,sn_kick_companion_bh_n:0,sn_kick_companion_ecap:0,sn_kick_companion_grb_collapsar:0,sn_kick_companion_hestaria:0,sn_kick_companion_ia_chand:0,sn_kick_companion_ia_chand_co:0,sn_kick_companion_ia_eld:0,sn_kick_companion_ia_h:0,sn_kick_companion_ia_he_co:0,sn_kick_companion_ia_hybrid_hecowd:0,sn_kick_companion_ia_hybrid_hecowd_sublumin:0,sn_kick_companion_ibc:0,sn_kick_companion_ii:0,sn_kick_companion_iia:0,sn_kick_companion_ns_n:0,sn_kick_companion_phdi:0,sn_kick_companion_pisn:0,sn_kick_companion_ppisn:0,sn_kick_companion_tz:0,sn_kick_companion_wdkick:0,sn_kick_dispersion_aic_bh:0,sn_kick_dispersion_bh_bh:0,sn_kick_dispersion_bh_n:0,sn_kick_dispersion_ecap:0,sn_kick_dispersion_grb_collapsar:0,sn_kick_dispersion_ia_hybrid_hecowd:0,sn_kick_dispersion_ia_hybrid_hecowd_sublumin:0,sn_kick_dispersion_ibc:0,sn_kick_dispersion_ii:0,sn_kick_dispersion_ns_n:0,sn_kick_dispersion_phdi:0,sn_kick_dispersion_pisn:0,sn_kick_dispersion_ppisn:0,sn_kick_dispersion_tz:0,sn_kick_distribution_aic_bh:0,sn_kick_distribution_bh_bh:0,sn_kick_distribution_bh_n:0,sn_kick_distribution_ecap:0,sn_kick_distribution_grb_collapsar:0,sn_kick_distribution_ia_hybrid_hecowd:0,sn_kick_distribution_ia_hybrid_hecowd_sublumin:0,sn_kick_distribution_ibc:0,sn_kick_distribution_ii:0,sn_kick_distribution_ns_n:0,sn_kick_distribution_phdi:0,sn_kick_distribution_pisn:0,sn_kick_distribution_ppisn:0,sn_kick_distribution_tz:0,sneia:0,snia:0,solar:[0,18],solarmass:2,solver:0,solver_forward_eul:0,solver_predictor_corrector:0,solver_rk2:0,solver_rk4:0,some:[0,1,2,5,6,8,10,12,13,14],someth:[0,6],soon:16,sort:4,sort_kei:4,sourc:[1,2,3,4,5,6,7,8,11,12,13,15,16,18],source_file_filenam:8,source_list:6,sourcecod:[10,14],sourcefile_nam:1,space:[0,6,16],spacing_funct:[10,11],spacingfunc:[6,13],spacingfunct:6,special:0,specif:[0,4,12],specifi:[0,8],spectral:2,speed:[0,8],speedtest:0,spent:4,spheric:0,spin:0,spinrat:0,split:[0,8,13],splitpoint:0,spread:6,sqrt:0,src:[10,14],st1:5,st2:5,stabil:0,stabl:0,stancliff:0,standard:[0,2],star:[1,2,5,6,8,10,12,13,18],star_with_no_mass:0,stardata:[0,1,5,13],stardata_dump_filenam:0,stardata_load_filenam:0,start:[0,1,4,5,6,7,8],start_tim:0,state:0,statement:[1,5],statist:0,statu:[0,1],stderr:0,stdout:4,steadi:0,stefan:12,stellar:[0,2,8,12,17],stellar_structure_algorithm:0,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,10,11,12,13],stellar_type_1:[0,12],stellar_type_2:[0,12],stellar_type_3:0,stellar_type_4:0,stellar_type_dict:17,stellar_type_dict_short:17,step:[6,12,16],stepsiz:6,stick:8,stiff:0,still:[1,8],stop:[0,4],stopfil:0,storag:0,store:[0,2,4,6,8,10,14,18],store_memaddr:18,str:[1,4,6,7,12],straight:6,straniero:0,streamhandl:6,strength:0,strict:4,string:[0,1,4,6,7,8,12,15],strip:0,stronger:0,struct:0,structur:[0,4,8,12],stuff:[4,8,12,13],style:0,sub:[0,4],subdict:4,subdirectori:4,subject:0,sublumin:0,submit:10,subroutin:9,subsequ:0,subtract:4,subtract_dict:4,succe:0,suggest:[0,10,14],suit:[10,14],sum:0,sundial:0,supercrit:0,supernova:[0,8],superwind:0,superwind_mira_switchon:0,supress:13,sure:[2,6,8,10,12,14,15],surfac:0,surviv:0,survivor:0,switcher:0,symmetr:0,synchron:0,synonym:0,synthesi:[8,10,14],sys:5,system:[0,5,6,8,10,12,13,14,15],system_gener:6,system_queue_fil:6,t_re:5,tabl:[0,2],take:[0,2,4,5,6,8,13,15],taken:[0,4],tar:[10,14],target:[1,7],task:[0,2,4,5,6,7,9,12,15,16,18],tauri:0,tbse:0,teff:[0,2],teff_1:12,teff_2:12,tell:4,temp_dir:[4,13],temperatur:[0,2,12],tempfil:5,termin:[1,10,14],test:[0,4,6,8,10,14],test_log:5,test_pop:13,text:[4,7],than:[0,2,4,8,10,14],thats:[2,13],thei:[0,2,4,6,8,12],thelog:0,them:[2,4,5,6,13],themselv:[2,4],theres:6,thermal:[0,2,18],thermally_pulsing_asymptotic_giant_branch:0,thermohalin:0,thesi:0,thi:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,18],thick:0,thick_disc_end_ag:0,thick_disc_logg_max:0,thick_disc_logg_min:0,thick_disc_start_ag:0,thin:0,thing:[0,2,4,5,6,7,13,15],think:[0,4,6],third:[0,2],third_dup:0,third_dup_multipli:0,thorn:0,those:[4,5,6,10,13,14],thread:8,thread_id:8,three:[0,2],three_part_powerlaw:[2,13],threshold:[0,4,8],through:[6,12,15],throughout:6,tidal:0,tidal_strength_factor:0,tide:0,tides_convective_damp:0,tides_hurley2002:0,tides_zahn1989:0,time:[0,1,2,4,5,6,8,10,12,13,14],timescal:0,timestamp:8,timestep:0,timestep_limit:0,timestep_log:0,timestep_modul:0,timestep_multipli:0,timestep_solver_factor:0,tinslei:2,titl:7,tmp:[0,4,10,14],tmp_dir:[6,8],tmp_tabl:2,todo:[0,1,2,4,6,7,8,12,13,15,16,18],toler:0,too:[0,4,8,10,14,15],topic:0,torqu:0,total:[0,2,4,6,8,12],tout:[0,18],tpagb:0,tpagb_reimers_eta:0,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,tpagbwindfac:0,traceback:4,track:[8,12],trade:0,transfer:0,transform:[0,4],transit:0,treat:0,trigger:0,tripl:[0,2,8],tru:4,truli:0,tupl:1,turn:[0,4,13],two:[0,4,17,18],txt:[5,6,15],type:[0,1,2,4,6,7,8,12,16,17,18],type_ia_mch_supernova_algorithm:0,type_ia_sub_mch_supernova_algorithm:0,typic:0,ubvri:0,ugriv:0,uncom:6,under:16,undergo:0,understand:6,undescrib:7,uniform:2,union:[2,4,6,16,18],uniqu:[4,6,8],unit:[0,18],unittest:18,univari:0,unknown:15,unless:[1,6,8],unload:6,unrecogn:[10,14],unsign:0,unstabl:0,until:[0,2,4,6],unus:[0,8],updat:[2,4,6,10,13,14],update_dict:4,upper:[0,2,16],usag:0,use:[0,2,4,5,6,8,9,10,12,13,14,15],use_astropy_valu:12,use_datadir:[6,13],use_fixed_timestep_:0,use_periastron_roche_radiu:0,use_tabular_intershell_abundances_karakas_2012:0,used:[0,1,2,4,6,8,12,13],useful:[0,4,6,8,10,14,15,18],useful_func:[10,11],user:[1,2,4,6,7,8,15],userinput:4,uses:[0,5,8,13],using:[0,1,3,5,6,10,13,14],usr:5,usual:[0,2,8],util:[1,2,4,5,6,7,12,13,15,16,18],val:2,valid:[0,2,4],valu:[0,1,2,4,5,6,7,8,12,13],valueerror:13,valuerang:[6,13],van:0,vandenheuvel_log:0,vari:0,variabl:[0,4,6,8,13],variant:0,variou:0,vassiliadi:0,veloc:[0,2],verbos:[1,2,4,8,10,13,14],verbose_print:4,veri:[0,5,6,13,16],versa:18,version:[0,4,6,10,14],version_info:4,version_info_str:4,version_onli:0,via:[6,8,12,13],vice:18,vink:0,virtual:[10,14],virtualenviron:[10,14],viscos:0,viscou:0,visit:10,volum:0,vrot1:0,vrot2:0,vrot3:0,vrot4:0,vrot_breakup:0,vrot_bs:0,vrot_non_rot:0,vrot_sync:0,vw93:0,vw93_eagb_wind_spe:0,vw93_mira_shift:0,vw93_multipli:0,vw93_tpagb_wind_spe:0,vwind:0,vwind_beta:0,vwind_multipli:0,wai:[0,3,4,6,8,12,13],wang:0,want:[0,2,4,5,6,7,8,12,13],warmup_cpu:0,warn:[0,6],wave:0,wd_accretion_rate_new_giant_envelope_lower_limit_helium_donor:0,wd_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor:0,wd_accretion_rate_new_giant_envelope_lower_limit_other_donor:0,wd_accretion_rate_novae_upper_limit_helium_donor:0,wd_accretion_rate_novae_upper_limit_hydrogen_donor:0,wd_accretion_rate_novae_upper_limit_other_donor:0,wd_kick:0,wd_kick_at_every_puls:0,wd_kick_at_given_puls:0,wd_kick_direct:0,wd_kick_end_agb:0,wd_kick_first_rlof:0,wd_kick_pulse_numb:0,wd_kick_when:0,wd_sigma:0,wdwd_merger_algorithm:0,wdwd_merger_algorithm_bs:0,wdwd_merger_algorithm_chen2016:0,wdwd_merger_algorithm_perets2019:0,weight:[0,8],well:[0,4,8,10,14],were:4,what:[0,1,2,4,5,6,7,8,10,13,14,15],whatev:[5,6,10,14],wheeler:0,when:[0,1,2,4,5,6,7,8,10,13,14,15],whenev:[10,14],where:[0,1,2,4,6,7,8,10,14],whether:[0,2,4,6,7,8,12,18],which:[0,1,2,3,4,5,6,7,8,10,13,14,15,18],whichev:8,white:0,white_dwarf_cooling_carrasco2014:0,white_dwarf_cooling_mestel:0,white_dwarf_cooling_mestel_modifi:0,white_dwarf_cooling_model:0,white_dwarf_radius_carrasco2014:0,white_dwarf_radius_model:0,white_dwarf_radius_mu:0,white_dwarf_radius_nauenberg1972:0,whole:[6,8],width:0,wind:0,wind_algorithm_binary_c_2020:0,wind_algorithm_hurley2002:0,wind_algorithm_non:0,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,wind_disc_angmom_fract:0,wind_disc_mass_fract:0,wind_djorb_fac:0,wind_gas_to_dust_ratio:0,wind_lbv_luminosity_lower_limit:0,wind_mass_loss:0,wind_multiplier_:0,wind_nieuwenhuijzen_luminosity_lower_limit:0,wind_type_multiplier_:0,within:[0,4,6,10,14],without:[2,6,8],won:0,wood:0,work:[0,4,5,10,12,13,14],would:[0,4,12],wouldnt:6,wr_wind:0,wr_wind_bs:0,wr_wind_eldridg:0,wr_wind_fac:0,wr_wind_maeder_meynet:0,wr_wind_nugis_lam:0,wrap:[1,13],wrapper:[4,5,18],write:[1,4,5,6,7,8,13,15],write_binary_c_calls_to_fil:6,write_binary_c_parameter_descriptions_to_rst_fil:4,write_grid_options_to_rst_fil:7,written:[5,6,7,8,13,15],wrlof_mass_transf:0,wrlof_method:0,wrlof_non:0,wrlof_q_depend:0,wrlof_quadrat:0,wrong:[10,14],wrt:1,wrwindfac:0,wtts2:0,wtts_log:0,www:[0,2],year:[0,2],yet:[0,4,5,6,8,12,13],yield:0,you:[0,1,4,5,6,7,8,10,12,13,14,18],young:0,your:[5,8,10,14],yourself:[12,13],zahn:0,zam:[0,2,15,18],zams_collis:18,zams_mass:13,zero:[0,1,8],zero_ag:13,zone:0,zoom:0,zoomfac_multiplier_decreas:0,zoomfac_multiplier_increas:0,zsolar:2,zytkow:0},titles:["Binary_c parameters","custom_logging_functions module","distribution_functions module","Examples","functions module","Examples","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","Example of population script","Python module for binary_c","run_system_wrapper module","spacing_functions module","stellar_types module","useful_funcs module"],titleterms:{"function":4,"public":8,after:[10,14],algorithm:0,binari:0,binary_c:[0,10,14],binarycpython:11,build:[10,14],code:[8,11],custom_logging_funct:1,descript:7,distefano:8,distribution_funct:2,document:[10,14],environ:[10,14],exampl:[3,5,10,13,14],faq:[10,14],from:[10,14],grid:[7,8],grid_class:6,hpc_function:9,indic:10,input:0,instal:[10,14],instruct:[10,14],issu:[10,14],misc:0,modul:[1,2,4,6,9,10,12,14,15,16,17,18],moe:8,note:[10,14],nucsyn:0,option:[7,8],output:0,paramet:0,pip:[10,14],plot_funct:12,popul:[8,13],privat:8,python:[10,14],requir:[10,14],run_system_wrapp:15,sampler:8,script:13,section:0,sourc:[10,14],spacing_funct:16,star:0,stellar_typ:17,tabl:10,usag:[10,14],useful_func:18,variabl:[10,14],via:[10,14],welcom:10}}) \ No newline at end of file +Search.setIndex({docnames:["binary_c_parameters","custom_logging_functions","distribution_functions","examples","functions","general_examples","grid","grid_options_defaults","grid_options_descriptions","hpc_functions","index","modules","notebook_population","notebooks","plot_functions","population_example","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":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,nbsphinx:3,sphinx:56},filenames:["binary_c_parameters.rst","custom_logging_functions.rst","distribution_functions.rst","examples.rst","functions.rst","general_examples.rst","grid.rst","grid_options_defaults.rst","grid_options_descriptions.rst","hpc_functions.rst","index.rst","modules.rst","notebook_population.ipynb","notebooks.rst","plot_functions.rst","population_example.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,"-"],distribution_functions:[2,0,0,"-"],functions:[4,0,0,"-"],grid:[6,0,0,"-"],grid_options_defaults:[7,0,0,"-"],hpc_functions:[9,0,0,"-"],plot_functions:[14,0,0,"-"],run_system_wrapper:[17,0,0,"-"],spacing_functions:[18,0,0,"-"],stellar_types:[19,0,0,"-"],useful_funcs:[20,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.distribution_functions":{"const":[2,1,1,""],Arenou2010_binary_fraction:[2,1,1,""],Izzard2012_period_distribution:[2,1,1,""],Kroupa2001:[2,1,1,""],Moe_di_Stefano_2017_multiplicity_fractions:[2,1,1,""],Moe_di_Stefano_2017_pdf:[2,1,1,""],build_q_table:[2,1,1,""],calc_P_integral:[2,1,1,""],calc_e_integral:[2,1,1,""],calc_total_probdens:[2,1,1,""],calculate_constants_three_part_powerlaw:[2,1,1,""],cosmic_SFH_madau_dickinson2014:[2,1,1,""],duquennoy1991:[2,1,1,""],fill_data:[2,1,1,""],flat:[2,1,1,""],flatsections:[2,1,1,""],gaussian:[2,1,1,""],gaussian_func:[2,1,1,""],gaussian_normalizing_const:[2,1,1,""],get_integration_constant_q:[2,1,1,""],get_max_multiplicity:[2,1,1,""],imf_chabrier2003:[2,1,1,""],imf_scalo1986:[2,1,1,""],imf_scalo1998:[2,1,1,""],imf_tinsley1980:[2,1,1,""],interpolate_in_mass_izzard2012:[2,1,1,""],ktg93:[2,1,1,""],linear_extrapolation_q:[2,1,1,""],merge_multiplicities:[2,1,1,""],normalize_dict:[2,1,1,""],number:[2,1,1,""],poisson:[2,1,1,""],powerlaw:[2,1,1,""],powerlaw_constant:[2,1,1,""],powerlaw_extrapolation_q:[2,1,1,""],prepare_dict:[2,1,1,""],raghavan2010_binary_fraction:[2,1,1,""],sana12:[2,1,1,""],set_opts:[2,1,1,""],three_part_powerlaw:[2,1,1,""]},"binarycpython.utils.functions":{BinaryCEncoder:[4,2,1,""],Capturing:[4,2,1,""],binarycDecoder:[4,2,1,""],binaryc_json_serializer:[4,1,1,""],call_binary_c_config:[4,1,1,""],catchtime:[4,2,1,""],convert_bytes:[4,1,1,""],count_keys_recursive:[4,1,1,""],create_arg_string:[4,1,1,""],create_hdf5:[4,1,1,""],custom_sort_dict:[4,1,1,""],example_parse_output:[4,1,1,""],extract_ensemble_json_from_string:[4,1,1,""],filter_arg_dict:[4,1,1,""],get_arg_keys:[4,1,1,""],get_defaults:[4,1,1,""],get_help:[4,1,1,""],get_help_all:[4,1,1,""],get_help_super:[4,1,1,""],get_moe_di_stefano_dataset:[4,1,1,""],get_size:[4,1,1,""],handle_ensemble_string_to_json:[4,1,1,""],imports:[4,1,1,""],inspect_dict:[4,1,1,""],is_capsule:[4,1,1,""],load_logfile:[4,1,1,""],make_build_text:[4,1,1,""],merge_dicts:[4,1,1,""],multiply_values_dict:[4,1,1,""],output_lines:[4,1,1,""],parse_binary_c_version_info:[4,1,1,""],recursive_change_key_to_float:[4,1,1,""],recursive_change_key_to_string:[4,1,1,""],remove_file:[4,1,1,""],return_binary_c_version_info:[4,1,1,""],subtract_dicts:[4,1,1,""],temp_dir:[4,1,1,""],update_dicts:[4,1,1,""],verbose_print:[4,1,1,""],write_binary_c_parameter_descriptions_to_rst_file:[4,1,1,""]},"binarycpython.utils.functions.BinaryCEncoder":{"default":[4,3,1,""]},"binarycpython.utils.functions.Capturing":{__enter__:[4,3,1,""],__exit__:[4,3,1,""]},"binarycpython.utils.functions.binarycDecoder":{decode:[4,3,1,""]},"binarycpython.utils.functions.catchtime":{__enter__:[4,3,1,""],__exit__:[4,3,1,""]},"binarycpython.utils.grid":{Population:[6,2,1,""]},"binarycpython.utils.grid.Population":{Moe_di_Stefano_2017:[6,3,1,""],add_grid_variable:[6,3,1,""],evolve:[6,3,1,""],evolve_population:[6,3,1,""],evolve_single:[6,3,1,""],export_all_info:[6,3,1,""],format_ensemble_results:[6,3,1,""],get_stream_logger:[6,3,1,""],last_grid_variable:[6,3,1,""],parse_cmdline:[6,3,1,""],return_all_info:[6,3,1,""],return_population_settings:[6,3,1,""],set:[6,3,1,""],set_moe_di_stefano_settings:[6,3,1,""],system_queue_filler:[6,3,1,""],write_binary_c_calls_to_file:[6,3,1,""]},"binarycpython.utils.grid_options_defaults":{grid_options_description_checker:[7,1,1,""],grid_options_help:[7,1,1,""],print_option_descriptions:[7,1,1,""],write_grid_options_to_rst_file:[7,1,1,""]},"binarycpython.utils.plot_functions":{color_by_index:[14,1,1,""],dummy:[14,1,1,""],parse_function_hr_diagram:[14,1,1,""],parse_function_masses:[14,1,1,""],parse_function_orbit:[14,1,1,""],plot_HR_diagram:[14,1,1,""],plot_masses:[14,1,1,""],plot_orbit:[14,1,1,""],plot_system:[14,1,1,""]},"binarycpython.utils.run_system_wrapper":{run_system:[17,1,1,""]},"binarycpython.utils.spacing_functions":{"const":[18,1,1,""]},"binarycpython.utils.useful_funcs":{calc_period_from_sep:[20,1,1,""],calc_sep_from_period:[20,1,1,""],maximum_mass_ratio_for_RLOF:[20,1,1,""],minimum_period_for_RLOF:[20,1,1,""],minimum_separation_for_RLOF:[20,1,1,""],ragb:[20,1,1,""],roche_lobe:[20,1,1,""],rzams:[20,1,1,""],zams_collision:[20,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:{"0001":20,"0007":2,"001":0,"002":5,"054":2,"0820":0,"08msun":0,"0902":0,"100":[0,2],"1000":[5,8],"100000000000":5,"115":2,"125":0,"12500":0,"12e":[1,12,15],"13e3":0,"1403":2,"150":[12,15],"15000":[0,5,12,15],"15msun":2,"190":0,"1951":0,"1972":0,"1975":0,"197x":0,"1980":2,"1983":20,"1986":[0,2],"1989":0,"1991":2,"1993":0,"1996":20,"1998":[0,2],"1999":0,"1ckzg0p9":[10,16],"1e2":0,"1e9":0,"200":0,"2000":0,"2001":2,"2002":0,"2003":[0,2],"2004":0,"2005":0,"2009":0,"2010":[0,2,8],"2012":[0,2],"2013":0,"2014":[0,2],"2015":0,"2016":0,"2017":[0,8],"2018":[0,1],"2019":0,"2020":0,"2021":0,"20210727":0,"257":20,"25msun":0,"281":20,"2969346":2,"2msun":0,"3000":0,"30e4":0,"33526":12,"3msun":2,"4000":0,"42msun":0,"44msun":0,"45000000080":[12,15],"4530":5,"45msun":0,"4e3":0,"500":0,"5msun":0,"600000":0,"6068":0,"625":0,"6944":0,"6e1":2,"6e5":0,"6msun":0,"72498e":12,"7619":0,"763":2,"773586668293e":12,"78125":0,"795":2,"80msol":2,"8955b541d":0,"boolean":[0,4,6,8,14,20],"break":0,"case":[0,4,8],"catch":[4,5,8],"char":8,"class":[4,6],"const":[2,6,12,15,18],"default":[0,1,2,4,5,6,7,8,12,15,17],"export":[4,6,12,15],"float":[0,2,4,18,20],"function":[0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,20],"import":[4,5,6,12,15],"int":[0,1,2,4,6,7,8,18,20],"long":[0,4,6,8,19],"new":[0,2,4,6],"null":[0,4],"paczy\u0144ski":0,"public":[7,10],"return":[1,2,4,6,7,8,14,17,18,20],"short":[0,19],"super":0,"switch":0,"throw":[10,16],"true":[0,4,6,7,8,12,14,15],"try":[0,6,10,16],"while":0,Adding:12,And:[7,10,16,20],For:[0,4,10,14,16],Gas:0,Its:8,NOT:[0,6,17],Not:[8,12,15],One:0,Pms:14,That:0,The:[0,1,2,4,5,6,8,10,12,13,14,15,16,17],Then:[4,10,16],There:[2,5,6,7,8,14],These:[4,8,14],Use:[0,5,6],Used:[0,8,14],Useful:[0,6,7],Uses:[0,18],Was:0,Will:[0,4,6,15,17],With:7,__enter__:4,__exit__:4,_actually_evolve_system:8,_binary_c_bind:[4,5,20],_binary_c_config_execut:8,_binary_c_dir:8,_binary_c_execut:8,_binary_c_shared_librari:8,_commandline_input:8,_count:8,_custom_logging_shared_library_fil:8,_end_time_evolut:8,_errors_exceed:8,_errors_found:8,_evolution_type_opt:8,_failed_count:8,_failed_prob:8,_failed_systems_error_cod:8,_generate_grid_cod:8,_grid_vari:8,_loaded_ms_data:8,_main_pid:8,_population_id:8,_probtot:8,_process_run_population_grid:8,_repeat:8,_set:[6,12,15],_set_ms_grid:8,_start_time_evolut:8,_store_memaddr:8,_system_gener:8,_total_mass_run:8,_total_probability_weighted_mass_run:8,_total_starcount:8,_zero_prob_stars_skip:8,abat:0,abbrevi:19,about:[4,6,7,12,15,20],abov:[0,2,4,5,6],absolut:0,abund:0,acceler:0,accept:[4,12,15],access:[2,8],accord:[0,2],accordingli:[12,15],account:[0,8],accret:0,accretion_limit_dynamical_multipli:0,accretion_limit_eddington_lmms_multipli:0,accretion_limit_eddington_steady_multipli:0,accretion_limit_eddington_wd_to_remnant_multipli:0,accretion_limit_thermal_multipli:0,accretor:[0,20],act:[0,8,12,15],activ:[0,10,16],actual:[0,4,6,8,10,14,16],adam:0,adapt:0,add:[2,4,6,8,12,14,15,18,20],add_grid_vari:[6,12,15],added:4,address:[1,8,20],admittedli:14,adress:[5,20],affect:0,after:[0,6,8],ag89:0,again:[4,6,8,10,16],against:14,agb:0,agb_3dup_algorithm:0,agb_core_algorithm:0,agb_core_algorithm_default:0,agb_core_algorithm_hurlei:0,agb_core_algorithm_karaka:0,agb_luminosity_algorithm:0,agb_luminosity_algorithm_default:0,agb_luminosity_algorithm_hurlei:0,agb_luminosity_algorithm_karaka:0,agb_radius_algorithm:0,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,age:0,aging:0,albedo:0,algorithm:10,algothim:0,all:[0,1,2,4,5,6,7,8,10,11,12,14,15,16,17],all_info:6,allow:[0,2,4,5,8],allow_nan:4,along:[0,7,8],alot:[12,15],alpha:0,alpha_c:0,alphacb:0,alreadi:6,also:[0,4,5,6,7,10,16,20],altern:[0,8],alwai:[0,2,8],amanda:0,amax:2,amin:2,amount:[0,4,6,7,8,12,15,18],amt_cor:[6,8,12,15],analys:17,analyt:6,andrew:[10,16],andronov:0,angelou_lithium_cheb_decay_tim:0,angelou_lithium_cheb_massfrac:0,angelou_lithium_cheb_tim:0,angelou_lithium_decay_funct:0,angelou_lithium_decay_tim:0,angelou_lithium_eagb_decay_tim:0,angelou_lithium_eagb_massfrac:0,angelou_lithium_eagb_tim:0,angelou_lithium_gb_decay_tim:0,angelou_lithium_gb_massfrac:0,angelou_lithium_gb_tim:0,angelou_lithium_hg_decay_tim:0,angelou_lithium_hg_massfrac:0,angelou_lithium_hg_tim:0,angelou_lithium_lmms_decay_tim:0,angelou_lithium_lmms_massfrac:0,angelou_lithium_lmms_tim:0,angelou_lithium_ms_decay_tim:0,angelou_lithium_ms_massfrac:0,angelou_lithium_ms_tim:0,angelou_lithium_tpagb_decay_tim:0,angelou_lithium_tpagb_massfrac:0,angelou_lithium_tpagb_tim:0,angelou_lithium_vrot_trigg:0,angelou_lithium_vrotfrac_trigg:0,angular:[0,14],ani:[0,2,4,6,10,16],anoth:0,ansi:0,anyth:[0,8],anywai:6,anywher:6,api:[0,4],api_log_filename_prefix:0,append:[1,4],appli:0,approach:5,appropri:[0,8],approxim:0,aren:[2,8],arenou2010_binary_fract:2,arg:[2,4,14],arg_dict:4,argopt:0,argpair:4,argstr:5,argument:[0,2,4,5,6,8,12,15,17],argument_of_periastron:0,argument_of_periastron_quadrupl:0,argument_of_periastron_tripl:0,around:[0,5],arrai:[2,4,5,8],artifici:0,artificial_accretion_end_tim:0,artificial_accretion_ignor:0,artificial_accretion_start_tim:0,artificial_angular_momentum_accretion_r:0,artificial_mass_accretion_r:0,artificial_orbital_angular_momentum_accretion_r:0,arxiv:[0,2],asarrai:5,ask:[0,20],asplund:0,assign:6,assum:[0,14],ast871:0,astronomi:0,astropi:[10,14,16],atom:4,attempt:[4,6],auto:[1,11],autogen_c_logging_cod:[1,5],autogener:5,automat:[0,1,5,7,10,16],avaibl:[10,16],avail:[0,4,8,14],awai:0,axi:[0,14],b_1:0,b_2:0,b_3:0,b_4:0,b_inclination1:0,b_inclination2:0,b_inclination3:0,b_inclination4:0,back:[0,4],background:5,backward:0,bagb:0,barn:0,base:[0,2,4,5,6,10,14,16,20],base_filenam:[6,12,15],basic:[5,6],batchmod:0,beasor:0,becaus:[0,2,5,6,8,10,16],becom:[0,1,2,4],been:[0,6,8],befor:[0,6,8,10,12,15,16],behaviour:[4,17],behind:5,belczynski:0,below:[0,8,15],berro:0,bertolami:0,best:[6,8,10,16],beta:0,beta_reverse_nova:0,beta_reverse_novae_geometri:0,better:[0,4,6],between:[0,2,18],bewar:6,bh_belczynski:0,bh_fryer12_delai:0,bh_fryer12_rapid:0,bh_hurley2002:0,bh_prescript:0,bh_spera2015:0,big:[0,8],bin:[0,5,10,16],binari:[2,5,6,8,10,12,14,15,16,20],binary_c2:[10,16],binary_c:[1,2,4,5,6,8,12,14,15,17],binary_c_cal:6,binary_c_default:[12,15],binary_c_inline_config:1,binary_c_log_cod:[1,5],binary_c_macro:0,binary_c_output:4,binary_c_paramet:[0,12,15],binary_c_python:[4,6,12],binary_c_task_:0,binary_c_write_log_cod:1,binary_grid:0,binary_star:20,binaryc:[1,4,17],binaryc_config:1,binaryc_json_seri:4,binarycdecod:4,binarycencod:4,binarycpython:[1,2,4,5,6,7,10,12,14,15,16,17,18,20],bind:0,birth:0,bit:2,bivari:0,black:0,black_hol:0,bloecker:0,blog:1,boltzman:14,boltzmann:0,bondi:0,bondi_hoyle_accretion_factor:0,bool:[4,6,7,14],born:0,bosswissam:4,both:[0,4],bottom:0,bound:[2,18],boundari:2,brake:0,branch:[0,4],branch_david:0,branchpoint:6,breakup:0,broken:0,bse:[0,2],bse_opt:[6,12,15],bsf:0,buffer:0,build:[0,1,4],build_q_tabl:2,built:[0,1,4,10,16],burn:0,busso:0,bye:0,c13_eff:0,c_auto_log:[8,15],c_log:0,c_logging_cod:[8,12,15],calc_e_integr:2,calc_p_integr:2,calc_period_from_sep:20,calc_sep_from_period:[12,15,20],calc_total_probden:2,calcul:[0,2,4,6,8,20],calculate_constants_three_part_powerlaw:2,call:[0,1,4,6,8,12,14,15,17],call_binary_c_config:4,can:[0,1,2,4,5,6,8,10,12,14,15,16,17],cannot:6,canon:8,cap:0,capsul:[1,4],captur:[0,4],carbon:0,carbon_oxygen_white_dwarf:0,carlo:[0,8],carrasco:0,carri:0,cast:[4,5],catchtim:4,categoris:4,caught:4,caus:20,cbdisc:0,cbdisc_albedo:0,cbdisc_alpha:0,cbdisc_eccentricity_pumping_dermin:0,cbdisc_eccentricity_pumping_method:0,cbdisc_eccentricity_pumping_non:0,cbdisc_end_evolution_after_disc:0,cbdisc_fail_ring_inside_separ:0,cbdisc_gamma:0,cbdisc_init_djdm:0,cbdisc_init_dm:0,cbdisc_inner_edge_strip:0,cbdisc_inner_edge_stripping_timescal:0,cbdisc_kappa:0,cbdisc_mass_loss_constant_r:0,cbdisc_mass_loss_fuv_multipli:0,cbdisc_mass_loss_inner_l2_cross_multipli:0,cbdisc_mass_loss_inner_viscous_accretion_method:0,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,cbdisc_mass_loss_inner_viscous_multipli:0,cbdisc_mass_loss_ism_pressur:0,cbdisc_mass_loss_ism_ram_pressure_multipli:0,cbdisc_mass_loss_xray_multipli:0,cbdisc_max_lifetim:0,cbdisc_minimum_evaporation_timescal:0,cbdisc_minimum_fr:0,cbdisc_minimum_luminos:0,cbdisc_minimum_mass:0,cbdisc_no_wind_if_cbdisc:0,cbdisc_outer_edge_strip:0,cbdisc_outer_edge_stripping_timescal:0,cbdisc_resonance_damp:0,cbdisc_resonance_multipli:0,cbdisc_torquef:0,cbdisc_viscous_l2_coupl:0,cbdisc_viscous_photoevaporative_coupl:0,cbdisc_viscous_photoevaporative_coupling_inst:0,cbdisc_viscous_photoevaporative_coupling_non:0,cbdisc_viscous_photoevaporative_coupling_visc:0,cee:0,cemp:0,cemp_cfe_minimum:0,center:6,central_object:0,certain:[3,8,10,16],cf_amanda_log:0,cflag:[10,16],chabrier:2,chandrasekhar:0,chandrasekhar_mass:0,chang:[0,1,2,4,6,7,8,10,15,16],chapter:[0,3,8,11],cheb:0,check:[0,2,4,6,7,12,15,20],check_circular:4,chemic:0,chen:0,child:4,choic:[0,2,6,14],choos:[0,5,14],chosen:6,circular:0,circumbinari:0,circumstanti:0,claei:0,clark:0,clean:[1,6,10,16],clean_up_custom_logging_fil:6,clear:4,clock:4,clone:[10,16],close:0,cloud:0,cls:4,cluster:9,cmdline:6,code:[0,1,3,5,6,7,10,12,14,15,16,17],collaps:0,collapsar:0,collect:20,collid:20,color:14,color_by_index:14,colour:0,colour_log:0,column:[5,12,14,15],com:[1,4],combin:[1,4,6,8],combine_ensemble_with_thread_join:8,come:[2,10,16,18],comenv_bs:0,comenv_disc_angmom_fract:0,comenv_disc_mass_fract:0,comenv_ejection_spin_method:0,comenv_ejection_spin_method_do_noth:0,comenv_ejection_spin_method_sychron:0,comenv_ejection_spin_method_synchron:0,comenv_merger_spin_method:0,comenv_merger_spin_method_breakup:0,comenv_merger_spin_method_conserve_angmom:0,comenv_merger_spin_method_conserve_omega:0,comenv_merger_spin_method_specif:0,comenv_ms_accret:0,comenv_ms_accretion_fract:0,comenv_ms_accretion_mass:0,comenv_nandez2016:0,comenv_nelemans_tout:0,comenv_ns_accret:0,comenv_ns_accretion_fract:0,comenv_ns_accretion_mass:0,comenv_post_eccentr:0,comenv_prescript:0,comenv_splitmass:0,comenv_undef:0,command:[0,1,6,8,10,16],commandlin:[12,15],commit:4,common:[0,12,15],companion:[0,12,15],compar:[0,8],compil:[1,5,10,12,15,16],compile_shared_lib:1,complain:[12,15],complex:[5,6,8,14],compon:[4,14],comput:[0,9],condit:[5,6,12,15],condor:[6,8,9],condor_grid:6,config:[1,4,8,10,16],config_fil:1,configur:[2,5,6,12,15],conserv:0,consid:[0,1,2,4,6,8,14],constant:[0,2,14],construct:[0,1,5],contain:[0,1,2,3,4,6,7,8,9,10,11,14,15,16,17,18,19],content:[4,10,13],context:4,continu:6,control:0,convect:0,converg:0,convert:[2,4,6],convert_byt:4,cool:0,copi:[0,6,20],core:[0,6,8,14],core_helium_burn:0,core_mass:0,correct:[2,6,14,20],correctli:[5,10,12,14,15,16],correspond:14,corretor:0,cosmic:2,cosmic_sfh_madau_dickinson2014:2,could:[0,4],count:[4,8],count_keys_recurs:4,counter:8,coupl:0,cours:14,coverag:[10,16],cowd:0,cpu:0,crap_paramet:0,creat:[2,4,6,12,15],create_and_load_logging_funct:[1,5],create_arg_str:4,create_hdf5:[4,12,15],critic:0,cross:0,ctype:1,cuntz:0,current:[0,4,10,16],custom:[0,1,4,5,6,8,12,14,15,17],custom_log:[5,6,8],custom_logging_cod:[1,5,17],custom_logging_func_memaddr:[5,8],custom_logging_funct:[5,8,10,11,12,15],custom_logging_info:6,custom_opt:[6,12,15],custom_sort_dict:4,custom_tmp_dir:1,customis:14,cut:5,cvode:0,dai:[0,2,5,12,15,20],damp:0,dat:[0,4,12,15],data:[0,4,5,6,8,12,15,17],data_dict:2,data_dir:[4,6,8,12,15],datadir:6,datafram:[5,14],dataset:4,date:6,david:[0,10,16],david_logging_funct:0,dd7:0,deactiv:0,deal:4,death:0,debug:[0,8],decai:0,decid:[0,4,5],decod:4,decreas:0,deeper:6,def:[5,12,15],default_to_metal:0,defaultdict:4,defer:0,defin:[0,1,2,6,14],definit:[1,20],degener:0,degre:0,delta_mcmin:0,den:0,densiti:2,depend:[0,2,10,14,16],deprec:0,dermin:0,describ:[0,2,5,8],descript:[0,2,4,8,10,11],design:[6,14],desir:0,destruct:6,detail:[0,4],detect:0,determin:[0,6,20],deton:0,dev:0,develop:1,deviat:2,dewi:0,dex:0,df2:5,diagnost:8,diagram:[0,14],dickonson:2,dict2:4,dict:[1,2,4,6,7,12,15,19],dict_1:4,dict_2:4,dictionari:[1,2,4,6,7,8,14,19],did:[4,10,16],differ:[0,4,6,10,14,16],dimmer:0,dir:[10,16],direct:[0,6],directli:[4,5,8],director:8,directori:[0,4,6,8,10,12,15,16],disabl:0,disable_debug:0,disable_end_log:0,disable_ev:0,disc:0,disc_legacy_log:0,disc_log2d:0,disc_log:0,disc_log_directori:0,disc_log_dt:0,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,disc_stripping_timescale_infinit:0,disc_stripping_timescale_inst:0,disc_stripping_timescale_orbit:0,disc_stripping_timescale_visc:0,disc_timestep_factor:0,discs_circumbinary_from_comenv:0,discs_circumbinary_from_wind:0,disk:[0,6],dispers:0,displai:0,dist:[10,16],distefano:2,distribut:[0,2,6,9],distribution_funct:[10,11],divid:9,dlnm1:[6,12,15],dlog10per:[12,15],dlogp:2,do_dry_run:8,doc:[4,7,10,16],doc_fetch:2,docstr:[10,14,16],document:[4,7,8,11],doe:[0,2,4,6,8,20],doesn:[6,8],doesnt:[5,7],doing:[0,1,6,7,10,16],don:[2,4,8],done:[0,4,5,6,10,12,15,16],donm:[12,15],donor:[0,20],donor_limit_dynamical_multipli:0,donor_limit_envelope_multipli:0,donor_limit_thermal_multipli:0,donor_rate_algorithm_bs:0,donor_rate_algorithm_claeys2014:0,dont:5,dphasevol:[6,12,15],dr2:0,dr3:0,drai:0,dredg:0,dry:8,dstep:2,dtfac:0,dtlimit:4,dtm:[1,12,15],dtype:5,due:[10,16],dummi:[2,14],dump:[0,4],dumpvers:0,duquennoi:2,duquennoy1991:2,dure:0,dust:0,dwarf:0,dynam:0,e2_hurley_2002:0,e2_izzard:0,e2_mint:0,e2_prescript:0,each:[0,2,4,6,8],eagb:0,eagb_wind_beasor_etal_2020:0,eagb_wind_bs:0,eagb_wind_goldman_etal_2017:0,eagbwind:0,eagbwindfac:0,earli:0,early_asymptotic_giant_branch:0,easi:4,easier:[4,5],ecc2:2,ecc3:2,ecc:[2,5,6],eccentr:[0,2,5,12,14,15,20],eccentric_rlof_model:0,eccentricity_quadrupl:0,eccentricity_tripl:0,echo:0,eddington:0,edg:[0,6],edu:0,effect:[0,2,8],effective_metal:0,effici:0,egg:[10,16],eggleton:[0,20],either:[0,4,5,6,8,10,16,17],eject:0,eld:0,eldridg:0,electon:0,electron:0,element:[0,1,4,8,14],email:4,emp:0,emp_feh_maximum:0,emp_logg_maximum:0,emp_minimum_ag:0,empti:[4,7],enabl:0,encod:4,encount:8,end:[0,2,4,8,12,15],end_index:2,energi:0,enhanc:0,enlarg:0,enough:2,ensembl:[0,4,6,8],ensemble_def:0,ensemble_dictionari:6,ensemble_dt:0,ensemble_factor_in_probability_weighted_mass:8,ensemble_filter_:0,ensemble_filters_off:0,ensemble_json:4,ensemble_legacy_ensembl:0,ensemble_list:6,ensemble_logdt:0,ensemble_logtim:0,ensemble_macro:0,ensemble_output_:8,ensemble_startlogtim:0,ensure_ascii:4,enter:[0,10,16],enthalpi:0,entir:5,entri:[4,6],env:[10,14,16],envelop:0,equal:[4,12,15],equat:0,equation_of_state_algorithm:0,equation_of_state_paczynski:0,equatori:0,equival:8,errno:[10,16],error:[0,4,8,10,16],esa:2,escap:0,escape_fract:0,escape_veloc:0,eta:0,etal:0,etc:[0,4,6,9,10,12,14,15,16,17],euler:0,evalu:[2,6,20],evan:0,evapor:0,evaporate_escaped_orbiting_object:0,event:0,everi:[0,10,16],everyth:[6,8,12,15],everytim:[10,16],evid:0,evolut:[0,1,5,6,8,14],evolution_split:0,evolution_splitting_maxdepth:0,evolution_splitting_sn_eccentricity_threshold:0,evolution_splitting_sn_n:0,evolution_typ:8,evolutionari:0,evolv:[0,6,8,12,15],evolve_popul:[6,12,15],evolve_singl:[6,12,15],exact:[1,4,8],exactli:0,exampl:[1,2,4,6,12,17],example_head:4,example_header_1:5,example_header_2:5,example_log:17,example_log_co:1,example_parse_output:[4,5],example_pop:[12,15],example_pop_set:12,example_python_population_result:[12,15],exce:[0,8],except:[4,6,7,8,14],execut:[0,6,8,10,12,15,16],exist:[0,6,7,12,15],exist_ok:[4,12,15],exit:[0,4],exp:[6,12,15],expand:17,expect:[10,16],experiment:[0,4],explain:4,explicitli:[0,1],explod:0,explos:0,expoenti:0,expon:0,export_all_info:[6,12,15],express:0,extend:[10,16],extern:0,extra:[0,6,8,17],extra_text:7,extract:[4,12,15],extract_ensemble_json_from_str:4,extrapol:[2,8],fabian:0,fabian_imf_log:0,fabian_imf_log_tim:0,fabian_imf_log_timestep:0,factor:[0,2,4,8],fade:0,fail:[0,4,8,10,16],fail_sil:4,failed_system:8,failed_system_log:8,failed_systems_threshold:8,failur:0,fals:[0,4,6,8,12,14,15],fancy_parsing_funct:17,far:0,farmer:0,fase:[12,15],fast:0,feed:8,ferguson:0,few:0,field:0,fig:[0,2],figur:[8,14],file:[0,1,4,6,7,8,9,10,12,14,15,16,17],file_log:0,filehandl:7,filenam:[0,1,4,5,6,8,12,15,17],filenotfounderror:[10,16],filepath:1,fill:6,fill_data:2,filter:[0,4],filter_arg_dict:4,filter_valu:4,fin:0,find:[4,6,8,10,16],finish:[4,14],first:[0,2,4,6,10,16,20],first_giant_branch:0,fishlock:0,fit:[0,2,4,6,20],fix:[0,2,4,6,14],flag:[0,1,4,8],flash:0,flat:[2,8],flatsect:[2,12,15],flaw:6,float64:5,float_overflow_check:0,flto:[10,16],fold:2,follow:[0,2,4,8,10,14,16],forc:[0,10,16],force_circularization_on_rlof:0,force_corotation_of_primary_and_orbit:0,form:[0,4,6,7],formal:0,format:[0,2,4,5,6,12,15],format_ensemble_result:6,formula:0,forward:0,found:[2,10,16],four:0,fpic:1,fraction:[0,2,8],frequenc:0,friction:0,fring:0,from:[0,2,4,5,6,8,12,14,15,20],from_binary_c_config:1,from_dict:5,ftz:[10,16],full:[4,6,8],full_path:4,fulli:[12,15],func_memaddr:5,further:2,fuv:0,gaia:[0,2],gaia_colour_transform_method:0,gaia_conversion_ubvri_bivariate_jordi2010:0,gaia_conversion_ubvri_riello2020:0,gaia_conversion_ubvri_univariate_evans2018:0,gaia_conversion_ubvri_univariate_jordi2010:0,gaia_conversion_ugriz_bivariate_jordi2010:0,gaia_conversion_ugriz_riello2020:0,gaia_conversion_ugriz_univariate_evans2018:0,gaia_conversion_ugriz_univariate_jordi2010:0,gaia_l_binwidth:0,gaia_teff_binwidth:0,gain:8,galact:0,gallino:0,gamma:0,gap:0,garcia:0,gauss:0,gaussian:2,gaussian_func:2,gaussian_normalizing_const:2,gb_reimers_eta:0,gb_wind_beasor_etal_2020:0,gb_wind_goldman_etal_2017:0,gb_wind_reim:0,gb_wind_schroeder_cuntz_2005:0,gbwind:0,gbwindfac:0,gcc:[1,10,16],gce:0,gener:[0,1,2,4,5,6,7,8,12,14,15],general_info:4,generalis:2,geometr:0,gerosa:0,get:[0,2,4,5,6,7,10,12,15,16,17,20],get_arg_kei:4,get_default:4,get_help:[4,12,15],get_help_al:[4,6,12,15],get_help_sup:4,get_integration_constant_q:2,get_max_multipl:2,get_moe_di_stefano_dataset:4,get_siz:4,get_stream_logg:6,gettempdir:5,giant:0,giant_branch:0,git:[0,4],git_branch:4,git_build:4,github:4,gitlab:10,give:[0,2,4,5,20],given:[0,1,2,4,5,6,8,17,20],global:[0,2],global_dict:2,gmax:2,gmin:2,goe:[0,4,6,14],gogo:0,going:[10,16],goldman:0,gonna:2,good:[0,8,12,15,20],gov:0,gravit:0,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,gravitational_radiation_modulator_:0,gravitational_radiation_modulator_j:0,gravitational_radiation_non:0,grb:0,great:0,greater:0,grevess:0,grid:[0,4,6,10,11,12,15],grid_class:[10,11],grid_cod:6,grid_opt:[6,8,12,15],grid_options_default:7,grid_options_defaults_dict:7,grid_options_descript:7,grid_options_description_check:7,grid_options_help:7,grid_vari:[8,12,15],grid_variable_numb:6,gridcode_filenam:8,gridtyp:6,group:4,gsl:[10,16],gsl_dir:[10,16],guess:[0,2],h5py:[10,16],hachisu:0,hachisu_disk_wind:0,hachisu_ignore_qcrit:0,hachisu_qcrit:0,hack:7,had:6,half:0,hall:0,handi:0,handl:[0,4,6,8,15,17,20],handle_ensemble_string_to_json:4,happen:0,has:[0,1,4,5,6,8],have:[0,2,4,5,6,7,8,10,12,14,15,16],hbb:0,hbbtfac:0,hdf5:[4,12,15],hdf5file:4,header:[1,4,5,12,15],headerlin:[12,15],headlin:8,hegb:0,hehg:0,height:[2,12,15],helium:0,helium_flash_mass_loss:0,helium_white_dwarf:0,help:[0,4,7,12,15],help_al:0,hem:0,henc:0,hendrik:[10,16],here:[1,4,5,6,8,12,14,15],hertzsprung:0,hertzsprung_gap:0,hertzstrpung:0,heuvel:0,hewd:0,hewd_hewd_ignition_mass:0,hex:8,high:[0,2],higher:[0,2,4,8,10,16],highest:6,his:2,histori:2,hold:8,hole:0,homogen:0,hopefulli:0,hot:0,how:[0,4,5,6,8],howev:0,hoyl:0,hpc:[6,9],hpc_function:[10,11],hr_diagram:14,hrd:0,hrdiag:0,hrdiag_output:0,html:[10,16],http:[0,1,2,4],hurlei:0,hut:0,hybrid:0,hydro:0,hydrogen:0,ibc:0,idea:14,idum:0,ignit:0,ignor:[0,5,6,8,10,16],iia:0,imf:[0,2],imf_chabrier2003:2,imf_scalo1986:2,imf_scalo1998:2,imf_tinsley1980:2,immedi:0,implement:[0,6,8],impli:0,impos:[12,15],improv:2,inclin:0,inclination1:0,inclination2:0,inclination3:0,inclination4:0,inclini:0,incliniation_quadrupl:0,incliniation_tripl:0,includ:[0,1,2,4,5,6,10,14,16],include_binary_c_default:[6,12,15],include_binary_c_help_al:[6,12,15],include_binary_c_version_info:[6,12,15],include_default:6,include_popul:[12,15],include_population_set:6,incom:0,increas:0,inde:0,indent:4,index:[0,2,10],indic:[0,2],individual_nova:0,induc:0,inertia:0,info:[4,6,10,12,14,15,16],inform:[0,1,4,6,7,12,14,15],init:6,init_abund:0,init_abund_dex:0,init_abund_mult:0,init_abunds_onli:0,initi:[0,2,6],initial_abundance_hash:6,initial_abundance_mix:0,initial_abunds_onli:0,inlin:5,inner:0,input:[1,2,4,6,8,10,14,20],input_dict:4,insert:6,insid:0,inspect:[4,12,14,15],inspect_dict:4,inspir:[1,5,14,20],instabl:0,instanc:[4,12,15],instant:0,instantli:0,instead:[0,4,8],integ:[0,6,8,20],integr:2,integrals_str:2,interact:[0,7],interfac:[4,10,16],interfer:[10,16],intern:[0,8],internal_buff:0,internal_buffering_off:0,internal_buffering_print:0,internal_buffering_stor:0,interpol:[2,6],interpolate_in_mass_izzard2012:2,interpolator_nam:2,intershel:0,interstellar:0,intger:0,intro:0,invers:20,involv:0,inward:0,is_capsul:4,isn:[4,6],isnt:[12,15],isotop:[0,4],isotope_hash:6,isotope_list:6,item:1,iter:4,its:[0,4,6,7,10,14,16,17],itself:[4,8,10,16],iwamoto:0,izzard2012_period_distribut:2,izzard:[0,10,16],jager:0,jaschek:2,jeff:[10,16],jia:0,job_queu:6,john:0,join:[12,15],jordi:0,json:[4,6,8,12,15],jsondecod:4,jsonencod:4,jul:0,jupyt:[10,16],just:[0,2,4,5,6,8,20],kap:0,kappa:0,kaps_rentrop:0,karaka:0,keep:6,kei:[1,2,4,6,7,8,14],kelvin:0,keplerian:0,keyword:[14,17],kick:[0,8],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,12,15],kim:0,kind:0,kippenhahn:0,know:[0,1,6,7],known:[0,2,6,12,15,17],kroupa2001:[2,6],kroupa:2,ktg93:2,kwarg:[6,14,17],lambda:0,lambda_c:0,lambda_ce_dewi_tauri:0,lambda_ce_klencki_2020:0,lambda_ce_polytrop:0,lambda_ce_wang_2016:0,lambda_enthalpi:0,lambda_ionis:0,lambda_min:0,lambda_mult:0,lambda_multipli:0,lambda_v:2,lamer:0,landau:0,langer:0,larger:0,last:[2,6],last_grid_vari:6,late:5,latter:0,law:2,law_const:2,lbv:0,ld_library_path:[10,16],lead:[0,20],least:[10,16],leav:0,left:0,legaci:0,legacy_yield:0,len:[12,15],lengthen:0,less:[0,1,2],let:6,level:[1,4,6],li7:0,lib:[5,10,16],libbinary_c:8,libgsl:[10,16],libmemo:[10,16],librari:[0,1,5,6,8,12,17],library_path:[10,16],librinterpol:[10,16],lies:0,lifetim:0,lifshitz:0,like:[0,1,4,5,6,8,10,14,16,18],limit:[0,14],line:[1,4,5,6,8,10,14,16],linear2:8,linear:[0,2,8],linear_extrapolation_q:2,linearli:[6,18],linker:1,linspac:18,list:[0,1,2,4,8,17,18],list_arg:0,list_of_sub_kei:2,lit:0,lithium:0,lithium_gb_post_1dup:0,lithium_gb_post_heflash:0,lithium_hbb_multipli:0,lithium_t:0,littleton:0,liu:0,llnl:0,lnm1:[6,12,15],load:[0,1,4,5,6,8,12,14,15],load_logfil:4,lobe:[0,20],local:2,locat:[0,2,8,10,16],lodder:0,log10:[0,2,12,15],log10m1:8,log10p:2,log10per:[12,15],log10pmin:2,log:[0,1,2,4,5,6,8,10,12,14,15,16,17,20],log_arg:8,log_args_dir:8,log_fil:8,log_filenam:[0,5,17],log_runtime_system:8,logarithm:2,logensembletim:0,logfil:[4,10,16],logg:0,logger:6,logging_dict:1,logging_lin:5,logic:[1,6,8],logmass:2,logp:2,logper:2,logperiod:2,long_spectral_typ:2,longer:0,longnam:[6,12,15],look:[1,4,10,16],lookback:0,loon:0,loop:6,loos:14,lose:0,loss:0,lost:0,lot:[4,8,17],low:[0,2,12,15],low_mass_m:0,low_mass_main_sequ:0,lower:[0,2,6,18],lsoda:0,lsun:[0,14],lugaro:0,luminos:[0,14],luminosity_1:14,luminosity_2:14,lynnett:0,m_1:[0,5,6,12,15,17],m_2:[0,5,12,15],m_3:0,m_4:0,m_max:[2,6],m_min:6,m_re:5,maccretor:0,machin:[8,10,16],macro:[0,4],madau:2,maeder:0,magellan:0,magnet:0,magnetic_braking_algorithm:0,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,magnetic_braking_gamma:0,magnitud:4,mai:0,main:[0,1,8,10,16],main_sequ:0,mainli:9,major:0,make:[0,1,2,4,5,6,8,10,12,14,15,16,17],make_build_text:4,makedir:[4,12,15],manag:[4,10,16],mani:[0,6,8],manufactur:0,map:8,maria:0,mass:[0,1,2,4,5,6,8,12,14,15,17,20],mass_1:[5,14],mass_2:[5,14],mass_accretion_for_eld:0,mass_accretor:20,mass_donor:20,mass_evolut:14,mass_for_hestar_ia_low:0,mass_for_hestar_ia_upp:0,mass_of_pmz:0,mass_str:2,massiv:[0,2],massless:0,massless_remn:0,master:[8,14],match:[0,4,14],materi:0,math:[6,12,15],matplotlib:[10,14,16],matter:0,mattsson:0,mattsson_mass_loss:0,mattsson_orich_tpagbwind:0,max:[0,2,12,15],max_bound:[2,18],max_evolution_tim:[0,1,5,12,15],max_hewd_mass:0,max_model_numb:0,max_multipl:2,max_neutron_star_mass:0,max_queue_s:8,max_stellar_angmom_chang:0,max_stellar_type_1:0,max_stellar_type_2:0,max_stellar_type_3:0,max_stellar_type_4:0,max_val:2,maximum:[0,2,8,20],maximum_mass_ratio_for_instant_rlof:0,maximum_mass_ratio_for_rlof:20,maximum_mcbagb_for_degenerate_carbon_ignit:0,maximum_nuclear_burning_timestep:0,maximum_timestep:0,maximum_timestep_factor:0,maxmimum:0,maxwellian:0,mayb:14,mayor:2,mc13_pocket_multipli:0,mch:0,mcmin:0,mdonor:0,mean:[0,2,4,6,8,10,16],meant:8,measur:4,medium:0,mega:2,memaddr:5,memori:[1,5,6,8,20],menv:0,merg:[0,2,4,8],merge_dict:4,merge_multipl:2,merger:0,merger_angular_momentum_factor:0,merger_mass_loss_fract:0,mesa:[10,16],mesasdk_init:[10,16],mesasdk_root:[10,16],messag:4,mestel:0,met:6,metal:[0,2,5,20],method:[0,5,6,8],meynet:0,might:[4,6,10,16],milki:0,miller:0,min:[2,12,15],min_bound:[2,18],min_p:2,min_per:2,min_val:2,mind:5,minimal_verbos:4,minimum:[0,2,4,8,20],minimum_co_core_mass_for_carbon_ignit:0,minimum_co_core_mass_for_neon_ignit:0,minimum_donor_menv_for_comenv:0,minimum_envelope_mass_for_third_dredgeup:0,minimum_helium_ignition_core_mass:0,minimum_mcbagb_for_nondegenerate_carbon_ignit:0,minimum_orbital_period_for_instant_rlof:0,minimum_period_for_rlof:20,minimum_separation_for_instant_rlof:0,minimum_separation_for_rlof:20,minimum_time_between_pn:0,minimum_timestep:0,mint:0,mint_data_cleanup:0,mint_dir:0,mint_disable_grid_load_warn:0,mint_kippenhahn:0,mint_kippenhahn_companion_stellar_typ:0,mint_kippenhahn_stellar_typ:0,mint_maximum_shell_mass:0,mint_metal:0,mint_minimum_shell_mass:0,mint_ms_rejuven:0,mint_nuclear_burn:0,mint_remesh:0,mint_use_zams_profil:0,mira:0,misc:10,miscellan:4,miss:[0,4,7],mix:[0,4,8],mixtur:0,mmax:2,mmin:[2,8],mnra:20,model:[0,1,5,8,12,15],modifi:0,modul:[0,7,8,11],modulo:8,moe:[2,4,6,10],moe_di_stefano_2017:6,moe_di_stefano_2017_multiplicity_fract:2,moe_di_stefano_2017_pdf:2,moment:[0,12,15,18],momenta:[0,14],momentum:0,mont:[0,8],monte_carlo_kick:0,more:[0,1,4,5,6,8,10,14,16,18],most:4,mostli:[4,5,7,8,12,14,15,17],move:0,msun:[0,2,5],much:[0,4],multi:8,multipl:[0,2,4,8],multiplc:0,multipli:[0,4,8],multiplicity_arrai:2,multiplicity_fraction_funct:8,multiplicity_model:8,multiplicity_modul:8,multiply_values_dict:4,multiprocess:[6,8],must:[0,2],my_header_lin:15,my_sss2:5,my_stellar_data:[1,5,12,15],myr:[0,5],n100:0,n100_z0:0,n100h:0,n100l:0,n10:0,n150:0,n1600:0,n1600c:0,n200:0,n20:0,n300c:0,n40:0,naked_helium_star_giant_branch:0,naked_helium_star_hertzsprung_gap:0,naked_main_sequence_helium_star:0,name:[1,4,5,6,7,12,15,17,19],natur:0,nauenberg:0,nearer:0,nebula:0,necessari:[4,5,6,12,15],need:[0,2,5,6,10,12,15,16],neg:[0,4],neither:[0,6],neleman:0,nelemans_gamma:0,nelemans_max_frac_j_chang:0,nelemans_minq:0,nelemans_n_comenv:0,nelemans_recalc_eccentr:0,nemp:0,nemp_cfe_minimum:0,nemp_nfe_minimum:0,nenamg:0,neon:0,nest:[4,6],network:0,neutrn:0,neutron:[0,12,15],neutron_star:0,never:0,newer:[0,2],newli:0,newopt:2,newton:0,next:4,nice:[1,6,14,15],nieuwenhuijzen:0,nieuwenhuijzen_windfac:0,nmax:2,no_thermohaline_mix:0,noecho:0,noechonow:0,noel:0,nolowq:8,nomin:0,non:[0,8],nonconservative_angmom_gamma:0,none:[0,1,2,4,5,6,7,8,12,20],nonzero:8,nor:0,norm:8,normal:[0,4],normalis:[2,8],normalize_dict:2,normalize_multipl:8,note:[0,5,8],notebook:[10,16],noth:[6,8],notifi:17,nova:0,nova_faml_multipli:0,nova_irradiation_multipli:0,nova_retention_algorithm_claeys2014:0,nova_retention_algorithm_const:0,nova_retention_algorithm_hillman2015:0,nova_retention_fract:0,nova_retention_method:0,nova_timestep_accelerator_index:0,nova_timestep_accelerator_max:0,nova_timestep_accelerator_num:0,now:[0,2,4,5],nuclear:0,nuclear_mass_hash:6,nuclear_mass_list:6,nucleosynthesi:[0,4],nucleosynthesis_sourc:4,nucreacmult:0,nucsyn:10,nucsyn_angelou_lithium:0,nucsyn_gce_outflow_check:0,nucsyn_hbb:0,nucsyn_metal:0,nucsyn_network:0,nucsyn_network_error:0,nucsyn_s_process:0,nucsyn_solv:0,nucsyn_third_dredge_up:0,nugi:0,number:[0,2,4,5,6,8,10,16],numer:4,numpi:[4,5,10,16,18],obj:4,object:[0,4,6,8,9,12,14,15],object_hook:4,object_pairs_hook:4,obtain:0,occur:[0,20],off:[0,5,12,15],offset:0,ohio:0,old:8,old_solut:[10,16],omega:0,onc:0,one:[0,4,5,6,8,14],onewd:0,onli:[0,4,5,6,8,20],onset:0,onto:[0,2],opac:0,opacity_algorithm:0,opacity_algorithm_ferguson_op:0,opacity_algorithm_paczynski:0,opacity_algorithm_star:0,opal:0,open:[12,15],opm:2,opt:[2,4],option:[0,1,2,4,5,6,10,11,12,15,16,20],orb:6,orbit:[0,2,12,14,15,20],orbit_evolut:14,orbital_inclin:0,orbital_inclinationi:0,orbital_period:[0,5,12,15,20],orbital_period_quadrupl:0,orbital_period_tripl:0,orbital_phas:0,orbital_phase_quadrupl:0,orbital_phase_tripl:0,orbiting_object:0,orbiting_objects_close_pc_threshold:0,orbiting_objects_log:0,orbiting_objects_tides_multipli:0,orbiting_objects_wind_accretion_multipli:0,order:[4,5,6],ordereddict:4,org:[0,2],origin:[10,16],other:[0,1,2,4,7,8,10,12,14,15,16],otherwis:[0,6,7,8],out:[4,7,8],outcom:0,outer:0,outfil:[6,12,15],outfile_nam:1,outfilenam:[12,15],output:[1,4,5,6,8,10,12,14,15,16,17,20],output_dir:6,output_fil:[4,7],output_filenam:6,output_lin:[4,12,15],outsid:[0,2],outward:0,over:[4,6,12,15],overflow:0,overlap:4,overrid:[2,5],overriden:[12,15],overshoot:0,overspin_algorithm:0,overspin_bs:0,overspin_massloss:0,own:[5,6,8,10,16],oxygen:0,oxygen_neon_white_dwarf:0,pack:[12,15],packag:[4,10,16,18],paczynski:0,page:[0,10,13,16],pair:[0,4],panda:[4,5,10,14,16],pane:14,panel:0,paper:0,param_nam:4,paramet:[1,2,4,6,7,8,10,12,14,15,17,18,20],parameter_nam:[4,6,12,15],parameter_value_input_typ:4,pars:[4,5,6,12,14,15,17],parse_binary_c_version_info:4,parse_cmdlin:6,parse_const:4,parse_float:4,parse_funct:[6,8,12,15,17],parse_function_hr_diagram:14,parse_function_mass:14,parse_function_orbit:14,parse_int:4,parse_output:5,parsec:2,part:[2,5,6,20],partial:0,particularli:0,pasp:2,pass:[5,6,8,10,14,16,17],path:[4,8,10,12,15,16],patho:[10,16],pdf:[0,2,10,16],pend:0,per:[0,4,6,8,12,15,20],percentag:0,peret:0,perform:0,perhap:0,periastron:0,pericent:20,period:[0,2,5,12,14,15,20],period_str:2,perl:1,pgo:0,phase:0,phasevol:0,phdi:0,photoevapor:0,php:2,physic:[12,15],pick:14,piec:[5,6],pinnsonneault:0,pisn:0,pkg:[10,16],place:0,placehold:14,plai:[0,6],plan:8,planetari:0,plaw2:8,pleas:[0,4],plot:[0,5,14],plot_funct:[10,11],plot_hr_diagram:14,plot_hr_diagram_singl:14,plot_mass:14,plot_orbit:14,plot_system:14,plot_typ:14,pls:6,plu:0,pms:14,pms_mass_1:14,pms_mass_2:14,pn_comenv_transition_tim:0,pn_fast_wind:0,pn_fast_wind_dm_agb:0,pn_fast_wind_dm_gb:0,pn_fast_wind_mdot_agb:0,pn_fast_wind_mdot_gb:0,pn_hall_fading_time_algorithm:0,pn_hall_fading_time_algorithm_maximum:0,pn_hall_fading_time_algorithm_minimum:0,pn_resolv:0,pn_resolve_maximum_envelope_mass:0,pn_resolve_minimum_effective_temperatur:0,pn_resolve_minimum_luminos:0,pne:0,pogg:0,point:[0,2,4,6,10,16],poisson:[2,8],pol:0,polytrop:0,popul:[0,2,6,7,9,10,12,16,18],population_id:8,population_set:6,posit:[0,2],possibl:[0,1,2,4,7,10,16],post:0,post_ce_adaptive_menv:0,post_ce_envelope_dm_eagb:0,post_ce_envelope_dm_gb:0,post_ce_envelope_dm_tpagb:0,post_ce_objects_have_envelop:0,post_sn_orbit_bs:0,post_sn_orbit_method:0,post_sn_orbit_tt98:0,postagb_legacy_log:0,potenti:0,power:[0,2],powerlaw:2,powerlaw_const:2,powerlaw_extrapolation_q:2,ppisn:0,ppisn_farmer19:0,ppisn_non:0,ppisn_prescript:0,ppn_envelope_mass:0,pre:[0,14],pre_events_stardata:0,pre_main_sequ:0,pre_main_sequence_fit_lob:0,precis:4,precod:[6,12,15],predefin:2,predict:8,predictor:0,prefer:[0,6],prefix:0,prepar:2,prepare_dict:2,prescript:0,prescrit:0,present:[2,4,6,12,15],preserv:0,preset:14,pressur:0,prevent:[0,8],previou:4,previous_stardata:1,primari:[1,2,6,12,15,20],print:[4,5,7,8,12,15],print_help:4,print_info:7,print_option_descript:7,print_structur:4,printf:[1,5,12,15],prior:0,privat:[6,7,10],prob_dict:2,probability_weighted_mass:8,probabl:[0,1,2,6,7,8,12,14,15],probdist:[6,12,15],problem:0,process:[0,4,5,6,8],profil:0,progenitor:0,program:[10,16],project:0,proper:7,properli:0,properti:[0,4,8,14],prot1:0,prot2:0,prot3:0,prot4:0,provid:[0,2,6,8,12,15,17],pseudorandom:0,puls:[0,20],pulsat:0,pump:0,purpos:[8,14],put:[1,4,5,6,8,12,14,15],py_rinterpol:[10,16],pyenv:[10,16],pysiz:4,pytest:[10,16],python3:[5,10,16],python:[4,5],q_high_extrapolation_method:8,q_interpol:2,q_low_extrapolation_method:8,qcrit_bh:0,qcrit_bs:0,qcrit_cheb:0,qcrit_chen_han_formula:0,qcrit_chen_han_t:0,qcrit_cowd:0,qcrit_degenerate_bh:0,qcrit_degenerate_cheb:0,qcrit_degenerate_cowd:0,qcrit_degenerate_eagb:0,qcrit_degenerate_gb:0,qcrit_degenerate_hegb:0,qcrit_degenerate_hehg:0,qcrit_degenerate_hem:0,qcrit_degenerate_hewd:0,qcrit_degenerate_hg:0,qcrit_degenerate_lmm:0,qcrit_degenerate_m:0,qcrit_degenerate_n:0,qcrit_degenerate_onewd:0,qcrit_degenerate_tpagb:0,qcrit_eagb:0,qcrit_gb:0,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,qcrit_hehg:0,qcrit_hem:0,qcrit_hewd:0,qcrit_hg:0,qcrit_hjellming_webbink:0,qcrit_lmm:0,qcrit_m:0,qcrit_n:0,qcrit_onewd:0,qcrit_q_no_comenv:0,qcrit_temmink2021:0,qcrit_tpagb:0,qcrit_vos2018:0,qcrits_:0,qcrits_degenerate_:0,qdata:2,qlimit:2,quad:8,quadrat:0,quadrulpl:0,quadrupl:[0,2,8],quantiti:14,queue:[6,8],quit:[0,4],r_l:20,radi:0,radiat:0,radii:[0,20],radiu:[0,1,12,14,15,20],radius_1:14,radius_2:14,ragb:20,raghavan2010_binary_fract:2,raghavan:2,rai:0,railton:0,rais:[0,4,8,12,15],ram:0,ran:8,random:[0,8],random_se:0,random_skip:0,random_system:0,random_systems_se:0,rang:[0,2,6,8,18],rapidli:0,rappaport:0,rate:[0,2],rather:[0,4,6,8,10,16],ratio:[0,2,12,15,20],raw:[4,5,6,8,14,17],raw_output:4,reach:0,reaction:0,read:4,real:6,realli:[0,6,7,8],reason:0,rebuild:[0,10,16],rebuilt:[10,16],recalcul:0,receiv:4,recombin:0,recommend:[1,6],recompil:[10,16],recurs:[4,6],recursive_change_key_to_float:4,recursive_change_key_to_str:4,red:0,redhat:1,redshift:2,reduc:0,reduct:8,regardless:14,region:0,reignit:0,reimer:0,reinstal:[10,16],reject:0,rejects_in_log:0,rejuven:0,rel:0,relat:0,releas:[4,10,16],remain:0,remesh:0,remnant:0,remov:[0,4,6],remove_fil:4,renormalis:2,rentrop:0,repeat:[0,8],repo:[10,16],report:0,repres:8,represent:[4,6],reproduc:0,requir:[0,2,4,5,14,15,17],reset:0,reset_pref:0,reset_star:0,reset_stars_default:0,resolut:[0,6,8,12,15],resolv:0,reson:0,respect:[0,2],respons:6,rest:[2,6],restructuredtext:4,result:[0,1,2,4,5,6,8,10,12,15,16],result_arrai:2,result_dict:2,result_example_head:5,result_example_header_1:5,result_example_header_2:5,retain:0,rethink:4,return_all_info:6,return_binary_c_version_info:[4,6],return_compilation_dict:1,return_help_al:4,return_maximum_mass_ratio_for_rlof:20,return_minimum_orbit_for_rlof:20,return_population_set:6,return_version_info:4,revap_in:0,revap_out:0,revers:[0,14],reverse_tim:0,revis:[0,4],rewrit:6,rhagavan:8,rich:0,riello:0,rin:0,ring:0,risk:6,ritter:0,rk2:0,rk4:0,rlof:[0,20],rlof_angular_momentum_transfer_model:0,rlof_angular_momentum_transfer_model_bs:0,rlof_angular_momentum_transfer_model_conserv:0,rlof_eccentric_as_circular:0,rlof_entry_threshold:0,rlof_f:0,rlof_interpolation_binary_c:0,rlof_interpolation_bs:0,rlof_interpolation_method:0,rlof_mdot_factor:0,rlof_mdot_modul:0,rlof_method:0,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,rlof_transition_objects_escap:0,rob:[0,2,20],robert:[10,16],roch:[0,20],roche_lob:20,rochelob:20,room:6,root:[10,16],rotat:[0,2],rotation:0,rotationally_enhanced_expon:0,rotationally_enhanced_mass_loss:0,rotationally_enhanced_massloss:0,rotationally_enhanced_massloss_angmom:0,rotationally_enhanced_massloss_langer_formula:0,rotationally_enhanced_massloss_langer_formula_and_angmom:0,rotationally_enhanced_massloss_non:0,rout:0,routin:[0,5,6,14],row:14,rring:0,rssd:2,rst:[4,7],rsun:14,rubric:6,run:[0,1,4,5,6,8,10,12,15,16,17],run_example_binari:5,run_example_binary_with_custom_log:5,run_example_binary_with_run_system:5,run_example_binary_with_writing_logfil:5,run_example_custom_logging_autogener:5,run_system:[5,14,17],run_system_wrapp:[5,10,11],run_zero_probability_system:8,runtim:[1,8],russel:0,rzam:20,s_option:8,sai:0,said:0,same:[0,4,5,8,10,12,15,16],sampl:[0,2,6,18],sample_valu:2,sampler:10,sana12:[2,12,15],sana:2,save:[0,1,2,12,15],save_pre_events_stardata:0,scalo:2,scanf:0,scene:5,scheme:0,schneider:0,schroeder:0,script:[3,5,10,16],sdb:0,sdist:[10,16],sdo:0,search:10,second:[0,2,4,14],secondari:[2,20],section:[2,4,9,10,16],see:[0,5,6,10,14,16],seed:0,seem:[10,14,16],seen:4,segment:18,seitenzahl2013_model:0,seitenzahl:0,select:[0,4,5],selected_head:[4,5],selector:0,self:[6,8,12,15],semi:0,sent:0,sentenc:1,sep:[2,5,6,12,15,20],sep_max:[12,15],sep_min:[12,15],separ:[0,2,4,5,6,7,12,14,15,20],separation_quadrupl:0,separation_tripl:0,separta:0,seper:[12,15],sequenc:0,seri:0,serialis:[4,6],serv:[4,5,12,15],server:6,set:[0,1,2,4,6,7,8,10,12,14,15,16],set_moe_di_stefano_set:6,set_opt:2,setup:[10,16,17],sever:[5,7,8,14,17],sfh:2,shara:0,share:[1,5,8,12,17],shared_lib_filenam:5,shell:0,shorten:0,should:[0,1,2,5,6,7,8,10,12,14,15,16,17],shouldn:[0,4],show:[0,3,8,14],show_plot:14,show_stellar_typ:14,shown:[0,14],siess:0,sigma:2,silent:4,sill:0,simpl:15,simpli:0,simul:[0,1,12,15],simulation_:6,sinc:[4,12,14,15],singl:[0,2,6,8,12,14,15],sit:0,size:[4,6,8],skip:[0,4,8,10,16],skipkei:4,sliced_df:5,slope:2,slow:0,slower:0,slurm:[6,8,9],slurm_grid:6,small:0,small_envelope_method:0,small_envelope_method_bs:0,small_envelope_method_miller_bertolami:0,smaller:0,sn_impulse_liu2015:0,sn_impulse_non:0,sn_impulse_wheeler1975:0,sn_kick_companion_a:0,sn_kick_companion_aic_bh:0,sn_kick_companion_bh_bh:0,sn_kick_companion_bh_n:0,sn_kick_companion_ecap:0,sn_kick_companion_grb_collapsar:0,sn_kick_companion_hestaria:0,sn_kick_companion_ia_chand:0,sn_kick_companion_ia_chand_co:0,sn_kick_companion_ia_eld:0,sn_kick_companion_ia_h:0,sn_kick_companion_ia_he_co:0,sn_kick_companion_ia_hybrid_hecowd:0,sn_kick_companion_ia_hybrid_hecowd_sublumin:0,sn_kick_companion_ibc:0,sn_kick_companion_ii:0,sn_kick_companion_iia:0,sn_kick_companion_ns_n:0,sn_kick_companion_phdi:0,sn_kick_companion_pisn:0,sn_kick_companion_ppisn:0,sn_kick_companion_tz:0,sn_kick_companion_wdkick:0,sn_kick_dispersion_aic_bh:0,sn_kick_dispersion_bh_bh:0,sn_kick_dispersion_bh_n:0,sn_kick_dispersion_ecap:0,sn_kick_dispersion_grb_collapsar:0,sn_kick_dispersion_ia_hybrid_hecowd:0,sn_kick_dispersion_ia_hybrid_hecowd_sublumin:0,sn_kick_dispersion_ibc:0,sn_kick_dispersion_ii:0,sn_kick_dispersion_ns_n:0,sn_kick_dispersion_phdi:0,sn_kick_dispersion_pisn:0,sn_kick_dispersion_ppisn:0,sn_kick_dispersion_tz:0,sn_kick_distribution_aic_bh:0,sn_kick_distribution_bh_bh:0,sn_kick_distribution_bh_n:0,sn_kick_distribution_ecap:0,sn_kick_distribution_grb_collapsar:0,sn_kick_distribution_ia_hybrid_hecowd:0,sn_kick_distribution_ia_hybrid_hecowd_sublumin:0,sn_kick_distribution_ibc:0,sn_kick_distribution_ii:0,sn_kick_distribution_ns_n:0,sn_kick_distribution_phdi:0,sn_kick_distribution_pisn:0,sn_kick_distribution_ppisn:0,sn_kick_distribution_tz:0,sneia:0,snia:0,solar:[0,2,20],solver:0,solver_forward_eul:0,solver_predictor_corrector:0,solver_rk2:0,solver_rk4:0,some:[0,1,2,5,6,8,10,12,14,15,16],someth:[0,6],soon:18,sort:4,sort_kei:4,sourc:[1,2,3,4,5,6,7,8,11,14,15,17,18,20],source_file_filenam:8,source_list:6,sourcecod:[10,16],sourcefile_nam:1,space:[0,6,18],spacing_funct:[10,11],spacingfunc:[6,12,15],spacingfunct:6,special:0,specif:[0,4,14],specifi:[0,8],spectral:2,speed:[0,8],speedtest:0,spent:4,spheric:0,spin:0,spinrat:0,split:[0,8,12,15],splitpoint:0,spread:6,sqrt:0,src:[10,16],st1:5,st2:5,stabil:0,stabl:0,stancliff:0,standard:[0,2],star:[1,2,5,6,8,10,12,14,15,20],star_with_no_mass:0,stardata:[0,1,5,12,15],stardata_dump_filenam:0,stardata_load_filenam:0,start:[0,1,4,5,6,7,8],start_tim:0,state:0,statement:[1,5],statist:0,statu:[0,1],stderr:0,stdout:4,steadi:0,stefan:14,stefano:[4,6,10],stellar:[0,2,8,14,19],stellar_structure_algorithm:0,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,10,11,12,14,15],stellar_type_1:[0,14],stellar_type_2:[0,14],stellar_type_3:0,stellar_type_4:0,stellar_type_dict:19,stellar_type_dict_short:19,step:[6,14,18],stepsiz:6,stick:8,stiff:0,still:[1,8],stop:[0,4],stopfil:0,storag:0,store:[0,2,4,6,8,10,16,20],store_memaddr:20,str:[1,4,6,7,14],straight:6,straniero:0,streamhandl:6,strength:0,strict:4,string:[0,1,4,6,7,8,14,17],strip:0,stronger:0,struct:0,structur:[0,4,8,14],stuff:[4,8,12,14,15],style:0,sub:[0,4],subdict:4,subject:0,sublumin:0,submit:10,subroutin:9,subsequ:0,subtract:4,subtract_dict:4,succe:0,suggest:[0,10,16],suit:[10,16],sum:0,sundial:0,supercrit:0,supernova:[0,8],superwind:0,superwind_mira_switchon:0,supress:[12,15],sure:[2,6,8,10,14,16,17],surfac:0,surviv:0,survivor:0,switcher:0,symmetr:0,synchron:0,synonym:0,synthesi:[8,10,16],sys:5,system:[0,4,5,6,8,10,12,14,15,16,17],system_gener:6,system_queue_fil:6,t_re:5,tabl:[0,2],take:[0,2,4,5,6,8,12,15,17],taken:[0,4],tar:[10,16],target:[1,7],task:[0,2,4,5,6,7,9,14,17,18,20],tauri:0,tbse:0,teff:[0,2],teff_1:14,teff_2:14,tell:4,temp_dir:[4,12,15],temperatur:[0,2,14],tempfil:5,termin:[1,10,16],test:[0,4,6,8,10,16,20],test_log:5,test_pop:[12,15],text:[4,7],than:[0,2,4,8,10,16],thats:[12,15],thei:[0,2,4,6,8,14],thelog:0,them:[2,4,5,6,12,15],themselv:[2,4],thermal:[0,2,20],thermally_pulsing_asymptotic_giant_branch:0,thermohalin:0,thesi:0,thi:[0,1,2,3,4,5,6,7,8,10,11,12,14,15,16,17,18,20],thick:0,thick_disc_end_ag:0,thick_disc_logg_max:0,thick_disc_logg_min:0,thick_disc_start_ag:0,thin:0,thing:[0,2,4,5,6,7,12,15,17],think:[0,4,6],third:[0,2],third_dup:0,third_dup_multipli:0,thorn:0,those:[4,5,6,10,12,15,16],thread:8,thread_id:8,three:[0,2],three_part_powerlaw:[2,12,15],threshold:[0,4,8],through:[6,14,17],throughout:6,tidal:0,tidal_strength_factor:0,tide:0,tides_convective_damp:0,tides_hurley2002:0,tides_zahn1989:0,time:[0,1,2,4,5,6,8,10,12,14,15,16],timescal:0,timestamp:8,timestep:0,timestep_limit:0,timestep_log:0,timestep_modul:0,timestep_multipli:0,timestep_solver_factor:0,tinslei:2,titl:[7,13],tmp:[0,4,10,12,16],tmp_dir:[6,8],tmp_tabl:2,todo:[0,1,2,4,6,7,8,12,14,15,17,18,20],toler:0,too:[0,4,8,10,16,17],topic:0,torqu:0,total:[0,2,4,6,8,14],tout:[0,20],tpagb:0,tpagb_reimers_eta:0,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,tpagbwindfac:0,traceback:4,track:[8,14],trade:0,transfer:0,transform:[0,4],transit:0,treat:0,trigger:0,tripl:[0,2,8],truli:0,tupl:1,turn:[0,4,12,15],two:[0,4,19,20],txt:[5,6,17],type:[0,1,2,4,6,7,8,14,18,19,20],type_ia_mch_supernova_algorithm:0,type_ia_sub_mch_supernova_algorithm:0,typic:0,ubvri:0,ugriv:0,uncom:6,under:18,undergo:0,understand:6,undescrib:7,uniform:2,union:[2,4,6,18,20],uniqu:[4,6,8],unit:[0,20],univari:0,unknown:17,unless:[1,6,8],unload:6,unrecogn:[10,16],unsign:0,unstabl:0,until:[0,2,4,6],unus:[0,8],updat:[2,4,6,10,12,15,16],update_dict:4,upper:[0,2,18],usag:0,use:[0,2,4,5,6,8,9,10,12,14,15,16,17],use_astropy_valu:14,use_datadir:[6,12,15],use_fixed_timestep_:0,use_periastron_roche_radiu:0,use_tabular_intershell_abundances_karakas_2012:0,used:[0,1,2,4,6,8,12,14,15],useful:[0,4,6,8,10,16,17,20],useful_func:[10,11],user:[1,2,4,6,7,8,17],uses:[0,5,8,12,15],using:[0,1,3,5,6,10,12,15,16],usr:5,usual:[0,2,8],util:[1,2,4,5,6,7,12,14,15,17,18,20],val:2,valid:[0,2,4],valu:[0,1,2,4,5,6,7,8,12,14,15],valueerror:[12,15],valuerang:[6,12,15],van:0,vandenheuvel_log:0,vari:0,variabl:[0,4,6,8,12,15],variant:0,variou:0,vassiliadi:0,veloc:[0,2],verbos:[1,2,4,8,10,12,15,16],verbose_print:4,veri:[0,5,6,15,18],versa:20,version:[0,4,6,10,16],version_info:4,version_info_str:4,version_onli:0,via:[6,8,12,14,15],vice:20,vink:0,virtual:[10,16],virtualenviron:[10,16],viscos:0,viscou:0,visit:10,volum:0,vrot1:0,vrot2:0,vrot3:0,vrot4:0,vrot_breakup:0,vrot_bs:0,vrot_non_rot:0,vrot_sync:0,vw93:0,vw93_eagb_wind_spe:0,vw93_mira_shift:0,vw93_multipli:0,vw93_tpagb_wind_spe:0,vwind:0,vwind_beta:0,vwind_multipli:0,wai:[0,3,4,6,8,12,14,15],wang:0,want:[0,2,4,5,6,7,8,12,14,15],warmup_cpu:0,warn:0,wave:0,wd_accretion_rate_new_giant_envelope_lower_limit_helium_donor:0,wd_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor:0,wd_accretion_rate_new_giant_envelope_lower_limit_other_donor:0,wd_accretion_rate_novae_upper_limit_helium_donor:0,wd_accretion_rate_novae_upper_limit_hydrogen_donor:0,wd_accretion_rate_novae_upper_limit_other_donor:0,wd_kick:0,wd_kick_at_every_puls:0,wd_kick_at_given_puls:0,wd_kick_direct:0,wd_kick_end_agb:0,wd_kick_first_rlof:0,wd_kick_pulse_numb:0,wd_kick_when:0,wd_sigma:0,wdwd_merger_algorithm:0,wdwd_merger_algorithm_bs:0,wdwd_merger_algorithm_chen2016:0,wdwd_merger_algorithm_perets2019:0,weight:[0,8],well:[0,4,8,10,16],were:4,what:[0,1,2,4,5,6,7,8,10,12,15,16,17],whatev:[5,6,10,16],wheeler:0,when:[0,1,2,4,5,6,7,8,10,12,15,16,17],whenev:[10,16],where:[0,1,2,4,6,7,8,10,16],whether:[0,2,4,6,7,8,14,20],which:[0,1,2,3,4,5,6,7,8,10,12,15,16,17,20],whichev:8,white:0,white_dwarf_cooling_carrasco2014:0,white_dwarf_cooling_mestel:0,white_dwarf_cooling_mestel_modifi:0,white_dwarf_cooling_model:0,white_dwarf_radius_carrasco2014:0,white_dwarf_radius_model:0,white_dwarf_radius_mu:0,white_dwarf_radius_nauenberg1972:0,whole:[6,8],width:0,wind:0,wind_algorithm_binary_c_2020:0,wind_algorithm_hurley2002:0,wind_algorithm_non:0,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,wind_disc_angmom_fract:0,wind_disc_mass_fract:0,wind_djorb_fac:0,wind_gas_to_dust_ratio:0,wind_lbv_luminosity_lower_limit:0,wind_mass_loss:0,wind_multiplier_:0,wind_nieuwenhuijzen_luminosity_lower_limit:0,wind_type_multiplier_:0,within:[0,4,6,10,16],without:[2,6,8],won:0,wood:0,work:[0,4,5,10,14,15,16],would:[0,4,14],wouldn:6,wr_wind:0,wr_wind_bs:0,wr_wind_eldridg:0,wr_wind_fac:0,wr_wind_maeder_meynet:0,wr_wind_nugis_lam:0,wrap:[1,12,15],wrapper:[4,5,20],write:[1,4,5,6,7,8,12,15,17],write_binary_c_calls_to_fil:6,write_binary_c_parameter_descriptions_to_rst_fil:4,write_grid_options_to_rst_fil:7,written:[5,6,7,8,12,15,17],wrlof_mass_transf:0,wrlof_method:0,wrlof_non:0,wrlof_q_depend:0,wrlof_quadrat:0,wrong:[10,16],wrwindfac:0,wtts2:0,wtts_log:0,www:[0,2],year:[0,2],yet:[0,4,5,6,8,12,14,15],yield:0,you:[0,1,4,5,6,7,8,10,12,14,15,16,20],young:0,your:[5,8,10,16],yourself:[12,14,15],zahn:0,zam:[0,2,17,20],zams_collis:20,zams_mass:[12,15],zero:[0,1,8],zero_ag:[12,15],zone:0,zoom:0,zoomfac_multiplier_decreas:0,zoomfac_multiplier_increas:0,zsolar:2,zytkow:0},titles:["Binary_c parameters","custom_logging_functions module","distribution_functions module","Examples","functions module","Examples","grid_class module","Grid options and descriptions","Population grid code options","hpc_functions module","Welcome to binary_c-python\u2019s documentation!","Binarycpython code","Title page","Notebooks","plot_functions module","Example of population script","Python module for binary_c","run_system_wrapper module","spacing_functions module","stellar_types module","useful_funcs module"],titleterms:{"function":4,"public":8,after:[10,16],algorithm:0,binari:0,binary_c:[0,10,16],binarycpython:11,build:[10,16],code:[8,11],custom_logging_funct:1,descript:7,distribution_funct:2,document:[10,16],environ:[10,16],exampl:[3,5,10,15,16],faq:[10,16],from:[10,16],grid:[7,8],grid_class:6,hpc_function:9,indic:10,input:0,instal:[10,16],instruct:[10,16],issu:[10,16],misc:0,modul:[1,2,4,6,9,10,14,16,17,18,19,20],moe:8,note:[10,16],notebook:13,nucsyn:0,option:[7,8],output:0,page:12,paramet:0,pip:[10,16],plot_funct:14,popul:[8,15],privat:8,python:[10,16],requir:[10,16],run_system_wrapp:17,sampler:8,script:15,section:0,sourc:[10,16],spacing_funct:18,star:0,stefano:8,stellar_typ:19,tabl:10,titl:12,usag:[10,16],useful_func:20,variabl:[10,16],via:[10,16],welcom:10}}) \ No newline at end of file diff --git a/docs/build/html/spacing_functions.html b/docs/build/html/spacing_functions.html index 54326c897243395d6b69b6a975efc400578dbaeb..edc1390990f545b27c19d4b246840a8cc87606a2 100644 --- a/docs/build/html/spacing_functions.html +++ b/docs/build/html/spacing_functions.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.spacing_functions"> + +<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="module-binarycpython.utils.spacing_functions"> <span id="spacing-functions-module"></span><h1>spacing_functions module<a class="headerlink" href="#module-binarycpython.utils.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> <dl class="simple"> @@ -235,9 +262,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/stellar_types.html b/docs/build/html/stellar_types.html index 391be9d90a2934af73f8a1a6675e58e8b0837715..193b7a074b0a2e1d9a3965d6279e5930669981f3 100644 --- a/docs/build/html/stellar_types.html +++ b/docs/build/html/stellar_types.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.stellar_types"> + +<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="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"> @@ -216,9 +243,9 @@ provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/build/html/useful_funcs.html b/docs/build/html/useful_funcs.html index 2b4f5ddea24055f41418117a70a97c740c16e4d1..45b51577f9bdafe08d7a374a02a9cddbfe7edeab 100644 --- a/docs/build/html/useful_funcs.html +++ b/docs/build/html/useful_funcs.html @@ -30,6 +30,9 @@ <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/language_data.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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <script type="text/javascript" src="_static/js/theme.js"></script> @@ -171,7 +174,31 @@ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> - <div class="section" id="module-binarycpython.utils.useful_funcs"> + +<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="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> @@ -183,11 +210,14 @@ <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>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> </ul> </dd> <dt>Tasks:</dt><dd><ul class="simple"> <li><p>TODO: check whether these functions are correct</p></li> -<li><p>TODO: add unittest for maximum_mass_ratio_for_RLOF</p></li> +<li><p>TODO: add unit test for maximum_mass_ratio_for_RLOF</p></li> </ul> </dd> </dl> @@ -257,14 +287,14 @@ <dt id="binarycpython.utils.useful_funcs.minimum_period_for_RLOF"> <code class="sig-prename descclassname">binarycpython.utils.useful_funcs.</code><code class="sig-name descname">minimum_period_for_RLOF</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">M1</span></em>, <em class="sig-param"><span class="n">M2</span></em>, <em class="sig-param"><span class="n">metallicity</span></em>, <em class="sig-param"><span class="n">store_memaddr</span><span class="o">=</span><span class="default_value">- 1</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">[source]</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> +<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"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>M1</strong> – Primary mass in solar mass</p></li> <li><p><strong>M2</strong> – Secondary mass in solar mass</p></li> <li><p><strong>metallicity</strong> – metallicity</p></li> -<li><p><strong>store_memaddr</strong> (<em>optional</em>) – store memory adress</p></li> +<li><p><strong>store_memaddr</strong> (<em>optional</em>) – store memory address</p></li> </ul> </dd> <dt class="field-even">Returns</dt> @@ -411,9 +441,9 @@ determine if two stars collide on the ZAMS</p> provided by <a href="https://readthedocs.org">Read the Docs</a>. <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. diff --git a/docs/source/_templates/footer.html b/docs/source/_templates/footer.html index 2d75d5c50f868db37d63a887788d8fa2b2adb837..6eb6edade2d8028c0b4f1e683baeb57afa41d7ac 100644 --- a/docs/source/_templates/footer.html +++ b/docs/source/_templates/footer.html @@ -2,8 +2,8 @@ {%- block extrafooter %} <br><br> -Generated on binarycpython git branch: development_version/2.1.7 git revision 22f07b8a31dab843d58073f9b3da63a5f40b852b url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/development_version/2.1.7">git url</a>. +Generated on binarycpython git branch: feature/binaryc_notebook_docs git revision 9da0c3480c4b6b62e6d4edc2d3e8b8a16079b020 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/binaryc_notebook_docs">git url</a>. <br><br> -Using binary_c with bit branch branch_david: git revision: "6044:20210720:d1ed5b6c1" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. +Using binary_c with bit branch branch_david: git revision: "6068:20210727:8955b541d" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>. {% endblock %} \ No newline at end of file diff --git a/docs/source/binary_c_parameters.rst b/docs/source/binary_c_parameters.rst index cdca213e0895c0790c4f7097c7731afe40b9e315..0c1a4dd88ee625380f747f05594385a18ea74e0b 100644 --- a/docs/source/binary_c_parameters.rst +++ b/docs/source/binary_c_parameters.rst @@ -4,7 +4,7 @@ The following chapter contains all the parameters that the current version of bi This information was obtained by the following binary_c build: - **binary_c git branch**: branch_david **binary_c git revision**: 6044:20210720:d1ed5b6c1 **Built on**: Jul 20 2021 13:54:45 + **binary_c git branch**: branch_david **binary_c git revision**: 6068:20210727:8955b541d **Built on**: Jul 27 2021 22:36:46 Section: stars diff --git a/docs/source/conf.py b/docs/source/conf.py index cb25228599ceb5b3605588e6989f2041502d7907..2ed92c07178bdba851ec0d59af3ad0e8e01c7e0d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,6 +50,7 @@ extensions = [ "m2r2", "sphinx_rtd_theme", "sphinx_autodoc_typehints", # https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html + "nbsphinx", ] diff --git a/docs/source/examples.rst b/docs/source/examples.rst index ab58720d9b5a670eb13d8468daa687e72ab86e52..16e4dc3a0f7b7bcd92dd5e32e85b18e708fdc653 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -6,4 +6,5 @@ This chapter contains the source code of example scripts which show the way of u :hidden: general_examples - population_example \ No newline at end of file + population_example + notebooks \ No newline at end of file diff --git a/docs/source/grid_options_descriptions.rst b/docs/source/grid_options_descriptions.rst index 5a77792e1c16a5d29844979038458f27e145a08d..319b8d56a6d616f55498ec2c10fbc358a8de8183 100644 --- a/docs/source/grid_options_descriptions.rst +++ b/docs/source/grid_options_descriptions.rst @@ -13,19 +13,21 @@ The following options are meant to be changed by the user. | **C_logging_code**: 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. -| **amt_cores**: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multiprocessed, not multithreaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int +| **amt_cores**: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multi processed, not multi threaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int -| **combine_ensemble_with_thread_joining**: BOolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{popuation_id}_{thread_id}.json +| **combine_ensemble_with_thread_joining**: Boolean 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 | **condor**: Int flag whether to use a condor type population evolution. Not implemented yet. -| **custom_logging_func_memaddr**: Memory adress where the custom_logging_function is stored. Input: int +| **custom_logging_func_memaddr**: Memory address where the custom_logging_function is stored. Input: int + +| **do_dry_run**: Whether to do a dry run to calculate the total probability for this run | **ensemble_factor_in_probability_weighted_mass**: Flag to multiply all the ensemble results with 1/probability_weighted_mass | **evolution_type**: Variable containing the type of evolution used of the grid. Multiprocessing or linear processing -| **failed_systems_threshold**: Variable storing the maximum amount of systems that are allowed to fail before logging their commandline arguments to failed_systems log files +| **failed_systems_threshold**: Variable storing the maximum amount of systems that are allowed to fail before logging their command line arguments to failed_systems log files | **gridcode_filename**: 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. @@ -35,7 +37,7 @@ The following options are meant to be changed by the user. | **log_file**: Log file for the population object. Unused -| **log_runtime_systems**: 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 alot 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 +| **log_runtime_systems**: 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 | **m&s_options**: Internal variable that holds the M&S options. Don't write to this your self @@ -49,20 +51,20 @@ The following options are meant to be changed by the user. | **repeat**: Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating. -| **run_zero_probability_system**: Whether to run the zero probability systems. Default: True. Input: boolean +| **run_zero_probability_system**: Whether to run the zero probability systems. Default: True. Input: Boolean -| **slurm**: Int flag whether to use a slurm type population evolution. +| **slurm**: Int flag whether to use a Slurm type population evolution. -| **source_file_filename**: Variable containing the source file containing lines of binary_c commandline calls. These all have to start with binary_c. +| **source_file_filename**: Variable containing the source file containing lines of binary_c command line calls. These all have to start with binary_c. | **tmp_dir**: 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 | **verbosity**: 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. -| **weight**: Weight factor for each system. The calculated probability is mulitplied 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. +| **weight**: 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. -Moe & Distefano sampler options -------------------------------- +Moe & di Stefano sampler options +-------------------------------- The following options are meant to be changed by the user. @@ -71,7 +73,7 @@ The following options are meant to be changed by the user. | **multiplicity_model**: multiplicity model (as a function of log10M1) - You can use 'Poisson' which uses the system multiplicty + You can use 'Poisson' which uses the system multiplicity given by Moe and maps this to single/binary/triple/quad fractions. @@ -90,13 +92,13 @@ The following options are meant to be changed by the user. | **normalize_multiplicities**: - 'norm': normalize so the whole population is 1.0 + 'norm': normalise so the whole population is 1.0 after implementing the appropriate fractions S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) - given a mix of multiplities, you can either (noting that + given a mix of multiplicities, you can either (noting that here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) ) note: if you only set one multiplicity_modulator - to 1, and all the others to 0, then normalizing + to 1, and all the others to 0, then normalising will mean that you effectively have the same number of stars as single, binary, triple or quad (whichever is non-zero) i.e. the multiplicity fraction is ignored. @@ -105,7 +107,7 @@ The following options are meant to be changed by the user. 'raw' : stick to what is predicted, i.e. S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q) - without normalization + without normalisation (in which case the total probability < 1.0 unless all you use single, binary, triple and quadruple) @@ -160,9 +162,9 @@ The following options are not meant to be changed by the user, as these options | **_end_time_evolution**: Variable storing the end timestamp of the population evolution. Set by the object itself -| **_errors_exceeded**: Variable storing a boolean flag whether the amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the commandline arguments of the failing systems will not be stored in the failed_system_log files. +| **_errors_exceeded**: Variable storing a Boolean flag whether the amount 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. -| **_errors_found**: Variable storing a boolean flag whether errors by binary_c are encountered. +| **_errors_found**: Variable storing a Boolean flag whether errors by binary_c are encountered. | **_evolution_type_options**: List containing the evolution type options. @@ -186,9 +188,9 @@ The following options are not meant to be changed by the user, as these options | **_start_time_evolution**: Variable storing the start timestamp of the population evolution. Set by the object itself. -| **_store_memaddr**: Memory adress of the store object for binary_c. +| **_store_memaddr**: Memory address of the store object for binary_c. -| **_system_generator**: Function object that contains the system generator function. This can be from a grid, or a source file, or a montecarlo grid. +| **_system_generator**: Function object that contains the system generator function. This can be from a grid, or a source file, or a Monte Carlo grid. | **_total_mass_run**: To count the total mass that thread/process has ran diff --git a/docs/source/notebook_population.ipynb b/docs/source/notebook_population.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..8d2bdbf982952c3a9debf9213d52656f2d8fa76e --- /dev/null +++ b/docs/source/notebook_population.ipynb @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "bbbaafbb-fd7d-4b73-a970-93506ba35d71", + "metadata": {}, + "source": [ + "# Title page\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6b8673-a2b5-4b50-ad1b-e90671f57470", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from binarycpython.utils.grid import Population\n", + "from binarycpython.utils.functions import (\n", + " get_help_all,\n", + " get_help,\n", + " create_hdf5,\n", + " output_lines,\n", + ")\n", + "from binarycpython.utils.custom_logging_functions import temp_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ab50b7-591f-4883-af09-116d1835a751", + "metadata": {}, + "outputs": [], + "source": [ + "#########################################################\n", + "# This file serves as an example for running a population.\n", + "# The use of help(<function>) is a good way to inspect what parameters are there to use\n", + "#########################################################\n", + "\n", + "# Create population object\n", + "example_pop = Population()\n", + "\n", + "# If you want verbosity, set this before other things\n", + "example_pop.set(verbose=1)\n", + "\n", + "# Setting values can be done via .set(<parameter_name>=<value>)\n", + "# Values that are known to be binary_c_parameters are loaded into bse_options.\n", + "# Those that are present in the default grid_options are set in grid_options\n", + "# All other values that you set are put in a custom_options dict\n", + "example_pop.set(\n", + " # binary_c physics options\n", + " M_1=10, # bse_options\n", + " separation=0, # bse_options\n", + " orbital_period=45000000080, # bse_options\n", + " max_evolution_time=15000, # bse_options\n", + " eccentricity=0.02, # bse_options\n", + " # Set companion to low mass\n", + " M_2=0.08, # Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.\n", + " # grid_options\n", + " amt_cores=2, # grid_options\n", + " verbose=1, # verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff\n", + " # Custom options # TODO: need to be set in grid_options probably\n", + " data_dir=os.path.join(\n", + " temp_dir(), \"example_python_population_result\"\n", + " ), # custom_options\n", + " base_filename=\"example_pop.dat\", # custom_options\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c986215-93b1-4e30-ad79-f7c397e9ff7d", + "metadata": {}, + "outputs": [], + "source": [ + "def parse_function(self, output):\n", + " # EXAMPLE PARSE_FUNCTION\n", + "\n", + " # extract info from the population instance\n", + "\n", + " # Get some information from the\n", + " data_dir = self.custom_options[\"data_dir\"]\n", + " base_filename = self.custom_options[\"base_filename\"]\n", + "\n", + " # Check directory, make if necessary\n", + " os.makedirs(data_dir, exist_ok=True)\n", + "\n", + " seperator = \" \"\n", + "\n", + " # Create filename\n", + " outfilename = os.path.join(data_dir, base_filename)\n", + "\n", + " parameters = [\"time\", \"mass\", \"zams_mass\", \"probability\", \"radius\", \"stellar_type\"]\n", + "\n", + " # Go over the output.\n", + " for el in output_lines(output):\n", + " headerline = el.split()[0]\n", + "\n", + " # CHeck the header and act accordingly\n", + " if headerline == \"MY_STELLAR_DATA\":\n", + " values = el.split()[1:]\n", + " print(values)\n", + "\n", + " if not len(parameters) == len(values):\n", + " print(\"Amount of column names isnt equal to amount of columns\")\n", + " raise ValueError\n", + "\n", + " if not os.path.exists(outfilename):\n", + " with open(outfilename, \"w\") as f:\n", + " f.write(seperator.join(parameters) + \"\\n\")\n", + "\n", + " with open(outfilename, \"a\") as f:\n", + " f.write(seperator.join(values) + \"\\n\")\n", + "\n", + "\n", + "\n", + "# Creating a parsing function\n", + "example_pop.set(\n", + " parse_function=parse_function, # Setting the parse function thats used in the evolve_population\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fa5188e-312f-4a05-aeda-0bd4c00629c8", + "metadata": {}, + "outputs": [], + "source": [ + "### Custom logging\n", + "# Log the moment when the star turns into neutron\n", + "example_pop.set(\n", + " C_logging_code=\"\"\"\n", + "if(stardata->star[0].stellar_type >= 13) \n", + "{\n", + " if (stardata->model.time < stardata->model.max_evolution_time)\n", + " {\n", + " Printf(\"MY_STELLAR_DATA %30.12e %g %g %g %g %d\\\\n\",\n", + " // \n", + " stardata->model.time, // 1\n", + " stardata->star[0].mass, // 2\n", + " stardata->common.zero_age.mass[0], // 4\n", + " stardata->model.probability, // 5\n", + " stardata->star[0].radius, // 6\n", + " stardata->star[0].stellar_type // 7\n", + " );\n", + " };\n", + " /* Kill the simulation to save time */\n", + " stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;\n", + "};\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd197154-a8ce-4865-8929-008d3483101a", + "metadata": {}, + "outputs": [], + "source": [ + "# Add grid variables\n", + "resolution = {\"M_1\": 20, \"q\": 20, \"per\": 40}\n", + "\n", + "# Mass\n", + "example_pop.add_grid_variable(\n", + " name=\"lnm1\",\n", + " longname=\"Primary mass\",\n", + " valuerange=[2, 150],\n", + " resolution=\"{}\".format(resolution[\"M_1\"]),\n", + " spacingfunc=\"const(math.log(2), math.log(150), {})\".format(resolution[\"M_1\"]),\n", + " precode=\"M_1=math.exp(lnm1)\",\n", + " probdist=\"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1\",\n", + " dphasevol=\"dlnm1\",\n", + " parameter_name=\"M_1\",\n", + " condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + ")\n", + "\n", + "# # Mass ratio\n", + "# test_pop.add_grid_variable(\n", + "# name=\"q\",\n", + "# longname=\"Mass ratio\",\n", + "# valuerange=[\"0.1/M_1\", 1],\n", + "# resolution=\"{}\".format(resolution['q']),\n", + "# spacingfunc=\"const(0.1/M_1, 1, {})\".format(resolution['q']),\n", + "# probdist=\"flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])\",\n", + "# dphasevol=\"dq\",\n", + "# precode=\"M_2 = q * M_1\",\n", + "# parameter_name=\"M_2\",\n", + "# condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + "# )\n", + "\n", + "# #\n", + "# test_pop.add_grid_variable(\n", + "# name=\"log10per\", # in days\n", + "# longname=\"log10(Orbital_Period)\",\n", + "# valuerange=[0.15, 5.5],\n", + "# resolution=\"{}\".format(resolution[\"per\"]),\n", + "# spacingfunc=\"const(0.15, 5.5, {})\".format(resolution[\"per\"]),\n", + "# precode=\"\"\"orbital_period = 10** log10per\n", + "# sep = calc_sep_from_period(M_1, M_2, orbital_period)\n", + "# sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)\n", + "# sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)\"\"\",\n", + "# probdist=\"sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)\",\n", + "# parameter_name=\"orbital_period\",\n", + "# dphasevol=\"dlog10per\",\n", + "# )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8c96b151-8c3b-4479-969f-6c2f898497a5", + "metadata": {}, + "source": [ + "Exporting of all the settings can be done with .export_all_info()\n", + "on default it exports everything, but can be supressed by turning it off:\n", + " population settings (bse_options, grid_options, custom_options), turn off with include_population\n", + " settings=False\n", + " binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults).\n", + " turn off with include_binary_c_defaults=False\n", + " include_binary_c_version_info (all the compilation info, and information about the compiled\n", + " parameters), turn off with include_binary_c_version_info=False\n", + " include_binary_c_help_all (all the help information for all the binary_c parameters),\n", + " turn off with include_binary_c_help_all=Fase\n", + "On default it will write this to the custom_options['data_dir'], but that can be overriden by\n", + " setting use_datadir=False and providing an outfile=<>" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ba83443c-64b4-4126-90b3-b1ca76c0f73d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_pop.export_all_info()" + ] + }, + { + "cell_type": "markdown", + "id": "ef5b51a1-e56d-4bec-a5c7-b9d5bceeceba", + "metadata": {}, + "source": [ + "Executing a single system\n", + "This uses the M_1 orbital period etc set with the set function" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "c0a9aed7-1fc9-4fe3-8bcf-4e987bfc00a9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating the code for the shared library for the custom logging\n", + "['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13']\n", + "None\n" + ] + } + ], + "source": [ + "output = example_pop.evolve_single()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea376c1-1e92-45af-8cab-9d7fdca564eb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "## Executing a population\n", + "## This uses the values generated by the grid_variables\n", + "example_pop.evolve() # TODO: update this function call" + ] + }, + { + "cell_type": "markdown", + "id": "ce937b07-7292-4bb1-b2e7-d69e51bdff6e", + "metadata": { + "tags": [] + }, + "source": [ + "Wrapping up the results to an hdf5 file can be done by using the create_hdf5\n", + "(<directory containing data and settings>) This function takes the settings file\n", + "(ending in _settings.json) and the data files (ending in .dat) from the data_dir\n", + "and packing them into an hdf5 file, which is then written into the same data_dir directory" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ad444138-f854-4fdb-8e18-49e35ac9c7e2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5\n", + "Adding settings to HDF5 file\n", + "Adding data to HDF5 file\n" + ] + } + ], + "source": [ + "create_hdf5(data_dir=example_pop.custom_options[\"data_dir\"], name=\"example_pop.hdf5\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34da69bc-fe60-4a9d-b07a-f6cd2f216964", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/source/notebooks.rst b/docs/source/notebooks.rst new file mode 100644 index 0000000000000000000000000000000000000000..8002bcb2bc18ba071f737026c70fa34f8297207b --- /dev/null +++ b/docs/source/notebooks.rst @@ -0,0 +1,10 @@ +Notebooks +========= +The notebooks. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + notebook_population.ipynb diff --git a/examples/notebook_population.ipynb b/examples/notebook_population.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..8d2bdbf982952c3a9debf9213d52656f2d8fa76e --- /dev/null +++ b/examples/notebook_population.ipynb @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "bbbaafbb-fd7d-4b73-a970-93506ba35d71", + "metadata": {}, + "source": [ + "# Title page\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6b8673-a2b5-4b50-ad1b-e90671f57470", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from binarycpython.utils.grid import Population\n", + "from binarycpython.utils.functions import (\n", + " get_help_all,\n", + " get_help,\n", + " create_hdf5,\n", + " output_lines,\n", + ")\n", + "from binarycpython.utils.custom_logging_functions import temp_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79ab50b7-591f-4883-af09-116d1835a751", + "metadata": {}, + "outputs": [], + "source": [ + "#########################################################\n", + "# This file serves as an example for running a population.\n", + "# The use of help(<function>) is a good way to inspect what parameters are there to use\n", + "#########################################################\n", + "\n", + "# Create population object\n", + "example_pop = Population()\n", + "\n", + "# If you want verbosity, set this before other things\n", + "example_pop.set(verbose=1)\n", + "\n", + "# Setting values can be done via .set(<parameter_name>=<value>)\n", + "# Values that are known to be binary_c_parameters are loaded into bse_options.\n", + "# Those that are present in the default grid_options are set in grid_options\n", + "# All other values that you set are put in a custom_options dict\n", + "example_pop.set(\n", + " # binary_c physics options\n", + " M_1=10, # bse_options\n", + " separation=0, # bse_options\n", + " orbital_period=45000000080, # bse_options\n", + " max_evolution_time=15000, # bse_options\n", + " eccentricity=0.02, # bse_options\n", + " # Set companion to low mass\n", + " M_2=0.08, # Since in the example we run a single system, we should set the companion mass here. If we donm't do this, the code will complain.\n", + " # grid_options\n", + " amt_cores=2, # grid_options\n", + " verbose=1, # verbosity. Not fully configured correctly yet but having it value of 1 prints alot of stuff\n", + " # Custom options # TODO: need to be set in grid_options probably\n", + " data_dir=os.path.join(\n", + " temp_dir(), \"example_python_population_result\"\n", + " ), # custom_options\n", + " base_filename=\"example_pop.dat\", # custom_options\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c986215-93b1-4e30-ad79-f7c397e9ff7d", + "metadata": {}, + "outputs": [], + "source": [ + "def parse_function(self, output):\n", + " # EXAMPLE PARSE_FUNCTION\n", + "\n", + " # extract info from the population instance\n", + "\n", + " # Get some information from the\n", + " data_dir = self.custom_options[\"data_dir\"]\n", + " base_filename = self.custom_options[\"base_filename\"]\n", + "\n", + " # Check directory, make if necessary\n", + " os.makedirs(data_dir, exist_ok=True)\n", + "\n", + " seperator = \" \"\n", + "\n", + " # Create filename\n", + " outfilename = os.path.join(data_dir, base_filename)\n", + "\n", + " parameters = [\"time\", \"mass\", \"zams_mass\", \"probability\", \"radius\", \"stellar_type\"]\n", + "\n", + " # Go over the output.\n", + " for el in output_lines(output):\n", + " headerline = el.split()[0]\n", + "\n", + " # CHeck the header and act accordingly\n", + " if headerline == \"MY_STELLAR_DATA\":\n", + " values = el.split()[1:]\n", + " print(values)\n", + "\n", + " if not len(parameters) == len(values):\n", + " print(\"Amount of column names isnt equal to amount of columns\")\n", + " raise ValueError\n", + "\n", + " if not os.path.exists(outfilename):\n", + " with open(outfilename, \"w\") as f:\n", + " f.write(seperator.join(parameters) + \"\\n\")\n", + "\n", + " with open(outfilename, \"a\") as f:\n", + " f.write(seperator.join(values) + \"\\n\")\n", + "\n", + "\n", + "\n", + "# Creating a parsing function\n", + "example_pop.set(\n", + " parse_function=parse_function, # Setting the parse function thats used in the evolve_population\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fa5188e-312f-4a05-aeda-0bd4c00629c8", + "metadata": {}, + "outputs": [], + "source": [ + "### Custom logging\n", + "# Log the moment when the star turns into neutron\n", + "example_pop.set(\n", + " C_logging_code=\"\"\"\n", + "if(stardata->star[0].stellar_type >= 13) \n", + "{\n", + " if (stardata->model.time < stardata->model.max_evolution_time)\n", + " {\n", + " Printf(\"MY_STELLAR_DATA %30.12e %g %g %g %g %d\\\\n\",\n", + " // \n", + " stardata->model.time, // 1\n", + " stardata->star[0].mass, // 2\n", + " stardata->common.zero_age.mass[0], // 4\n", + " stardata->model.probability, // 5\n", + " stardata->star[0].radius, // 6\n", + " stardata->star[0].stellar_type // 7\n", + " );\n", + " };\n", + " /* Kill the simulation to save time */\n", + " stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;\n", + "};\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd197154-a8ce-4865-8929-008d3483101a", + "metadata": {}, + "outputs": [], + "source": [ + "# Add grid variables\n", + "resolution = {\"M_1\": 20, \"q\": 20, \"per\": 40}\n", + "\n", + "# Mass\n", + "example_pop.add_grid_variable(\n", + " name=\"lnm1\",\n", + " longname=\"Primary mass\",\n", + " valuerange=[2, 150],\n", + " resolution=\"{}\".format(resolution[\"M_1\"]),\n", + " spacingfunc=\"const(math.log(2), math.log(150), {})\".format(resolution[\"M_1\"]),\n", + " precode=\"M_1=math.exp(lnm1)\",\n", + " probdist=\"three_part_powerlaw(M_1, 0.1, 0.5, 1.0, 150, -1.3, -2.3, -2.3)*M_1\",\n", + " dphasevol=\"dlnm1\",\n", + " parameter_name=\"M_1\",\n", + " condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + ")\n", + "\n", + "# # Mass ratio\n", + "# test_pop.add_grid_variable(\n", + "# name=\"q\",\n", + "# longname=\"Mass ratio\",\n", + "# valuerange=[\"0.1/M_1\", 1],\n", + "# resolution=\"{}\".format(resolution['q']),\n", + "# spacingfunc=\"const(0.1/M_1, 1, {})\".format(resolution['q']),\n", + "# probdist=\"flatsections(q, [{'min': 0.1/M_1, 'max': 1.0, 'height': 1}])\",\n", + "# dphasevol=\"dq\",\n", + "# precode=\"M_2 = q * M_1\",\n", + "# parameter_name=\"M_2\",\n", + "# condition=\"\", # Impose a condition on this grid variable. Mostly for a check for yourself\n", + "# )\n", + "\n", + "# #\n", + "# test_pop.add_grid_variable(\n", + "# name=\"log10per\", # in days\n", + "# longname=\"log10(Orbital_Period)\",\n", + "# valuerange=[0.15, 5.5],\n", + "# resolution=\"{}\".format(resolution[\"per\"]),\n", + "# spacingfunc=\"const(0.15, 5.5, {})\".format(resolution[\"per\"]),\n", + "# precode=\"\"\"orbital_period = 10** log10per\n", + "# sep = calc_sep_from_period(M_1, M_2, orbital_period)\n", + "# sep_min = calc_sep_from_period(M_1, M_2, 10**0.15)\n", + "# sep_max = calc_sep_from_period(M_1, M_2, 10**5.5)\"\"\",\n", + "# probdist=\"sana12(M_1, M_2, sep, orbital_period, sep_min, sep_max, math.log10(10**0.15), math.log10(10**5.5), -0.55)\",\n", + "# parameter_name=\"orbital_period\",\n", + "# dphasevol=\"dlog10per\",\n", + "# )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8c96b151-8c3b-4479-969f-6c2f898497a5", + "metadata": {}, + "source": [ + "Exporting of all the settings can be done with .export_all_info()\n", + "on default it exports everything, but can be supressed by turning it off:\n", + " population settings (bse_options, grid_options, custom_options), turn off with include_population\n", + " settings=False\n", + " binary_c_defaults (all the commandline arguments that binary c accepts, and their defaults).\n", + " turn off with include_binary_c_defaults=False\n", + " include_binary_c_version_info (all the compilation info, and information about the compiled\n", + " parameters), turn off with include_binary_c_version_info=False\n", + " include_binary_c_help_all (all the help information for all the binary_c parameters),\n", + " turn off with include_binary_c_help_all=Fase\n", + "On default it will write this to the custom_options['data_dir'], but that can be overriden by\n", + " setting use_datadir=False and providing an outfile=<>" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ba83443c-64b4-4126-90b3-b1ca76c0f73d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/tmp/binary_c_python/example_python_population_result/example_pop_settings.json'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_pop.export_all_info()" + ] + }, + { + "cell_type": "markdown", + "id": "ef5b51a1-e56d-4bec-a5c7-b9d5bceeceba", + "metadata": {}, + "source": [ + "Executing a single system\n", + "This uses the M_1 orbital period etc set with the set function" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "c0a9aed7-1fc9-4fe3-8bcf-4e987bfc00a9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating the code for the shared library for the custom logging\n", + "['2.773586668293e+01', '1.33526', '10', '1', '1.72498e-05', '13']\n", + "None\n" + ] + } + ], + "source": [ + "output = example_pop.evolve_single()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ea376c1-1e92-45af-8cab-9d7fdca564eb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "## Executing a population\n", + "## This uses the values generated by the grid_variables\n", + "example_pop.evolve() # TODO: update this function call" + ] + }, + { + "cell_type": "markdown", + "id": "ce937b07-7292-4bb1-b2e7-d69e51bdff6e", + "metadata": { + "tags": [] + }, + "source": [ + "Wrapping up the results to an hdf5 file can be done by using the create_hdf5\n", + "(<directory containing data and settings>) This function takes the settings file\n", + "(ending in _settings.json) and the data files (ending in .dat) from the data_dir\n", + "and packing them into an hdf5 file, which is then written into the same data_dir directory" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ad444138-f854-4fdb-8e18-49e35ac9c7e2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Creating /tmp/binary_c_python/example_python_population_result/example_pop.hdf5\n", + "Adding settings to HDF5 file\n", + "Adding data to HDF5 file\n" + ] + } + ], + "source": [ + "create_hdf5(data_dir=example_pop.custom_options[\"data_dir\"], name=\"example_pop.hdf5\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34da69bc-fe60-4a9d-b07a-f6cd2f216964", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}