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

Remove dispatcher plot dependencies and upgrade bokeh #279

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a426466
Remove dispatcher plot dependencies
ferrigno Aug 20, 2024
9bd0ebe
Requirements.txt n line with setup.py
ferrigno Aug 20, 2024
ef9864b
Remove dispatcher from conftest.py
ferrigno Aug 20, 2024
d6113e2
yodate address in tutorial
ferrigno Aug 20, 2024
02d204d
update index.rst
ferrigno Aug 20, 2024
74ed463
update test requirements
ferrigno Aug 20, 2024
47fe79e
remove references to CDCI in License, Readme and Vocab
ferrigno Aug 20, 2024
15bfa5f
revert conftest.py modifications
ferrigno Aug 20, 2024
b45b207
accept requests by @burnout87
ferrigno Aug 21, 2024
a103607
set requirement editable
burnout87 Aug 21, 2024
7abe190
Merge branch 'master' into no-dispatcher
burnout87 Aug 21, 2024
d81f799
set requirement docs
burnout87 Aug 21, 2024
0473701
Merge branch 'master' of github.com:oda-hub/oda_api into no-dispatcher
burnout87 Aug 21, 2024
3d9201a
Merge branch 'no-dispatcher' of github.com:oda-hub/oda_api into no-di…
burnout87 Aug 21, 2024
693e88d
use bokeh 3.5.1
burnout87 Aug 21, 2024
ba4ec4f
Add comment to requirements.txt
ferrigno Aug 21, 2024
04d428f
Merge branch 'master' into no-dispatcher
burnout87 Jan 24, 2025
0161ffc
dedicated utils module for plot tools
burnout87 Jan 24, 2025
6d83cea
Merge branch 'no-dispatcher' of github.com:oda-hub/oda_api into no-di…
burnout87 Jan 24, 2025
3d90f3e
bokeh version 3.5.1 also for OdaSpectrum
burnout87 Jan 24, 2025
dd60c21
moving Image class in the plot_tools_utils module
burnout87 Jan 24, 2025
006945b
removed commented code
burnout87 Jan 24, 2025
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
1 change: 0 additions & 1 deletion .github/styles/vocab.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cdci
oda
api
Tramacere
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cdci_data_analysis is distributed under the terms of The MIT License (MIT), reproduced below.
oda_api is distributed under the terms of The MIT License (MIT), reproduced below.

MIT License

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ oda_api
[![Documentation Status](https://readthedocs.org/projects/oda-api/badge/?version=latest)](https://oda-api.readthedocs.io/en/latest/?badge=latest)


![Upload Python Package](https://github.com/cdcihub/oda_api/workflows/Upload%20Python%20Package/badge.svg)
![Upload Python Package](https://github.com/oda-hub/oda_api/workflows/Upload%20Python%20Package/badge.svg)
![Prose Linting](https://github.com/volodymyrss/integral-isgri-rate-meaning/workflows/Prose%20Linting/badge.svg)
![Executing Notebook](https://github.com/volodymyrss/integral-isgri-rate-meaning/workflows/Executing%20Notebook/badge.svg)
[![Python package](https://github.com/oda-hub/oda_api/actions/workflows/python-package.yml/badge.svg)](https://github.com/oda-hub/oda_api/actions/workflows/python-package.yml)
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ pyjwt==2.4.0
astroquery==0.4.4

rdflib
bokeh
puremagic
4 changes: 2 additions & 2 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

ODA API documentation
===================================
API for cdci_data_analysis
API for Multi Messenger Online Data Analysis (MMODA)

:Authors: `Andrea Tramacere <[email protected]>, Carlo Ferrigno <[email protected]>`_
:Authors: `Andrea Tramacere <[email protected]>, Carlo Ferrigno <[email protected]>, Gabriele Barni <[email protected]>`_

Documentation
-------------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/user_guide/tutorial_main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ The following tutorial covers a large fraction of the code features. The example

Progress reporting for long running tasks <ProgressReporter.ipynb>

Examples of workflows <https://github.com/cdcihub/oda_api_benchmark>
Examples of workflows <https://github.com/oda-hub/oda_api_benchmark>



.. image:: https://img.shields.io/badge/run%20quick%20start%20-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09P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7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC
:target: https://mybinder.org/v2/gh/cdcihub/oda_api/master
:target: https://mybinder.org/v2/gh/oda-hub/oda_api/master






.. image:: https://img.shields.io/badge/run%20examples-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKof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2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC
:target: https://mybinder.org/v2/gh/cdcihub/oda_api_benchmark/master
:target: https://mybinder.org/v2/gh/oda-hub/oda_api_benchmark/master
148 changes: 131 additions & 17 deletions oda_api/plot_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@
import time as _time
import astropy.wcs as wcs

from bokeh.layouts import row, gridplot
#column,
from bokeh.models import HoverTool
# (CustomJS,
# Toggle,
# RangeSlider,
# HoverTool,
# ColorBar,
# LinearColorMapper,
# LabelSet,
# ColumnDataSource,
# LogColorMapper)
from bokeh.embed import components
from bokeh.plotting import figure
#from bokeh.palettes import Plasma256

# NOTE GW, optional
try:
import ligo.skymap.plot
Expand Down Expand Up @@ -711,7 +727,7 @@
return True

def get_html_image(self, source_name, systematic_fraction, color='blue'):
import cdci_data_analysis.analysis.plot_tools

x, dx, y, dy, e_min, e_max = self.get_lc(source_name, systematic_fraction)
mask = numpy.logical_not(numpy.isnan(y))

Expand All @@ -724,17 +740,17 @@
else:
xlabel = 'Time [IJD]'

sp = cdci_data_analysis.analysis.plot_tools.ScatterPlot(w=800, h=600,
x_label=xlabel,
y_label='Rate (%.0f - %.0f keV)' % (e_min, e_max),
title=source_name)
sp = ScatterPlot(w=800, h=600,

Check warning on line 743 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L743

Added line #L743 was not covered by tests
x_label=xlabel,
y_label='Rate (%.0f - %.0f keV)' % (e_min, e_max),
title=source_name)

sp.add_errorbar(x, y, yerr=dy, xerr=dx, color=color)
html_dict = sp.get_html_draw()

html_str = html_dict['div'] + '\n'
html_str += '<script src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.min.js"></script>\n' + \
'<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js"></script>\n'
html_str += '<script src="https://cdn.bokeh.org/bokeh/release/bokeh-3.5.1.min.js"></script>\n' + \

Check warning on line 752 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L752

Added line #L752 was not covered by tests
'<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.5.1.min.js"></script>\n'
html_str += html_dict['script']

return html_str
Expand Down Expand Up @@ -794,8 +810,7 @@
plt.show()

def get_html_image(self, in_source_name, systematic_fraction, x_range=None, y_range=None, color='blue'):
import cdci_data_analysis.analysis.plot_tools


x, dx, y, dy = self.get_values(in_source_name, systematic_fraction)

if len(x) == 0:
Expand All @@ -807,14 +822,14 @@
if y_range is None:
y_range = [numpy.max([1e-4, (y-dy)[x < x_range[1]].min()]), (y+dy).max()]

sp = cdci_data_analysis.analysis.plot_tools.ScatterPlot(w=800, h=600,
x_label="Energy [keV]",
y_label='Counts/s/keV',
x_axis_type='log',
y_axis_type='log',
x_range=x_range,
y_range=y_range,
title=in_source_name)
sp = ScatterPlot(w=800, h=600,

Check warning on line 825 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L825

Added line #L825 was not covered by tests
x_label="Energy [keV]",
y_label='Counts/s/keV',
x_axis_type='log',
y_axis_type='log',
x_range=x_range,
y_range=y_range,
title=in_source_name)
if len(x) == 0:
return ''
sp.add_errorbar(x, y, yerr=dy, xerr=dx, color=color)
Expand Down Expand Up @@ -1071,3 +1086,102 @@
# TODO can an implementation of this method provided?
def write_fits(self):
raise NotImplementedError


class ScatterPlot(object):

def __init__(self,w,h,x_label=None,y_label=None,x_range=None,y_range=None,title=None,y_axis_type='linear',x_axis_type='linear'):
hover = HoverTool(tooltips=[("x", "$x"), ("y", "$y")])

Check warning on line 1094 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1094

Added line #L1094 was not covered by tests

self.fig = figure(title=title, width=w, height=h,x_range=x_range,y_range=y_range,

Check warning on line 1096 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1096

Added line #L1096 was not covered by tests
y_axis_type=y_axis_type,
x_axis_type=x_axis_type,
tools=[hover, 'pan,box_zoom,box_select,wheel_zoom,reset,save,crosshair']
)

if x_label is not None:
self.fig.xaxis.axis_label = x_label

Check warning on line 1103 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1102-L1103

Added lines #L1102 - L1103 were not covered by tests

if y_label is not None:
self.fig.yaxis.axis_label = y_label

Check warning on line 1106 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1105-L1106

Added lines #L1105 - L1106 were not covered by tests

def add_errorbar(self, x, y, xerr=None, yerr=None, color='red',
point_kwargs={}, error_kwargs={}):

self.fig.circle(x, y, color=color, **point_kwargs)

Check warning on line 1111 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1111

Added line #L1111 was not covered by tests

if xerr is not None:
x_err_x = []
x_err_y = []
for px, py, err in zip(x, y, xerr):
x_err_x.append((px - err, px + err))
x_err_y.append((py, py))
self.fig.multi_line(x_err_x, x_err_y, color=color, **error_kwargs)

Check warning on line 1119 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1113-L1119

Added lines #L1113 - L1119 were not covered by tests

if yerr is not None:
y_err_x = []
y_err_y = []
for px, py, err in zip(x, y, yerr):
y_err_x.append((px, px))
y_err_y.append((py - err, py + err))
self.fig.multi_line(y_err_x, y_err_y, color=color, **error_kwargs)

Check warning on line 1127 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1121-L1127

Added lines #L1121 - L1127 were not covered by tests



def add_step_line(self, x, y, legend=None):
if legend:
self.fig.step(x, y, legend_label=legend, mode="center")

Check warning on line 1133 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1132-L1133

Added lines #L1132 - L1133 were not covered by tests
else:
self.fig.step(x, y, mode="center")

Check warning on line 1135 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1135

Added line #L1135 was not covered by tests

def add_line(self, x, y, legend=None, color='red'):
if legend:
self.fig.line(x, y, legend_label=legend, line_color=color)

Check warning on line 1139 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1138-L1139

Added lines #L1138 - L1139 were not covered by tests
else:
self.fig.line(x, y, line_color=color)

Check warning on line 1141 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1141

Added line #L1141 was not covered by tests

def get_html_draw(self):



layout = row(

Check warning on line 1147 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1147

Added line #L1147 was not covered by tests
self.fig
)
#curdoc().add_root(layout)


#show(layout)

script, div = components(layout)

Check warning on line 1155 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1155

Added line #L1155 was not covered by tests

#print ('script',script)
#print ('div',div)

html_dict = {}
html_dict['script'] = script
html_dict['div'] = div
return html_dict

Check warning on line 1163 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1160-L1163

Added lines #L1160 - L1163 were not covered by tests


class GridPlot(object):

def __init__(self,f1,f2,w=None,h=None):

self.f1=f1
self.f2=f2

Check warning on line 1171 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1170-L1171

Added lines #L1170 - L1171 were not covered by tests

def get_html_draw(self,w=None,h=None):
#l = layout([self.f1.fig],[self.f2.fig])


grid = gridplot([self.f1.fig,self.f2.fig],ncols=1,plot_width=w, plot_height=h)

Check warning on line 1177 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1177

Added line #L1177 was not covered by tests
#curdoc().add_root(grid)
#show(grid)
#output_file("test.html")
script, div = components(grid)

Check warning on line 1181 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1181

Added line #L1181 was not covered by tests

html_dict={}
html_dict['script']=script
html_dict['div'] = div
return html_dict

Check warning on line 1186 in oda_api/plot_tools.py

View check run for this annotation

Codecov / codecov/patch

oda_api/plot_tools.py#L1183-L1186

Added lines #L1183 - L1186 were not covered by tests

9 changes: 6 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ json_tricks
matplotlib
numpy
jsonschema
pyjwt
astroquery
-e git+https://github.com/oda-hub/dispatcher-app.git#egg=cdci_data_analysis[test]
simplejson
sentry_sdk
scipy
rdflib
black
bokeh
-e git+https://github.com/oda-hub/dispatcher-app.git#egg=cdci_data_analysis[test]
burnout87 marked this conversation as resolved.
Show resolved Hide resolved
# This needs to be editable to allow setting the necessary variables.
puremagic
2 changes: 1 addition & 1 deletion requirements_docker.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-e git://github.com/andreatramacere/oda_api.git#egg=oda_api
-e git://github.com/oda-hub/oda_api.git#egg=oda_api
matplotlib
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def pytest_collection_modifyitems(config, items):
item.add_marker(pytest.mark.skip(reason=f"--run-only-{option} prevents this test from running"))



@pytest.fixture
def dispatcher_api(dispatcher_live_fixture):
import oda_api
Expand Down
Loading