Skip to content
Snippets Groups Projects

Introduced data value object

Merged Adham Hashibon requested to merge data-value into master

Created by: stefanoborini

Replaced previous system of Result and Parameter objects for MCO, DataSource and KPICalculator with a set of DataValue objects that contain all the relevant information for a specific entity created by the MCO/DS/KPI

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
34 parameters = mco_communicator.receive_from_mco(mco_model)
34 mco_data_values = mco_communicator.receive_from_mco(mco_model)
35 35
36 36 ds_results = []
37 37 for ds_model in workflow.data_sources:
38 38 ds_bundle = ds_model.bundle
39 39 data_source = ds_bundle.create_data_source()
40 ds_results.append(data_source.run(ds_model, parameters))
40 ds_results.extend(data_source.run(ds_model, mco_data_values))
41 41
42 42 kpi_results = []
43 43 for kpic_model in workflow.kpi_calculators:
44 44 kpic_bundle = kpic_model.bundle
45 45 kpi_calculator = kpic_bundle.create_kpi_calculator()
46 kpi_results.append(kpi_calculator.run(kpic_model, ds_results))
46 kpi_results.extend(kpi_calculator.run(kpic_model, ds_results))
  • Created by: martinRenou

    You are not passing the DataValues coming from the MCO. Will this come later with the slots ?

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 1 from traits.api import HasStrictTraits, Any, String, Enum
    2
    3
    4 class DataValue(HasStrictTraits):
    • Created by: martinRenou

      Should we specify where does the DataValue come from ? Like a from trait:

      from = Enum('MCO', 'DATASOURCE', 'KPI')

      Or will this be part of the slots ?

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 1 from traits.api import HasStrictTraits, Any, String, Enum
    2
    3
    4 class DataValue(HasStrictTraits):
    • Created by: stefanoborini

      I thought about it, we used to have originator, but I start to believe it's not useful. we can reintroduce it at a later stage with no fuss, because the setting will be done by the core anyway, so plugin authors don't have to do that manually, and nothing will change for them.

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 34 parameters = mco_communicator.receive_from_mco(mco_model)
    34 mco_data_values = mco_communicator.receive_from_mco(mco_model)
    35 35
    36 36 ds_results = []
    37 37 for ds_model in workflow.data_sources:
    38 38 ds_bundle = ds_model.bundle
    39 39 data_source = ds_bundle.create_data_source()
    40 ds_results.append(data_source.run(ds_model, parameters))
    40 ds_results.extend(data_source.run(ds_model, mco_data_values))
    41 41
    42 42 kpi_results = []
    43 43 for kpic_model in workflow.kpi_calculators:
    44 44 kpic_bundle = kpic_model.bundle
    45 45 kpi_calculator = kpic_bundle.create_kpi_calculator()
    46 kpi_results.append(kpi_calculator.run(kpic_model, ds_results))
    46 kpi_results.extend(kpi_calculator.run(kpic_model, ds_results))
    • Created by: stefanoborini

      That's right. at the moment they are not passed. They will be passed later, we I actually resolve the names, and pass only what is resolved.

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 1 from traits.api import HasStrictTraits, Any, String, Enum
    2
    3
    4 class DataValue(HasStrictTraits):
    • Created by: martinRenou

      I think it can be useful for the GUI, when displaying the results in the table we want to be able to distinguish KPIs from other parameters. But I agree that it's better if the author of the plugin don't have to deal with this.

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 1 from traits.api import HasStrictTraits, Any, String, Enum
    2
    3
    4 class DataValue(HasStrictTraits):
    • Created by: stefanoborini

      In the gui you will not have access to it anyway. The cli will send you a message with the relevant information. You will never have to deal with DataValue objects.

  • Adham Hashibon
    Adham Hashibon @has started a thread on commit 72da5a07
  • 1 from traits.api import HasStrictTraits, Any, String, Enum
    2
    3
    4 class DataValue(HasStrictTraits):
  • Created by: stefanoborini

    @martinRenou good to merge?

  • Created by: martinRenou

    @stefanoborini It's fine for me

  • Please register or sign in to reply
    Loading