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

Sea 178 test actions loading #110

Merged
merged 46 commits into from Apr 26, 2024
Merged

Sea 178 test actions loading #110

merged 46 commits into from Apr 26, 2024

Conversation

jhazentia
Copy link
Member

@jhazentia jhazentia commented Feb 20, 2024

  • Updated precommit versions and autoformatted
  • added ability to set calibration adjust for data product action (useful for testing with mock)
  • sensor cal only added to metadata and measurement result if calibration adjust is true
  • added plugin_name property to sigan_iface; this is used to put the plugin name in the status page and in the metadata
  • remove "calibration_datetime" in global section of metadata, replaced by calibration object in capture
  • fix calculation of duration in metadata in the m4s action - this appeared to not be converted to milliseconds as expected (always showed 0 in metadata)
  • changed the logic in the base action configure_preselector method to first check if preselector is configurable
  • test data product action updated to be consistent with cbrs measure baseline action
  • actions and test actions (except logger) only loaded if SIGAN_MODULE and SIGAN_CLASS are set to the mock sigan in scos-actions
  • added sigan to mock GPS constructor just like the scos-usrp USRPLocation class
  • Due to sigan and GPS objects being initialized in scos-sensor instead of scos-usrp, sensor object now passed to GPS methods in order for scos-usrp to access USRP API for GPS. Previously sigan was passed to GPS Interface implementation through constructor.
  • Updated to be compatible with the latest scos-actions:
    • Acquire IQ called though sensor object rather than sigan with sensor object now handling calibration adjustments
    • Sensor overload code moved from scos-usrp to sensor in scos-actions
    • remove clock_rate_lookup_by_sample_rate related code, instead scos-usrp will always maximize clock_rate based on sample rate
  • Check if temperature exists in cal data before adding to cal metadata

@jhazentia jhazentia marked this pull request as ready for review March 11, 2024 20:07
@dboulware dboulware self-requested a review March 13, 2024 21:45
@@ -1,26 +1,22 @@
nasctn_sea_data_product:
name: test_nasctn_sea_data_product
name: test_SEA_CBRS_Measure_Baseline
rf_path: antenna
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this same rf_path: antenna param should be added to all of the test actions to allow them to work with a configurable preselector or without a preselector. Currently, they will all fail on a sensor if it has a configurable preselector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8d205e5

@@ -246,6 +246,26 @@ def recompute_calibration_data(self, params: dict) -> None:
if not recomputed:
logger.warning("Failed to recompute calibration data")

def check_sensor_overload(self, data) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like data is expected to be an ndarray? I suggest adding a type hint. Also, is there any danger that data could not be cast to np.complex64? I'm not sure.

10 * np.log10(1 / (2 * 50)) + 30
) # Convert log(V^2) to dBm
# explicitly check is not None since 1db compression could be 0
if self.sensor_calibration_data["compression_point"] is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest moving this above so you don't compute the avg power if you don't know the compression point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is only called if there is compression_point so maybe the previous comment can be disregarded unless there is a chance check_sensor_overload could be called in a different flow.

@@ -26,6 +26,10 @@
logger.debug(f"scos-actions: RUNNING_TESTS:{RUNNING_TESTS}")
FQDN = env("FQDN", None)
logger.debug(f"scos-actions: FQDN:{FQDN}")
SIGAN_MODULE = env.str("SIGAN_MODULE", default="scos_actions.hardware.mocks.mock_sigan")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would only set the defaults for these when running tests.

),
"logger": Logger(),
}
actions = {"logger": Logger()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove logger from the actions? Not a big deal either way.

Copy link
Contributor

@dboulware dboulware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. See comments for a couple minor suggestions.

@dboulware dboulware merged commit ed7679f into master Apr 26, 2024
4 checks passed
@jhazentia jhazentia deleted the SEA-178_test_actions_loading branch April 26, 2024 15:13
@dboulware dboulware restored the SEA-178_test_actions_loading branch April 26, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants