Skip to content

Create records for appending tables#20

Draft
hyperrealist wants to merge 2 commits intoPandABlocks:update_to_fastcs_0.11from
hyperrealist:18-fastcs-pandablocks-create-records-for-appending-tables
Draft

Create records for appending tables#20
hyperrealist wants to merge 2 commits intoPandABlocks:update_to_fastcs_0.11from
hyperrealist:18-fastcs-pandablocks-create-records-for-appending-tables

Conversation

@hyperrealist
Copy link
Copy Markdown
Contributor

Fixes #18

  • records added
  • tests added

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.00%. Comparing base (0016eb9) to head (dc45db0).

Files with missing lines Patch % Lines
src/fastcs_pandablocks/panda/blocks/blocks.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           update_to_fastcs_0.11      #20      +/-   ##
=========================================================
- Coverage                  39.19%   39.00%   -0.20%     
=========================================================
  Files                         18       18              
  Lines                        995     1000       +5     
=========================================================
  Hits                         390      390              
- Misses                       605      610       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@LuisFSegalla LuisFSegalla left a comment

Choose a reason for hiding this comment

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

It looks good for me. I'm not so sure how the newest versions of FastCS are implementing the attributes handling, but I can't see anything obviously wrong with the code. I'm happy to test it against real hardware whenever you're available to do so!

@shihab-dls
Copy link
Copy Markdown
Contributor

This projects going to be updated to use FastCS 0.11 once #17 is in; would you mind rebasing over that branch, @hyperrealist? I can help, if there are ambiguous merge conflicts.

@hyperrealist hyperrealist force-pushed the 18-fastcs-pandablocks-create-records-for-appending-tables branch from ce11833 to f834d4d Compare December 10, 2025 11:49
@hyperrealist hyperrealist requested a review from coretl December 11, 2025 16:47
Comment thread docs/conf.py Outdated
Comment thread docs/conf.py
# CLEAR
parent_block.add_attribute(
panda_name + PandaName(sub_field="CLEAR"),
AttrW(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a Command

)
),
description="Current table mode.",
group=WidgetGroup.OUTPUTS.value,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you put this in PARAMETERS please so it appears under the table

AttrR(
Int(),
description="Number of queued lines not yet processed.",
group=WidgetGroup.READBACKS.value,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you put this in PARAMETERS please so it appears under the table

Bool(),
description="Clear the table.",
io_ref=DefaultFieldIORef(
panda_name, self._raw_panda.put_value_to_panda
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should call client.send(Put(panda_name, [])) which sets it to an empty table

@shihab-dls I don't know how to make an IORef do that

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.

I think you'd want to do something like this instead:

async def clear_table() -> None:
    await self._raw_panda.put_value_to_panda(panda_name, attribute.datatype, [])

parent_block.clear = Command(clear_table)

Although, it looks like the widget made for commands sends "False" to the SharedPV, which raises an error, which we should look at. Putting True to the command PV will clear the table.

Table(structured_datatype),
handler=TableFieldHandler(panda_name),
io_ref=TableFieldIORef(
panda_name, field_info, self._raw_panda.put_value_to_panda
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should check the value of the NEXT_WRITE attribute, and decide whether to Put, Append or Append(last=True) based on its value

Enum(enum.Enum("NextWrite", ["Replace", "Append", "Append Last"])),
description="What the next write will do to the table.",
io_ref=DefaultFieldIORef(
panda_name, self._raw_panda.put_value_to_panda
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should not write to the PandA, it should just store the value

@hyperrealist hyperrealist force-pushed the 18-fastcs-pandablocks-create-records-for-appending-tables branch from f163852 to d23f70b Compare December 15, 2025 10:38
@hyperrealist hyperrealist changed the base branch from main to update_to_fastcs_0.11 December 15, 2025 10:59
@hyperrealist hyperrealist force-pushed the 18-fastcs-pandablocks-create-records-for-appending-tables branch from d23f70b to dc45db0 Compare December 15, 2025 11:02
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.

Create records for appending tables

4 participants