-
Notifications
You must be signed in to change notification settings - Fork 7
Generalize CSV->File #1450
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
base: dev
Are you sure you want to change the base?
Generalize CSV->File #1450
Conversation
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.
LGTM. I have just two small remarks.
- Change spotless to use googleJavaFormat('1.28.0') [#1409](https://github.com/ie3-institute/PowerSystemDataModel/issues/1409) | ||
- Change `TimeSeries` to no longer extend `UniqueEntity` [#1441](https://github.com/ie3-institute/PowerSystemDataModel/issues/1441) | ||
|
||
- Refactor CSV handling into shared file-based infrastructure. [#1450](https://github.com/ie3-institute/PowerSystemDataModel/issues/1445) |
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.
Could you add an empty line below?
} | ||
} | ||
|
||
def "The CSV time series meta information source returns correct meta information for a given time series UUID"() { |
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.
Could you add a check for the file type here?
I'll also have a second look at this as soon as I can. |
This pull request refactors the CSV data handling infrastructure to introduce a shared, extensible file-based connector layer. It generalizes the file connector logic, introduces new metadata classes to support multiple file types, and removes legacy CSV-specific meta information classes. These changes improve code modularity and future extensibility for additional file formats.
File connector infrastructure refactoring:
FileConnector
to encapsulate common file-based source/sink logic, including input stream handling and file path resolution. (src/main/java/edu/ie3/datamodel/io/connectors/FileConnector.java
)CsvFileConnector
to extendFileConnector
, removing redundant code and centralizing file handling logic. (src/main/java/edu/ie3/datamodel/io/connectors/CsvFileConnector.java
) [1] [2] [3] [4]File type and metadata generalization:
FileType
enum to represent supported file types (currently only CSV), with utility methods for file type detection. (src/main/java/edu/ie3/datamodel/io/file/FileType.java
)FileIndividualTimeSeriesMetaInformation
andFileLoadProfileMetaInformation
to replace CSV-specific meta information classes and support file type extensibility. (src/main/java/edu/ie3/datamodel/io/naming/timeseries/FileIndividualTimeSeriesMetaInformation.java
,src/main/java/edu/ie3/datamodel/io/naming/timeseries/FileLoadProfileMetaInformation.java
) [1] [2]Cleanup and migration to new metadata:
CsvIndividualTimeSeriesMetaInformation
andCsvLoadProfileMetaInformation
classes, updating usages throughout the codebase to use the new file-based metadata classes. (src/main/java/edu/ie3/datamodel/io/csv/CsvIndividualTimeSeriesMetaInformation.java
,src/main/java/edu/ie3/datamodel/io/csv/CsvLoadProfileMetaInformation.java
, other affected files) [1] [2] [3] [4]Documentation and changelog:
CHANGELOG.md
to document the refactoring of CSV handling into a shared file-based infrastructure. (CHANGELOG.md
)Package and import adjustments:
TimeSeriesMetaInformation
and related classes to theio.naming.timeseries
package, updating imports across affected files. (src/main/java/edu/ie3/datamodel/io/naming/TimeSeriesMetaInformation.java
→src/main/java/edu/ie3/datamodel/io/naming/timeseries/TimeSeriesMetaInformation.java
) [1] [2] [3] [4] [5]These changes lay the groundwork for supporting additional file formats beyond CSV, improving maintainability and extensibility.
Closes #1445