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

remove_unconnected_nodes does not work for network types other than heating and cooling #21

Open
PGorzalka opened this issue Feb 3, 2023 · 0 comments

Comments

@PGorzalka
Copy link

If calling UESGraph.remove_unconnected_nodes with network_type others, an error message
UnboundLocalError: local variable 'is_supply' referenced before assignment
cannot be avoided.

This may be intended behaviour, but the docstring lists all network types {'heating', 'cooling', 'electricity', 'gas', 'others'}. I would at least add 'others', and add the following after line 1654 of uesgraphs/uesgraph.py:

        elif network_type == 'others':
            is_supply = 'is_supply_others'
            nodelist = self.nodelists_others[network_id]
        else:
            warnings.warn('Removal of unconnected nodes is not supported for network type {}.'.format(network_type))
            return removed
PGorzalka pushed a commit to PGorzalka/uesgraphs that referenced this issue Feb 3, 2023
…for network_type 'others' and return an empty list without removing nodes for remaining network types.
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

1 participant