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

Ability to input junctions at ProjectInfo initialisation #105

Open
nikosavola opened this issue Mar 25, 2022 · 1 comment
Open

Ability to input junctions at ProjectInfo initialisation #105

nikosavola opened this issue Mar 25, 2022 · 1 comment

Comments

@nikosavola
Copy link
Contributor

Similarly to #103, I think junctions should be possible to give in ProjectInfo initialisation as arguments.
Doing

pinfo.junctions['jAlice'] = {'Lj_variable':'Lj_alice', 'rect':'rect_alice', 'line': 'line_alice', 'Cj_variable':'Cj_alice'}
pinfo.junctions['jBob']   = {'Lj_variable':'Lj_bob', 'rect':'rect_bob',  'line': 'line_bob', 'Cj_variable':'Cj_bob'}

feels similarly hacky to #102 (though maybe not as much).

A syntax with dictionary of dictionaries could be supported

junctions = {
    'jAlice': {'Lj_variable':'Lj_alice', 'rect':'rect_alice', 'line': 'line_alice', 'Cj_variable':'Cj_alice'},
    'jBob': {'Lj_variable':'Lj_bob', 'rect':'rect_bob',  'line': 'line_bob', 'Cj_variable':'Cj_bob'}
}
pinfo = epr.ProjectInfo(..., junctions=junctions)

In this case pinfo.validate_junction_info() could be called automatically and an Exception raised

@zlatko-minev
Copy link
Owner

This would be backwards compatible?

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