from pint import quantity
import numpy as np
import pint
ureg = pint.UnitRegistry()
#shape of the galaxy
diameter = 1e5 * ureg.lightyear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install decorator | |
| # pip install python-forge | |
| from decorator import decorator, decorate | |
| import forge | |
| import inspect | |
| def decorator_wrapper(f, *args, **kwargs): | |
| """Wrapper needed by decorator.decorate to pass through args, kwargs""" | |
| return f(*args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| from dash.dependencies import Input, Output, State | |
| from dash.exceptions import PreventUpdate | |
| import dash_daq as daq | |
| # from plotly.offline import iplot | |
| import dash_extendable_graph as deg | |
| import plotly.graph_objs as go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def merge_tuples(a,b, name = 'Name'): | |
| """Returns a join of two named tuples | |
| Duplicate names will raise an error. | |
| """ | |
| return namedtuple(name, a._fields + b._fields)(*(a+b)) |