Conversation
| self, | ||
| id: Id, | ||
| windings: str, | ||
| type: str, |
There was a problem hiding this comment.
We are lucky because the windings argument was stored as type in the json file format. We do not need to create a new file schema version.
| if phases2 is None: | ||
| phases2 = "".join(p for p in bus2.phases if p in bus1.phases or p == "n") | ||
| if len(phases2) != 3: | ||
| msg = f"Phases (2) of transformer {id!r} can not be deduced from the buses, they need to be specified." | ||
| logger.error(msg) | ||
| raise RoseauLoadFlowException(msg=msg, code=RoseauLoadFlowExceptionCode.BAD_PHASE) | ||
| else: | ||
| self._check_phases(id, allowed_phases=self._allowed_phases_split_secondary, phases2=phases2) | ||
| self._check_bus_phases(id, bus2, phases2=phases2) |
There was a problem hiding this comment.
In the second option phases2 is not None, you ensure that the neutral is present in the secondary phases using the self._allowed_phases_split_secondary variable (all the options have a neutral). Not in the first option phases2 is None. If I provide bus1.phases="abcn" and bus2.phases="abc", I get phases2="abc" and len(phases2)==3. As far as I remember, the neutral is mandatory for split phase transformer (secondary).
There was a problem hiding this comment.
Indeed, good catch. The check with len was ok for single-phase, but not here.
alihamdan
left a comment
There was a problem hiding this comment.
Thanks. I left a few comments, mostly nits.
Could you please replace all "can not" in the error messages by "cannot" (no space)? thanks.
Co-authored-by: Ali Hamdan <ali.hamdan@roseautechnologies.com>
TransformerType