artiq icon indicating copy to clipboard operation
artiq copied to clipboard

Add some support to the dashboad for list datasets

Open mbirtwell opened this issue 2 years ago • 6 comments

ARTIQ Pull Request

Description of Changes

Allows viewing small list datasets and editing them. It's not particularly clever it just shows the pyon and allows the user to enter new pyon in the edit dialog. It doesn't have the same checking as when creating datasets, but it's good enough for our use case.

Type of Changes

Type
:sparkles: New feature

Steps (Choose relevant, delete irrelevant before submitting)

All Pull Requests

  • [x] Use correct spelling and grammar.
  • [x] Check the copyright situation of your changes and sign off your patches (git commit --signoff, see copyright).

Code Changes

  • [x] Run flake8 to check code style (follow PEP-8 style). flake8 has issues with parsing Migen/gateware code, ignore as necessary.
  • [x] Test your changes or have someone test them. Mention what was tested and how.

Git Logistics

  • [x] Split your contribution into logically separate changes (git rebase --interactive). Merge/squash/fixup commits that just fix or amend previous commits. Remove unintended changes & cleanup. See tutorial.
  • [x] Write short & meaningful commit messages. Review each commit for messages (git show). Format:
    topic: description. < 50 characters total.
    
    Longer description. < 70 characters per line
    

Licensing

See copyright & licensing for more info. ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.

mbirtwell avatar Sep 16 '22 09:09 mbirtwell

It doesn't have the same checking as when creating datasets

Why not?

sbourdeauducq avatar Sep 26 '22 12:09 sbourdeauducq

It doesn't have the same checking as when creating datasets

Why not?

There were two ways of doing checking: the Creator which does a pyon parse on every key press and the Editor which relied on creating a control which only accepted valid inputs. Adding the PyonEditor didn't neatly fit in to either of those ways of working so I skipped doing it nicely, but did just enough that it worked well in practice.

mbirtwell avatar Sep 28 '22 17:09 mbirtwell

I skipped doing it nicely, but did just enough that it worked well in practice.

Unfortunately this attitude results in code that is worse than much of the existing one. We can add this as a experimental-features patch if not doable nicely.

sbourdeauducq avatar Sep 28 '22 23:09 sbourdeauducq

Unfortunately this attitude results in code that is worse than much of the existing one. We can add this as a experimental-features patch if not doable nicely.

I don't think this has adversely affected the code quality significantly, what I was drawing your attention to was an inconsistency in the UI. Upon reflection though that inconsistency already existed, and this builds upon it. The inconsistency arises because the dialogs for creating and editing datasets work in two different ways. This gives rise to the situation where you can create list datasets but couldn't edit them, and you can't change the type of an existing dataset, for example attempting to change a dataset from int to float currently silently drops the fractional part, which I find quite unpleasant.

I think a better way of resolving this would be to combine the create and edit dialogs, add a type drop down, when opening it as create default to pyon, so if the user chooses not to interact with the drop down it behaves as it does today. Changing the drop down can change the type of the value control. For edit the drop down can default to the current type similarly to how we select a different edit widget subclass at the moment.

mbirtwell avatar Sep 29 '22 09:09 mbirtwell

Sounds good. Can you implement that instead?

sbourdeauducq avatar Sep 29 '22 09:09 sbourdeauducq

I'm a bit in the middle of a project at the moment, maybe in a couple of weeks I'll be able to carve out some time to do some artiq things. I'm aware that I also have a patch for default gateway configuration on kasli that I never tested because our test hardware was in a strange state when wrote it. So maybe I can knock this and that off then.

mbirtwell avatar Sep 30 '22 09:09 mbirtwell

Moved to #2001

thomasfire avatar Nov 21 '22 09:11 thomasfire