Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant improvements and refactoring across multiple files to enhance the configuration management, data processing, and logging functionalities. The most important changes include refactoring the
ConfigurationManager
class, updating the geoJSON files, and improving the data aggregation and storage process.Configuration Management:
config/configuration_manager.py
: Refactored theConfigurationManager
class to simplify the configuration loading and data path setup. Removed the singleton pattern and added methodsload_config
andconfigure_data_paths
for better modularity.GeoJSON Updates:
data/geojson/FirstFloor.geojson
: Updated room IDs to be integers and added new sensor features with coordinates. [1] [2] [3]data/geojson/SecondFloor.geojson
: Addediot_device_id
placeholders and new sensor features with coordinates. [1] [2] [3] [4]Data Aggregation and Storage:
src/analysis/analyzer.py
: Enhanced data aggregation by addingaggregate_single_dataframe
andaggregate_by_minute_window
functions. Introducedstore_geojson_to_db
andstore_single_geojson_to_db
for saving aggregated data to MongoDB. Improved logging throughout the analysis process.Logging Improvements:
main.py
: Improved logging setup and refactored the main execution flow into modular functions for better readability and error handling.src/database/db_config.py
: Added logging for MongoDB connection attempts and errors.Type Annotations and Code Cleanup:
src/analysis/analysis_preprocessor.py
: Added type annotations to therun_preprocess
function and refactored it for clarity.src/analysis/spark_data_reader.py
: Added type annotations and refactored methods for better readability and error handling.