diff --git a/docs/using/components/models/examples/abund.dat b/docs/using/components/models/abundancecust/abund.dat similarity index 100% rename from docs/using/components/models/examples/abund.dat rename to docs/using/components/models/abundancecust/abund.dat diff --git a/docs/using/components/models/examples/abundancecust.rst b/docs/using/components/models/abundancecust/abundancecust.rst similarity index 98% rename from docs/using/components/models/examples/abundancecust.rst rename to docs/using/components/models/abundancecust/abundancecust.rst index f756e9b2241..698ced856e4 100644 --- a/docs/using/components/models/examples/abundancecust.rst +++ b/docs/using/components/models/abundancecust/abundancecust.rst @@ -9,7 +9,7 @@ ASCII Format To use a stratified ejecta composition in TARDIS, the elemental abundances may be specified on a per-cell basis via an external ASCII file (similar to setting -up a :doc:`custom density ` profile). An ASCII file that could +up a :ref:`custom density ` profile). An ASCII file that could work on a mesh with ten cells should be formatted like this: .. literalinclude:: abund.dat diff --git a/docs/using/components/models/examples/tardis_configv1_abundance_cust_example.yml b/docs/using/components/models/abundancecust/tardis_configv1_abundance_cust_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_abundance_cust_example.yml rename to docs/using/components/models/abundancecust/tardis_configv1_abundance_cust_example.yml diff --git a/docs/using/components/models/examples/tardis_configv1_isotope_abundance_cust_example.yml b/docs/using/components/models/abundancecust/tardis_configv1_isotope_abundance_cust_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_isotope_abundance_cust_example.yml rename to docs/using/components/models/abundancecust/tardis_configv1_isotope_abundance_cust_example.yml diff --git a/docs/using/components/models/examples/tardis_model_abund.csv b/docs/using/components/models/abundancecust/tardis_model_abund.csv similarity index 100% rename from docs/using/components/models/examples/tardis_model_abund.csv rename to docs/using/components/models/abundancecust/tardis_model_abund.csv diff --git a/docs/using/components/models/examples/abundanceuni.rst b/docs/using/components/models/abundanceuni/abundanceuni.rst similarity index 100% rename from docs/using/components/models/examples/abundanceuni.rst rename to docs/using/components/models/abundanceuni/abundanceuni.rst diff --git a/docs/using/components/models/examples/tardis_configv1_abundance_uniform_example.yml b/docs/using/components/models/abundanceuni/tardis_configv1_abundance_uniform_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_abundance_uniform_example.yml rename to docs/using/components/models/abundanceuni/tardis_configv1_abundance_uniform_example.yml diff --git a/docs/using/components/models/examples/csvy_full_rad.csvy b/docs/using/components/models/csvy_full_rad.csvy similarity index 100% rename from docs/using/components/models/examples/csvy_full_rad.csvy rename to docs/using/components/models/csvy_full_rad.csvy diff --git a/docs/using/components/models/csy/csvy_test.ipynb b/docs/using/components/models/csy/csvy_test.ipynb deleted file mode 100644 index dacf2fa16a7..00000000000 --- a/docs/using/components/models/csy/csvy_test.ipynb +++ /dev/null @@ -1,443 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "from tardis.io.parsers import csvy\n", - "import pytest\n", - "import os\n", - "from astropy import units as u\n", - "import numpy.testing as npt" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name '__file__' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtest_data_directory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdirname\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m__file__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdata_path\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mdata_dir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdirname\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m__file__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'data'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mNameError\u001b[0m: name '__file__' is not defined" - ] - } - ], - "source": [ - "test_data_directory = os.path.dirname(__file__)\n", - "\n", - "def data_path(filename):\n", - " data_dir = os.path.dirname(__file__)\n", - " return os.path.join(data_dir, 'data', filename)\n", - "\n", - "def test_csvy_finds_csv_first_line():\n", - " yaml_dict, csv = csvy.load_csvy(data_path('csvy_full.csvy'))\n", - " assert csv['velocity'][0] == 10000" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "ename": "Failed", - "evalue": "Fixture \"csvy_full_fname\" called directly. Fixtures are not meant to be called directly,\nbut are created automatically when test functions request them as parameters.\nSee https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and\nhttps://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code.", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mFailed\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtests\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtest_csvy_reader\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mcsvy_nocsv_fname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mtest_csvy_finds_csv_first_line\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcsvy_full_fname\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mtest_csv_colnames_equiv_datatype_fields\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcsvy_full_fname\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mtest_csvy_nocsv_data_is_none\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcsvy_nocsv_fname\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda2/envs/tardis3/lib/python3.6/site-packages/_pytest/fixtures.py\u001b[0m in \u001b[0;36mresult\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 947\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0msix\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwraps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunction\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 948\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 949\u001b[0;31m \u001b[0mfail\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpytrace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 950\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 951\u001b[0m \u001b[0;31m# keep reference to the original function in our own custom attribute so we don't unwrap\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda2/envs/tardis3/lib/python3.6/site-packages/_pytest/outcomes.py\u001b[0m in \u001b[0;36mfail\u001b[0;34m(msg, pytrace)\u001b[0m\n\u001b[1;32m 111\u001b[0m \"\"\"\n\u001b[1;32m 112\u001b[0m \u001b[0m__tracebackhide__\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mFailed\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpytrace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpytrace\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mFailed\u001b[0m: Fixture \"csvy_full_fname\" called directly. Fixtures are not meant to be called directly,\nbut are created automatically when test functions request them as parameters.\nSee https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and\nhttps://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code." - ] - } - ], - "source": [ - "from tardis.io.tests.test_csvy_reader import test_csvy_finds_csv_first_line\n", - "from tardis.io.tests.test_csvy_reader import test_csv_colnames_equiv_datatype_fields\n", - "from tardis.io.tests.test_csvy_reader import test_csvy_nocsv_data_is_none\n", - "from tardis.io.tests.test_csvy_reader import csvy_full_fname\n", - "from tardis.io.tests.test_csvy_reader import csvy_nocsv_fname\n", - "\n", - "test_csvy_finds_csv_first_line(csvy_full_fname())\n", - "test_csv_colnames_equiv_datatype_fields(csvy_full_fname())\n", - "test_csvy_nocsv_data_is_none(csvy_nocsv_fname())" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 34, - "metadata": {}, - "outputs": [], - "source": [ - "y,d= csvy.load_csvy('data/csvy_desc.csvy')" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "OrderedDict([('tardis_model_config_version', 'v1.0'),\n", - " ('datatype',\n", - " OrderedDict([('fields',\n", - " [OrderedDict([('name', 'velocity'),\n", - " ('unit', 'km/s')]),\n", - " OrderedDict([('name', 'density'),\n", - " ('unit', 'g/cm^3'),\n", - " ('desc', 'density of shell.')]),\n", - " OrderedDict([('name', 'H'),\n", - " ('desc', 'fractional H abundance')]),\n", - " OrderedDict([('name', 'He'),\n", - " ('desc',\n", - " 'fractional He abundance')])])])),\n", - " ('v_inner_boundary', ),\n", - " ('v_outer_boundary', )])" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "y" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'velocity'" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "y['datatype']['fields'][0]['name']" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [], - "source": [ - "names = [od['name'] for od in y['datatype']['fields']]" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n", - "True\n", - "True\n", - "True\n" - ] - } - ], - "source": [ - "names = [od['name'] for od in y['datatype']['fields']]\n", - "for key in d.columns:\n", - " print(key in names)" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "10000" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "d['velocity'][0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "OrderedDict([('name', 'csvy_nocsv'),\n", - " ('description', 'Example csvy config file for TARDIS.'),\n", - " ('tardis_model_config_version', 'v1.0'),\n", - " ('atom_data', 'path/to/atom_data'),\n", - " ('velocity',\n", - " OrderedDict([('start', ),\n", - " ('stop', ),\n", - " ('num', 10)])),\n", - " ('density', OrderedDict([('type', 'branch85_w7')])),\n", - " ('abundance', OrderedDict([('type', 'uniform')])),\n", - " ('v_inner_boundary', ),\n", - " ('v_outer_boundary', )])" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "y_only = csvy.load_yaml_from_csvy('../tests/data/csvy_nocsv.csvy')\n", - "y_only" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "d_only = csvy.load_csv_from_csvy('../tests/data/csvy_full.csvy')" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
velocitydensityHHe
0100005.000000e-090.30.7
1110002.000000e-090.60.4
\n", - "
" - ], - "text/plain": [ - " velocity density H He\n", - "0 10000 5.000000e-09 0.3 0.7\n", - "1 11000 2.000000e-09 0.6 0.4" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "d_only" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [], - "source": [ - "y,d= csvy.load_csvy('../tests/data/csvy_nocsv.csvy')" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OrderedDict([('name', 'csvy_nocsv'), ('description', 'Example csvy config file for TARDIS.'), ('tardis_model_config_version', 'v1.0'), ('atom_data', 'path/to/atom_data'), ('velocity', OrderedDict([('start', ), ('stop', ), ('num', 10)])), ('density', OrderedDict([('type', 'branch85_w7')])), ('abundance', 'uniform'), ('v_inner_boundary', ), ('v_outer_boundary', )])\n", - "None\n" - ] - } - ], - "source": [ - "print(y)\n", - "print(d)" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [], - "source": [ - "from tardis.io.config_validator import validate_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 36, - "metadata": {}, - "outputs": [], - "source": [ - "vy = validate_dict(y, schemapath='/home/mew488/src/dev/tardis/tardis/io/schemas/csvy_model.yml')" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "OrderedDict([('tardis_model_config_version', 'v1.0'),\n", - " ('datatype',\n", - " OrderedDict([('fields',\n", - " [OrderedDict([('name', 'velocity'),\n", - " ('unit', 'km/s')]),\n", - " OrderedDict([('name', 'density'),\n", - " ('unit', 'g/cm^3'),\n", - " ('desc', 'density of shell.')]),\n", - " OrderedDict([('name', 'H'),\n", - " ('desc', 'fractional H abundance')]),\n", - " OrderedDict([('name', 'He'),\n", - " ('desc',\n", - " 'fractional He abundance')])])])),\n", - " ('v_inner_boundary', ),\n", - " ('v_outer_boundary', )])" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "vy" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": {}, - "outputs": [], - "source": [ - "vy = validate_dict(y, schemapath='/home/mew488/src/dev/tardis/tardis/io/schemas/csvy_model_v2.yml')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "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.7" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/using/components/models/examples/Custom_Density_And_Boundary_Velocities.ipynb b/docs/using/components/models/densitycust/Custom_Density_And_Boundary_Velocities.ipynb similarity index 100% rename from docs/using/components/models/examples/Custom_Density_And_Boundary_Velocities.ipynb rename to docs/using/components/models/densitycust/Custom_Density_And_Boundary_Velocities.ipynb diff --git a/docs/using/components/models/examples/density.dat b/docs/using/components/models/densitycust/density.dat similarity index 100% rename from docs/using/components/models/examples/density.dat rename to docs/using/components/models/densitycust/density.dat diff --git a/docs/using/components/models/examples/densitycust.rst b/docs/using/components/models/densitycust/densitycust.rst similarity index 100% rename from docs/using/components/models/examples/densitycust.rst rename to docs/using/components/models/densitycust/densitycust.rst diff --git a/docs/using/components/models/examples/tardis_configv1_density_cust_example.yml b/docs/using/components/models/densitycust/tardis_configv1_density_cust_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_density_cust_example.yml rename to docs/using/components/models/densitycust/tardis_configv1_density_cust_example.yml diff --git a/docs/using/components/models/examples/test_abund.dat b/docs/using/components/models/densitycust/test_abund.dat similarity index 100% rename from docs/using/components/models/examples/test_abund.dat rename to docs/using/components/models/densitycust/test_abund.dat diff --git a/docs/yml_files/densitycust/test_config.yml b/docs/using/components/models/densitycust/test_config.yml similarity index 100% rename from docs/yml_files/densitycust/test_config.yml rename to docs/using/components/models/densitycust/test_config.yml diff --git a/docs/yml_files/densitycust/test_config_ex1.yml b/docs/using/components/models/densitycust/test_config_ex1.yml similarity index 100% rename from docs/yml_files/densitycust/test_config_ex1.yml rename to docs/using/components/models/densitycust/test_config_ex1.yml diff --git a/docs/yml_files/densitycust/test_config_ex2.yml b/docs/using/components/models/densitycust/test_config_ex2.yml similarity index 100% rename from docs/yml_files/densitycust/test_config_ex2.yml rename to docs/using/components/models/densitycust/test_config_ex2.yml diff --git a/docs/yml_files/densitycust/test_config_ex3.yml b/docs/using/components/models/densitycust/test_config_ex3.yml similarity index 100% rename from docs/yml_files/densitycust/test_config_ex3.yml rename to docs/using/components/models/densitycust/test_config_ex3.yml diff --git a/docs/using/components/models/examples/test_density.txt b/docs/using/components/models/densitycust/test_density.txt similarity index 100% rename from docs/using/components/models/examples/test_density.txt rename to docs/using/components/models/densitycust/test_density.txt diff --git a/docs/using/components/models/examples/densityexp.rst b/docs/using/components/models/densityexp/densityexp.rst similarity index 100% rename from docs/using/components/models/examples/densityexp.rst rename to docs/using/components/models/densityexp/densityexp.rst diff --git a/docs/using/components/models/examples/tardis_configv1_density_exponential_example.yml b/docs/using/components/models/densityexp/tardis_configv1_density_exponential_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_density_exponential_example.yml rename to docs/using/components/models/densityexp/tardis_configv1_density_exponential_example.yml diff --git a/docs/using/components/models/examples/densitypow.rst b/docs/using/components/models/densitypow/densitypow.rst similarity index 100% rename from docs/using/components/models/examples/densitypow.rst rename to docs/using/components/models/densitypow/densitypow.rst diff --git a/docs/using/components/models/examples/tardis_configv1_density_power_law_example.yml b/docs/using/components/models/densitypow/tardis_configv1_density_power_law_example.yml similarity index 100% rename from docs/using/components/models/examples/tardis_configv1_density_power_law_example.yml rename to docs/using/components/models/densitypow/tardis_configv1_density_power_law_example.yml diff --git a/docs/using/components/models/examples/examples.rst b/docs/using/components/models/examples/examples.rst deleted file mode 100644 index 3fc4295579d..00000000000 --- a/docs/using/components/models/examples/examples.rst +++ /dev/null @@ -1,28 +0,0 @@ -************** -Example Models -************** - -The following provides some example setups for a number of typical TARDIS use -cases. You can use these examples as blueprints for your own TARDIS -applications. - -Simple Parametrized Models -========================== - -These setups specify the ejecta solely via the YAML configuration file: - -* :doc:`tardis_example ` - - -API demonstrations -================== - -An example on how to use the formal integrator with tardis: - -:ref:`integrator` - - -Detailed Explosion Models -========================= - -Coming soon diff --git a/docs/using/components/models/examples/index.rst b/docs/using/components/models/examples/index.rst deleted file mode 100644 index 9feb2709537..00000000000 --- a/docs/using/components/models/examples/index.rst +++ /dev/null @@ -1,43 +0,0 @@ -************** -Example Models -************** - -The following provides some example setups for a number of typical TARDIS use -cases. You can use these examples as blueprints for your own TARDIS -applications. - - - -.. toctree:: - :maxdepth: 2 - - modelconfig - tardis_example - - -Simple Parametrized Models -========================== - -These setups specify the ejecta solely via the YAML configuration file: - -.. toctree:: - :maxdepth: 2 - - tardis_example - - -API demonstrations -========================= - -An example on how to use the formal integrator with tardis: - -.. toctree:: - :maxdepth: 2 - - integrator.ipynb - - -Detailed Explosion Models -========================= - -Coming soon diff --git a/docs/using/components/models/examples/modelconfig.rst b/docs/using/components/models/examples/modelconfig.rst deleted file mode 100644 index c9ee0d99506..00000000000 --- a/docs/using/components/models/examples/modelconfig.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. _modelconfig: - -************************** -Ejecta Model Configuration -************************** - -Overview -======== - -TARDIS requires information about the ejecta structure. In particular, the -ejecta density and its composition have to be specified on a velocity grid. - -.. note:: - - Since homology is implicitly assumed, the velocity grid immediately translates into a radial mesh - -The density and composition may be specified independently in the following ways: - -Specifying the density -====================== - -.. toctree:: - densitypow - densityexp - densitycust - - -Specifying the composition -========================== - -.. toctree:: - abundanceuni - abundancecust diff --git a/docs/using/components/models/examples/run_simple_example.ipynb b/docs/using/components/models/examples/run_simple_example.ipynb index 7cadb3d9a57..212e922e371 100644 --- a/docs/using/components/models/examples/run_simple_example.ipynb +++ b/docs/using/components/models/examples/run_simple_example.ipynb @@ -1214,7 +1214,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.8" } }, "nbformat": 4, diff --git a/docs/using/components/models/examples/tardis_example.rst b/docs/using/components/models/examples/tardis_example.rst index fd493c546ef..5ab53d5435e 100644 --- a/docs/using/components/models/examples/tardis_example.rst +++ b/docs/using/components/models/examples/tardis_example.rst @@ -30,3 +30,11 @@ The following YAML file summarizes the tardis_example setup: treatments and the reduced abundance set, this TARDIS setup serves for illustrative purposes and not for detailed SNe Ia spectral synthesis calculations. + +See the following link for an example of running TARDIS with this setup in a Jupyter notebook: + +.. toctree:: + :maxdepth: 1 + + run_simple_example + diff --git a/docs/using/components/models/index.rst b/docs/using/components/models/index.rst index b82c47067d2..227f813df64 100644 --- a/docs/using/components/models/index.rst +++ b/docs/using/components/models/index.rst @@ -1,6 +1,6 @@ -***** -Model -***** +****** +Models +****** TARDIS requires a model of the homologously expanding ejecta in order to run a simulation. A model will include information like the velocity shell structure, abundances, density, etc. @@ -11,6 +11,37 @@ the CSVY file format and :ref:`here ` for a link to the csvy_model .. note:: We highly recommend using the cleaner CSVY format. + +The following provides some example setups for a number of typical TARDIS use +cases. You can use these examples as blueprints for your own TARDIS +applications. + + +Simple Parametrized Models +========================== + +These setups specify the ejecta solely via the YAML configuration file: + +.. toctree:: + :maxdepth: 2 + + examples/tardis_example + + +API demonstrations +================== + +An example on how to use the formal integrator with tardis: + +* :ref:`integrator` + + +Detailed Explosion Models +========================= + +Coming soon + + CSVY Model ========== @@ -33,7 +64,7 @@ Example CSVY Model Below we provide an example model.csvy file. -.. literalinclude:: examples/csvy_full_rad.csvy +.. literalinclude:: csvy_full_rad.csvy Using the Config Model ====================== @@ -46,10 +77,9 @@ see the following links: .. toctree:: :maxdepth: 1 - examples/modelconfig - examples/densityexp - examples/densitypow - examples/densitycust - examples/abundanceuni - examples/abundancecust + densityexp/densityexp + densitypow/densitypow + densitycust/densitycust + abundanceuni/abundanceuni + abundancecust/abundancecust