Skip to content

Reduce size of ADCore.ibek.support.yaml with anchors and aliases#133

Open
GDYendell wants to merge 2 commits intomainfrom
adcore-aliases
Open

Reduce size of ADCore.ibek.support.yaml with anchors and aliases#133
GDYendell wants to merge 2 commits intomainfrom
adcore-aliases

Conversation

@GDYendell
Copy link
Copy Markdown
Member

@GDYendell GDYendell commented Aug 27, 2025

Add XMLSIZE to NDArrayBase entities

Fixes #131

@GDYendell GDYendell requested a review from gilesknap August 27, 2025 16:12
Copy link
Copy Markdown
Member

@gilesknap gilesknap left a comment

Choose a reason for hiding this comment

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

Nice work. Looks good.

I'm going to trust ChatGPT has confirmed equivalence.

@GDYendell
Copy link
Copy Markdown
Member Author

GDYendell commented Aug 28, 2025

We should consider adding these to the NDArrayBase parameters:

  • MAX_BUFFERS
  • MAX_MEMORY
  • QUEUE
  • PRIORITY
  • STACK_SIZE

I think these are valid for all, but only a few use them

We might also want a smaller subset to use for OverlayN, ROIStatN, AttributeN, NDTimeSeriesN that seem to all use

  • P
  • R
  • PORT
  • ADDR
  • TIMEOUT

but not the driver specific things like NDARRAY_PORT and SCANRATE

Also, some of the duplicated parameters actually set different defaults e.g. QUEUE on NDCircularBuff is 50 rather than 2 like everything else. What do we want to do about those?

Thoughts @gilesknap ?

@gilesknap
Copy link
Copy Markdown
Member

We should consider adding these to the NDArrayBase parameters:

  • MAX_BUFFERS
  • MAX_MEMORY
  • QUEUE
  • PRIORITY
  • STACK_SIZE

I think these are valid for all, but only a few use them

We might also want a smaller subset to use for OverlayN, ROIStatN, AttributeN, NDTimeSeriesN that seem to all use

  • P
  • R
  • PORT
  • ADDR
  • TIMEOUT

but not the driver specific things like NDARRAY_PORT and SCANRATE

Also, some of the duplicated parameters actually set different defaults e.g. QUEUE on NDCircularBuff is 50 rather than 2 like everything else. What do we want to do about those?

Thoughts @gilesknap ?

If that top list is in NDArrayBase then it should be OK to add them into the anchor. But we do need to verify that the default values are the same for all uses.

I see no reason not to make an anchor for the XXXN templates.

@GDYendell
Copy link
Copy Markdown
Member Author

GDYendell commented Aug 29, 2025

But we do need to verify that the default values are the same for all uses.

Does that mean keeping the duplicated definitions with different defaults, or can we override just the default value somehow?

Base automatically changed from roistat-xml-size to main August 29, 2025 12:51
@gilesknap
Copy link
Copy Markdown
Member

But we do need to verify that the default values are the same for all uses.

Does that mean keeping the duplicated definitions with different defaults, or can we override just the default value somehow?

When you do:

  <<: *my_alias
  my_override: my_override_value

The contents of &my_alias are merged into the dictionary, with the local key:values overriding anything in the alias. So my_override will take precedence.

@GDYendell
Copy link
Copy Markdown
Member Author

Sure, but do you then have to duplicate the whole object like

      <<: *NDArrayBase-model-parameters
      QUEUE:
        type: int
        description: |-
          Input array queue size
        default: 50

or can you just do something like

      <<: *NDArrayBase-model-parameters
      QUEUE:
        default: 50

?

@gilesknap
Copy link
Copy Markdown
Member

if I understand your question then no you do not need to include values that you will always override.
So you don't need the default: in the anchor in your above example.

Its a straight merge of the dictionary you alias and the dictionary you are in. With the dictionary you are in having precedence.

@GDYendell
Copy link
Copy Markdown
Member Author

No that isn't what I was asking 😄

default will usually be 2, so we should include that in the anchor so that we don't have to duplicate

What I am asking is when using the alias do you have to redefine the entire key, or can you just redefine some part of it - e.g. just the default without duplicating the description

@gilesknap
Copy link
Copy Markdown
Member

Now I get you, so that depends on whether the whole hierarchy is merged or just the root keys. I'm going to say I think that the whole hierarchy is but I don't think I have tested that.

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.

reduce size of ADCore.ibek.support.yaml

2 participants