-
Notifications
You must be signed in to change notification settings - Fork 0
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
uf/#57-fixLineTypeMismatch #79
base: main
Are you sure you want to change the base?
Changes from 4 commits
2a33252
bdc3824
14fe685
e31b0da
c61e7ac
e7e739b
8768218
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
io { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the config. Those files should be kept locally. |
||
input { | ||
csv = { | ||
fileEncoding = "UTF-8" | ||
fileEnding = ".csv" | ||
separator = ";" | ||
directoryHierarchy = false | ||
} | ||
} | ||
|
||
output { | ||
csv = { | ||
fileEncoding = "UTF-8" | ||
fileEnding = ".csv" | ||
separator = ";" | ||
directoryHierarchy = false | ||
} | ||
|
||
targetFolder = "convertedData/ratedVoltageMismatch" | ||
compress = false | ||
} | ||
|
||
simbenchCodes = [ | ||
"1-EHVHV-mixed-all-0-no_sw" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,9 @@ import edu.ie3.datamodel.utils.GridAndGeoUtils | |
import edu.ie3.simbench.exception.ConversionException | ||
import edu.ie3.simbench.model.datamodel.types.LineType | ||
import edu.ie3.simbench.model.datamodel.{Line, Node} | ||
import edu.ie3.util.quantities.PowerSystemUnits.KILOMETRE | ||
import edu.ie3.util.quantities.PowerSystemUnits.{KILOMETRE, KILOVOLT} | ||
import javax.measure.quantity.ElectricPotential | ||
import tech.units.indriya.ComparableQuantity | ||
import tech.units.indriya.quantity.Quantities | ||
|
||
import scala.collection.parallel.CollectionConverters._ | ||
|
@@ -29,15 +31,18 @@ case object LineConverter extends LazyLogging { | |
*/ | ||
def convert( | ||
inputs: Vector[Line[_ <: LineType]], | ||
types: Map[LineType, LineTypeInput], | ||
types: Map[ | ||
(LineType, ComparableQuantity[ElectricPotential]), | ||
LineTypeInput | ||
], | ||
nodes: Map[Node, NodeInput] | ||
): Vector[LineInput] = | ||
inputs.par.flatMap { | ||
case acLine: Line.ACLine => | ||
val (nodeA, nodeB) = | ||
NodeConverter.getNodes(acLine.nodeA, acLine.nodeB, nodes) | ||
val lineType = types.getOrElse( | ||
acLine.lineType, | ||
(acLine.lineType, Quantities.getQuantity(acLine.nodeA.vmR, KILOVOLT)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we use a composite key to access a map. However, the second part (the voltage) is set up from Doubles. Thus, it could be error prone. Maybe you may add a warning comment, that this only works, if you don't do any calculations with the voltage, that you provide here. |
||
throw ConversionException( | ||
s"Cannot find conversion result for line type ${acLine.lineType.id}" | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -322,7 +322,7 @@ final case class SimbenchReader( | |
read(clazz, fields) | ||
} | ||
), | ||
Duration("10 s") | ||
Duration("100 s") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't commit this, as it was just an adaption to make it run on your PC. |
||
) | ||
.toMap | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CHANGELOG should be cumulative. That means, that you please keep, what is written under
[1.0.0]
and add yourChanged
part beneathUnreleased