Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] ValueError: X is not in list #355

Closed
the-hess opened this issue May 21, 2024 · 8 comments · Fixed by #358
Closed

[bug] ValueError: X is not in list #355

the-hess opened this issue May 21, 2024 · 8 comments · Fixed by #358
Labels
bug Something isn't working

Comments

@the-hess
Copy link

First of all thanks everyone who's worked on this, it's a great tool.

I'm having an issue when using arrows and simple connectors.

At the moment I'm trying to do a large wiring diagram for a full system and I'm getting an error when pointing a simple connector to a normal connector with an arrow. It works when I point the connector to pin 1, but not pin 2 or higher.

In my yaml file, the offending entry is on line 149 - if you change the [2] to a [1] the diagram renders as below, but I want it to point to contact 2 of connector 07-0613.

I'm currently using version the 0.4 and have (manually) implemented the basic fixes in #346 and #347.

Graphviz version 9.0.0 (20230911.1827)
Python 3.12.2

wiringDiag

options:
  mini_bom_mode: true
  
connectors:
#Items
 07-0601:
    pinlabels: [J14,J15,J28,J4,J10,J12,J5,J7,J1,J6,J8,J2,J13,J16,J11,J9]
    show_pincount: false
    #bgcolor: OL
    
 07-0620:
    pinlabels: [9 Way, 25 Way, 37 Way, 4 Way XLR]
    show_pincount: false

 07-0518:
    pins: [L,N,E,+V,-V]
    show_pincount: false
 
 07-0624: 
    pinlabels: [1]
    show_pincount: false
    
 07-0613:
    pins: [1, 2, 3]
    pinlabels: [J1, J2, J3]
    show_pincount: false
#End of wire points 
 F:
    style: simple
    type: bootlace ferrule
    
 P:
    style: simple
    type: Molex
    
 E:
    style: simple
    type: E-Stop
    
 X:
    style: simple
    type: XLR
    
 D:
    style: simple
    type: D-SUB
    
cables:
 07-0608:
    show_wirecount: false
    colors: [BU,BUWH]
 
 07-0607:
    show_wirecount: false
    colors: [RD,WH,RDWH]
    
 07-0603:
    colors: [RD,BK]
    show_wirecount: false
    
 07-0606:
    colors: [VT,VTWH,VTWH,GN,GNWH,GNWH,OG,OGWH,OGWH]
    show_wirecount: false

 07-0604:
    colors: [GY]
    show_wirecount: false
    
 07-0609:
    colors: [GY]
    show_wirecount: false
    
 07-0610:
    colors: [GY]
    show_wirecount: false
    
 07-0611:
    colors: [GY]
    show_wirecount: false
    
 07-0612:
    colors: [GY]
    show_wirecount: false
    
 07-0614:
    colors: [VTWH]
    show_wirecount: false
    
connections:
 -
    - 07-0601: [2,3]
    - <--
    - P.
    - 07-0608: [1,2]
    - 07-0620: [9 Way,9 Way]
 -
    - 07-0601: [4-6]
    - <--
    - P.
    - 07-0607: [1-3]
    - 07-0620: [2,2,2]
    
 -
    - 07-0518: [+V,-V]
    - -->
    - F.
    - 07-0603: [1,2]
    - P
    - -->
    - 07-0601: [1,1]
    
 -
    - 07-0601: [7-15]
    - <--
    - P.
    - 07-0606: [1-9]
    - 07-0620: [3,3,3,3,3,3,3,3,3]
    
 -
    - 07-0601: [16]
    - <--
    - P.
    - 07-0604: [1]
    - 07-0620: [4]
    
 -
    - 07-0620: [4]
    - <--
    - X.
    - 07-0609: [1]
    - E.
    
 -
    - 07-0620: [2]
    - <--
    - D.
    - 07-0610: [1]
    - D.
    - -->
    - 07-0613: [1]
    
 -
    - 07-0620: [3]
    - <--
    - D.
    - 07-0611: [1]
    - D.
    - -->
    - 07-0613: [2]

 -
    - 07-0620: [1]
    - <--
    - D.
    - 07-0612: [1]
    - D.
    - -->
    - 07-0624: [1]
    
 -
    - 07-0613: [3]
    - <--
    - P.
    - 07-0614: [1]
    - P.
@martinrieder
Copy link
Contributor

@the-hess Check your connector definitions. You mixed up pins and pinlabels. The first defines the designators that are used for the connection. Specifying pinlabels will cause numeric pins to be generated.

@the-hess
Copy link
Author

Yeah I had this issue a couple of times, hence the switching. The issue is I can't refer to the pinlabels either. I then just get J2 is not in list.

@martinrieder
Copy link
Contributor

Sounds a bit like #336, but this one seems to be caused by the autogeneration. By coincidence, also #356 reports a similar issue. They might be related.

I noticed another issue with the P connector beneath 07-0603, which is missing the "."

@the-hess
Copy link
Author

I noticed another issue with the P connector beneath 07-0603, which is missing the "."

That was deliberate as I want both those wires into 1 connector.

I've tried various combinations of pins, pinlabels, just using numbers (without any names for pins). I can't get the issue to go away fully though it does shift around exactly what connector/signal it flags for.

@kvid kvid added the bug Something isn't working label May 21, 2024
kvid added a commit that referenced this issue May 22, 2024
The code processing mates used a mix of repeated connector look-ups
and local connector variables, and one variable was used before it
was assigned the correct value.

This error was detected when investigating the #355 bug report.

The local connector variables are now both assigned initially when
processing each mate, and used instead of repeated connector look-ups.
@kvid kvid mentioned this issue May 22, 2024
2 tasks
@kvid kvid changed the title [bug?] ValueError: X is not in list [bug] ValueError: X is not in list May 22, 2024
@kvid kvid linked a pull request May 22, 2024 that will close this issue
2 tasks
@kvid
Copy link
Collaborator

kvid commented Jun 1, 2024

@the-hess - You should now try my PR #358 intended to fix this issue, and please report back here what you find. I fixed the initial issue pretty quickly, but found also another bug in the same code section, and now that also should be fixed.

kvid added a commit that referenced this issue Jun 11, 2024
Bug: The code processing mates used a mix of repeated connector
look-ups and local connector variables, and one variable was used
before it was assigned the correct value.

This fixes the #355 bug.

The local connector variables are now both assigned initially when
processing each mate, and used instead of repeated connector look-ups.
kvid added a commit that referenced this issue Jun 14, 2024
Symptom reported in #355: Unable to connect an arrow (mate) to
pins higher than 1 without failing: ValueError: X is not in list

Bug: The code processing mates used a mix of repeated connector
look-ups and local connector variables, and one variable was used
before it was assigned the correct value.

Fix: The local connector variables are now both assigned initially
before processing each mate, and used when processing instead of
repeated connector look-ups.
formatc1702 pushed a commit that referenced this issue Jun 17, 2024
Symptom reported in #355: Unable to connect an arrow (mate) to
pins higher than 1 without failing: ValueError: X is not in list

Bug: The code processing mates used a mix of repeated connector
look-ups and local connector variables, and one variable was used
before it was assigned the correct value.

Fix: The local connector variables are now both assigned initially
before processing each mate, and used when processing instead of
repeated connector look-ups.
kvid added a commit that referenced this issue Jul 5, 2024
Symptom reported in #355: Unable to connect an arrow (mate) to
pins higher than 1 without failing: ValueError: X is not in list

Bug: The code processing mates used a mix of repeated connector
look-ups and local connector variables, and one variable was used
before it was assigned the correct value.

Fix: The local connector variables are now both assigned initially
before processing each mate, and used when processing instead of
repeated connector look-ups.
@kvid
Copy link
Collaborator

kvid commented Jul 6, 2024

The relevant fixes are now merged into the release/v0.4.1-rc branch of PR #365 that is not yet released, but also describes how you can install the latest collection of fixes before the release.

@callumroest
Copy link

The fix in PR #365 resolved this issue for me.

@kvid
Copy link
Collaborator

kvid commented Jul 13, 2024

Closed after releasing v0.4.1.

@kvid kvid closed this as completed Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants