Skip to content

Commit

Permalink
empty-async-return-progress instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 committed Oct 18, 2023
1 parent 17aa0be commit 5eab752
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def __init__(self, name, parameters_list=None):
super().__init__(name, return_progress=True, parameters_list=parameters_list)

Check warning on line 187 in cdci_data_analysis/plugins/dummy_plugin/data_server_dispatcher.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/data_server_dispatcher.py#L185-L187

Added lines #L185 - L187 were not covered by tests

def get_dummy_progress_run(self, instrument, config=None,**kwargs):
return []
p_value = instrument.get_par_by_name('p').value
return [p_value]

Check warning on line 191 in cdci_data_analysis/plugins/dummy_plugin/data_server_dispatcher.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/data_server_dispatcher.py#L190-L191

Added lines #L190 - L191 were not covered by tests

class EmptyProductQuery(ProductQuery):

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import absolute_import, division, print_function

Check warning on line 1 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L1

Added line #L1 was not covered by tests

__author__ = "Gabriele Barni"

Check warning on line 3 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L3

Added line #L3 was not covered by tests

from cdci_data_analysis.analysis.instrument import Instrument
from cdci_data_analysis.analysis.queries import SourceQuery, InstrumentQuery, Float, Name

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Name' is not used.

Check warning on line 6 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L5-L6

Added lines #L5 - L6 were not covered by tests

from .data_server_dispatcher import DataServerQuery, DataServerNumericQuery, ReturnProgressProductQuery

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'DataServerNumericQuery' is not used.

Check warning on line 8 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L8

Added line #L8 was not covered by tests


def my_instr_factory():
src_query = SourceQuery('src_query')

Check warning on line 12 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L11-L12

Added lines #L11 - L12 were not covered by tests

# empty query
instr_query = InstrumentQuery(name='empty_async_return_progress_instrument_query',

Check warning on line 15 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L15

Added line #L15 was not covered by tests
input_prod_list_name='scw_list',
catalog=None,
catalog_name='user_catalog')

p = Float(value=10., name='p', units='W')
return_progress_query = ReturnProgressProductQuery('empty_parameters_dummy_query_return_progress',

Check warning on line 21 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L20-L21

Added lines #L20 - L21 were not covered by tests
parameters_list=[p])

query_dictionary = {'dummy': 'empty_parameters_dummy_query_return_progress'}

Check warning on line 24 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L24

Added line #L24 was not covered by tests

return Instrument('empty-async-return-progress',

Check warning on line 26 in cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py

View check run for this annotation

Codecov / codecov/patch

cdci_data_analysis/plugins/dummy_plugin/empty_async_return_progress_instrument.py#L26

Added line #L26 was not covered by tests
src_query=src_query,
instrumet_query=instr_query,
product_queries_list=[return_progress_query],
query_dictionary=query_dictionary,
data_server_query_class=DataServerQuery)

0 comments on commit 5eab752

Please sign in to comment.