Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
Z
Zero
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Sean Leavey
  • Zero
  • Issues
  • #48

Closed
Open
Opened Aug 06, 2019 by Anchal Gupta@anchal.gupta

Node regeneration required when circuit nodes are manipulated

I have attached a notebook example which illustrates this issue.NodeRegenerationOnCircuitChanges.ipynb. Right after someone changes any node of a circuit, there are no calls made to _regenerate_node_set() function. I see this is because nodes are set through property setter function and in that scope, it doesn't have knowledge of the circuit object it is part of. Due to this, right after a node is manipulated, the number of nodes circuit.n_nodes and the list of nodes circuit.nodes is outdated and may have errors in them unless _regenerate_node_set() is called. There are two solutions that I can think of:

  1. Ban changing the nodes of the circuit object directly and define the set_node function to ensure _regenerate_node_set is called inside it.
  2. Some clever setitem function for the circuit object which works with dictionary-like functionality of circuit as well. I'm not really sure if this is possible, but this will be way more intuitive and will make using circuit['r1'].node2='n3' legal.
Edited Aug 06, 2019 by Anchal Gupta
Assignee
Assign to
Node graphs
Milestone
Node graphs
Assign milestone
Time tracking
None
Due date
None
Reference: sean-leavey/zero#48