diff --git a/.gitignore b/.gitignore index 2413634..f85386d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ site/ docs/api/* docs/config_tables.rst docs/generated +docs/sg_execution_times.rst # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/examples/configure_simulation.py b/examples/configure_simulation.py index b88b3f5..3d298d1 100644 --- a/examples/configure_simulation.py +++ b/examples/configure_simulation.py @@ -27,7 +27,7 @@ # Mm loop lasting 5000 s heated by a single 200 s nanoflare # solved on an adaptive grid. # A complete list of configuration parameters can be found in -# the `configuration-tables`_ page. +# the :ref:`configuration-tables` page. config_dict = { 'general': { 'loop_length': 80*u.Mm, diff --git a/examples/parse_simulation.py b/examples/parse_simulation.py index 45ae81a..dcf72ef 100644 --- a/examples/parse_simulation.py +++ b/examples/parse_simulation.py @@ -125,7 +125,7 @@ # single time step as a function of field-aligned coordinate. # The `~pydrad.parse.Profile` object provides a simple quicklook # method for this, -s[0].peek() +p.peek() ################################################################# # Similarly, we can call this method on a `~pydrad.parse.Strand` to diff --git a/pydrad/parse/util.py b/pydrad/parse/util.py index c86ae30..978d1aa 100644 --- a/pydrad/parse/util.py +++ b/pydrad/parse/util.py @@ -34,8 +34,6 @@ def read_amr_file(filename): 'electron_energy_density', 'ion_energy_density', ] - # FIXME: Get actual names for these additional columns - columns += [f'col{i}' for i in range(6,19)] units = { 'grid_centers': 'cm', 'grid_widths': 'cm', @@ -44,13 +42,21 @@ def read_amr_file(filename): 'electron_energy_density': 'erg cm-3', 'ion_energy_density': 'erg cm-3', } - return astropy.table.QTable.read( + table = astropy.table.QTable.read( filename, format='ascii', data_start=4, - names=columns, - units=units, ) + # NOTE: This is done after creating the table because the + # remaining number of columns can be variable and thus we + # cannot assign all of the column names at once. + table.rename_columns( + table.colnames[:len(columns)], + columns, + ) + for column in columns: + table[column].unit = units[column] + return table def read_phy_file(filename):