Skip to content

Generate simulation data for SPECTRUM/IMAGE attributes - #159

Open
kmadisa wants to merge 2 commits into
masterfrom
user/kmadisa/use-gaussian-slew-limited-for-spectrum-image-attributes
Open

Generate simulation data for SPECTRUM/IMAGE attributes#159
kmadisa wants to merge 2 commits into
masterfrom
user/kmadisa/use-gaussian-slew-limited-for-spectrum-image-attributes

Conversation

@kmadisa

@kmadisa kmadisa commented Sep 14, 2022

Copy link
Copy Markdown
Contributor

The GaussianSlewLimited quantity class only generated simulation values that are python primitive types (float in this case) which are appropriate for attributes with a SCALAR data format.

This is a problem for the attrbiutes with more complex data formats, SPECTRUM/IMAGE. When reading an attribute, the quantity returns a primitive type which PyTango is not expecting, therefore resulting in the error, Wrong Python type for attribute... Expected a sequence. This change here allows us to cater for the complex data formats. The method next_val now generates the simulation data according to the data format, given by the meta dictionary.

Resolves #157

Signed-off-by: Katleho Madisa katleho.madisa47@gmail.com

Screenshots or code snippets (if appropriate):
N/A

Definition of Done Checklist

  • Code meets our python style guidelines?
  • Unit tested (coded, passed, included)?
  • Requested at least 2 reviewers?
  • Commented code, particularly in hard-to-understand areas?
  • Made corresponding changes to the documentation (e.g. Python documentation, System Engineering Documentation, version description updates, README file, etc)?

SKA-JIRA: 442

…es that are python primitive types (float in this case) which are appropriate for attributes with a SCALAR data format.

This is a problem for the attrbiutes with more complex data formats, SPECTRUM/IMAGE. When reading an attribute, the quantity returns a primitive type which PyTango is not expecting, therefore
resulting in the error, 'Wrong Python type for attribute... Expected a sequence'.
This change here allows us to cater for the complex data formats. The method next_val now generates the simulation data according to the data format, given by the meta dictionary.

Resolves #157

Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>
…LAR. It is implied to be 1. I have set default values

for the max_dim_x and max_dim_y properties, respectively, when the are not provided.

Resolves #157

Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>

@samueltwum1 samueltwum1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

read and write Spectrum/Image attribute problem

2 participants