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

[syntax error]: Splice error in Wireviz #396

Closed
akikinho opened this issue Jun 26, 2024 · 5 comments
Closed

[syntax error]: Splice error in Wireviz #396

akikinho opened this issue Jun 26, 2024 · 5 comments

Comments

@akikinho
Copy link

akikinho commented Jun 26, 2024

Hello Wireviz team,

I am getting an error in using splice
(ValueError: 'autogenerate' in Connector 'SPLICE': 'autogenerate' is replaced with new syntax in v0.4) in the new version. Can you please help ?

Package Version


click 8.1.7
colorama 0.4.6
graphviz 0.20.3
numpy 1.26.4
pandas 2.2.2
pillow 10.3.0
pip 24.0
python-dateutil 2.9.0.post0
pytz 2024.1
PyYAML 6.0.1
setuptools 70.1.0
six 1.16.0
tzdata 2024.1
wireviz 0.4.1.dev0

Microsoft Windows [Version 10.0.19045.4529]

@kvid
Copy link
Collaborator

kvid commented Jun 26, 2024

@akikinho - you have not provided your YAML input (that normally makes it easier to help you), but the error message describes the problem pretty well:

  • ValueError: 'autogenerate' in Connector 'SPLICE': - You have used the autogenerate attribute in your Connector named 'SPLICE'
  • 'autogenerate' is replaced with new syntax in v0.4 - The autogenerate attribute is no longer supported by v0.4 because the same functionality is now available with the new syntax using the dot notation as you already have used in your previous issue [query] Dot notation error in Wireviz #393.

Please read the documents I linked to in #393 (comment) and #393 (comment)

@akikinho
Copy link
Author

akikinho commented Jun 26, 2024

Thank you @kvid. I did not understand how to use the dot notation incase of splice. Here is the yaml file

connectors:           
    CX:
         pincount: 5
         type: Plug Housing
         subtype: female
         pins: [1,2,3,4,5]
            
    S: &splice  # generic autogenerated splice
         style: simple
         autogenerate: true
         type: splice
         show_name: true
     
    SPLICE G:
         <<: *splice          # copy attributes from 'S'
         autogenerate: false  # but disable autogeneration
         show_name: true     # this is currently necessary when autogenerate == false
         
cables:
    WIRE G:
        gauge: 1 
        #length: 0.2
        type: TXL
        # color_code: IEC
        wirecount: 5
        show_equiv: true # auto-calculate AWG equivalent
        colors: [GY,OG,GN,RD,BN]
        # shield: true # add cable shielding
        category: bundle
        wirelabels: [A,B,C,D,E]

        
connections:        
-
    - CX: [2]
    - WIRE G: [2]
    - SPLICE G
   

@akikinho
Copy link
Author

@kvid it works now

connectors:           
    CX:
         pincount: 5
         type: Plug Housing
         subtype: female
         pins: [1,2,3,4,5]
            
    S: &splice  # generic autogenerated splice
         style: simple
         type: splice
         show_name: true
         
cables:
    WIRE G:
        gauge: 1 
        #length: 0.2
        type: TXL
        # color_code: IEC
        wirecount: 5
        show_equiv: true # auto-calculate AWG equivalent
        colors: [GY,OG,GN,RD,BN]
        # shield: true # add cable shielding
        category: bundle
        wirelabels: [A,B,C,D,E]

        
connections:        
-
    - CX: [2]
    - WIRE G: [2]
    - S.SPLICE G
   

@kvid
Copy link
Collaborator

kvid commented Jun 26, 2024

Remove all autogenerate attributes! When you want unnamed splices/connectors/cables to be autogenerated, then append a dot to their names in the connection sets.

Please read the comment and the document I linked to in #393 (comment) and explain what parts you don't understand. We want to improve the documentation, but need feed-back on what parts are hard to understand.

@kvid
Copy link
Collaborator

kvid commented Jun 26, 2024

I'm sorry, but my browser didn't show your latest comment while I wrote my answer, so I saw it too late...

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

No branches or pull requests

2 participants