Skip to content

Commit

Permalink
bypass jdaviz unit converter
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Apr 19, 2024
1 parent fe6cb7f commit 0369553
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions lcviz/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@

from lightkurve import LightCurve

from glue.config import settings as glue_settings
from glue.core.component_id import ComponentID
from glue.core.link_helpers import LinkSame
from glue.core.units import unit_converter
from jdaviz.core.helpers import ConfigHelper
from lcviz.viewers import TimeScatterView

__all__ = ['LCviz']


@unit_converter('custom-lcviz')
class UnitConverterWithSpectral:

def equivalent_units(self, data, cid, units):
return u.Unit(units).find_equivalent_units()

def to_unit(self, data, cid, values, original_units, target_units):
return (values * u.Unit(original_units)).to_value(u.Unit(target_units))


glue_settings.UNIT_CONVERTER = 'custom-lcviz'

custom_components = {'plugin-ephemeris-select': 'components/plugin_ephemeris_select.vue'}

# Register pure vue component. This allows us to do recursive component instantiation only in the
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"astropy>=5.2",
# NOTE: if/when we stop pinning a minor version of jdaviz, add jdaviz
# to devdeps in tox.ini
"jdaviz>=3.9.1,<3.10.0",
"jdaviz==3.9.*",
"lightkurve>=2.4.1",
]
dynamic = [
Expand Down

0 comments on commit 0369553

Please sign in to comment.