pcdshub / pcdshub/hutch-python

Namespace creation should recognize group with single member

Open
#145 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
18
Avg merge
7d 9h
Merged PRs (30d)
1

Description

It looks like the namespace generator is being a little too aggressive splitting on underscores. It would be nice if we could determine that a group will a single member and not split on the following underscores in it's name.

An example: xpp_sb2_slits_low.

There is no other device with name xpp_sb2_slits_*. However this is still split

xpp.sb2.low  # IterableNamespace with one member
xpp.sb2.low.slits  # Actual device

Expected Behavior

I think that we should avoid that final split and have the namespace structure just be:

xpp.sb2.low_slits

Is this as quick a fix as I imagined or does this have repercussions I'm not thinking of?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the namespace generator and reproduce the issue with the device name xpp_sb2_slits_low. Trace how underscores are split when no other xpp_sb2_slits_* device exists, then verify that the resulting namespace is xpp.sb2.low_slits while the device remains accessible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.