@@ -704,6 +704,71 @@ def dump(self, file_path: pathlib.PosixPath | str, indent: int | None = None):
704704 json .dump (self .data , f , indent = indent )
705705
706706
707+ class CrowsImport (RavensImport ):
708+ def __init__ (self , * args , ** kwargs ):
709+ super ().__init__ (* args , ** kwargs )
710+
711+ self ._remove_superflorous_objects ()
712+ self ._convert_all_to_puz ()
713+ self ._simplify_ACLineSegment ()
714+ self ._simplify_Switch ()
715+ # etc
716+
717+ def _remove_superflorous_objects (self ):
718+ 'removes objects that are unnecessary for OPF'
719+ pass
720+
721+ def _convert_all_to_puz (self ):
722+ 'converts all WireInfo type objects into PerLengthImpedance objects'
723+ pass
724+
725+ def _simplify_ACLineSegment (self ):
726+ 'simplifies ACLineSegment objects'
727+ pass
728+
729+ def _simplify_Switch (self ):
730+ 'simplifies Switch objects'
731+ pass
732+
733+ def _simplify_EnergyConsumer (self ):
734+ 'simplifies EnergyConsumer objects'
735+ pass
736+
737+ def _simplify_EnergySource (self ):
738+ 'simplifies EnergySource objects'
739+ pass
740+
741+ def _simplify_PowerTransformer (self ):
742+ 'simplifies PowerTransformer objects'
743+ pass
744+
745+ def _simplify_RotatingMachine (self ):
746+ 'simplifies RotatingMachine objects'
747+ pass
748+
749+ def _simplify_PowerElectronicsConnection (self ):
750+ 'simplifies PowerElectronicConnection objects'
751+ pass
752+
753+ def __simplify_Terminal (self ):
754+ 'simplifies Terminal objects'
755+ pass
756+
757+ def __simplify_generic (self ):
758+ 'Removes unnecessary IdentifiedObject attributes, sequenceNumber attributes, and IdentifiedObject.name in cases where it is unneeded.'
759+ pass
760+
761+ def _cleanup (self ):
762+ 'ensures that empty objects are removed'
763+ pass
764+
765+ def restore_ravens (self ):
766+ 'method to re-convert to ravens from the base XML'
767+ pass
768+
707769if __name__ == "__main__" :
708770 d = RavensImport ("examples/IEEE13_Assets.xml" )
709771 d .dump ("examples/IEEE13_Assets.json" , indent = 2 )
772+
773+ d2 = CrowsImport ("examples/IEEE13_Assets.xml" )
774+ d2 .dump ("examples/IEEE13_Assets_simplified.json" )
0 commit comments