Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed widgets subpackage to visualization and restructured modules within it #1462

Merged
merged 4 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
531 changes: 333 additions & 198 deletions docs/using/visualization/generating_widgets.ipynb

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions docs/using/visualization/sdec_plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:05:43.742242Z",
"start_time": "2021-02-12T14:05:43.739877Z"
"end_time": "2021-02-18T17:35:03.859695Z",
"start_time": "2021-02-18T17:35:03.851958Z"
},
"nbsphinx": "hidden"
},
Expand All @@ -36,8 +36,8 @@
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:06:46.089440Z",
"start_time": "2021-02-12T14:05:43.746092Z"
"end_time": "2021-02-18T17:37:30.434925Z",
"start_time": "2021-02-18T17:35:06.936525Z"
}
},
"outputs": [
Expand Down Expand Up @@ -311,7 +311,7 @@
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.26319e+43 erg / s Luminosity absorbed = 4.10706e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 54.49 s (\u001b[1mbase.py\u001b[0m:384)\n"
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 85.37 s (\u001b[1mbase.py\u001b[0m:384)\n"
]
}
],
Expand Down Expand Up @@ -344,13 +344,13 @@
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:06:49.123425Z",
"start_time": "2021-02-12T14:06:46.090887Z"
"end_time": "2021-02-18T17:37:42.468383Z",
"start_time": "2021-02-18T17:37:30.702418Z"
}
},
"outputs": [],
"source": [
"from tardis.widgets import SDECPlotter"
"from tardis.visualization import SDECPlotter"
]
},
{
Expand All @@ -365,8 +365,8 @@
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:06:49.704614Z",
"start_time": "2021-02-12T14:06:49.125705Z"
"end_time": "2021-02-18T17:37:44.686809Z",
"start_time": "2021-02-18T17:37:42.534053Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -395,8 +395,8 @@
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:06:52.444227Z",
"start_time": "2021-02-12T14:06:49.706660Z"
"end_time": "2021-02-18T17:37:48.944341Z",
"start_time": "2021-02-18T17:37:44.697819Z"
}
},
"outputs": [
Expand Down Expand Up @@ -430,8 +430,8 @@
"execution_count": 6,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-12T14:06:53.409156Z",
"start_time": "2021-02-12T14:06:52.446100Z"
"end_time": "2021-02-18T17:37:59.778634Z",
"start_time": "2021-02-18T17:37:56.684368Z"
},
"scrolled": false
},
Expand Down Expand Up @@ -1002079,7 +1002079,6 @@
}
],
"metadata": {
"celltoolbar": "Edit Metadata",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
8 changes: 8 additions & 0 deletions tardis/visualization/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Visualization tools and widgets for TARDIS."""

from tardis.visualization.widgets.shell_info import (
shell_info_from_simulation,
shell_info_from_hdf,
)
from tardis.visualization.widgets.line_info import LineInfoWidget
from tardis.visualization.tools.sdec_plot import SDECPlotter
File renamed without changes.
6 changes: 6 additions & 0 deletions tardis/visualization/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Classes & functions to generate diagnostic visualizations.

These interfaces (or tools) post-process TARDIS simulations allowing user to
produce a specific visualization through a function (or class method) call.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import plotly.graph_objects as go

from tardis.util.base import atomic_number2element_symbol
from tardis.widgets import plot_util as pu
from tardis.visualization import plot_util as pu


class SDECData:
Expand Down
6 changes: 6 additions & 0 deletions tardis/visualization/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Jupyter widgets to interactively explore TARDIS simulations.

These are simple Graphical User Interfaces (GUIs) that run within Jupyter
Notebooks, making data exploration much easier.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

from tardis.analysis import LastLineInteraction
from tardis.util.base import species_tuple_to_string, species_string_to_tuple
from tardis.widgets.util import create_table_widget, TableSummaryLabel
from tardis.widgets import plot_util as pu
from tardis.visualization.widgets.util import (
create_table_widget,
TableSummaryLabel,
)
from tardis.visualization import plot_util as pu


class LineInfoWidget:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
species_tuple_to_string,
)
from tardis.simulation import Simulation
from tardis.widgets.util import create_table_widget
from tardis.visualization.widgets.util import create_table_widget

import pandas as pd
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas as pd
import numpy as np
from plotly.callbacks import Points, BoxSelector
from tardis.widgets.line_info import LineInfoWidget
from tardis.visualization.widgets.line_info import LineInfoWidget
from tardis.util.base import species_string_to_tuple


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import pandas.testing as pdt

from tardis.widgets.shell_info import (
from tardis.visualization.widgets.shell_info import (
BaseShellInfo,
SimulationShellInfo,
HDFShellInfo,
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions tardis/widgets/__init__.py

This file was deleted.