From 0369553dd871a3a5e8ffea389535af1a743c1a00 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 19 Apr 2024 16:05:39 -0400 Subject: [PATCH] bypass jdaviz unit converter --- lcviz/helper.py | 15 +++++++++++++++ pyproject.toml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lcviz/helper.py b/lcviz/helper.py index 79f9c25..ce42355 100644 --- a/lcviz/helper.py +++ b/lcviz/helper.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index d2247f8..a974fdc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [