EOS/tests/testdata/pv_forecast_input_1.json

2 lines
234 KiB
JSON
Raw Normal View History

Add test to PVForecast (#174) * Add documentation to class_pv_forecast.py. Added documentation. Beware mostly generated by ChatGPT. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com> * Add CacheFileStore, datetime and logger utilities. The `CacheFileStore` class is a singleton-based, thread-safe key-value store for managing temporary file objects, allowing the creation, retrieval, and management of cache files. The utility modules offer a flexible logging setup (`get_logger`) and utilities to handle different date-time formats (`to_datetime`, `to_timestamp`) and timezone detection (`to_timezone). - Cache files are automatically valid for the the current date unless specified otherwise. This is to mimic the current behaviour used in several classes. - The logger supports rotating log files to prevent excessive log file size. - The `to_datetime` and `to_timestamp`functions support a wide variety of input types and formats. They provide the time conversion that is e.g. used in PVForecast. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com> * Improve testability of PVForecast Improvements for testing of PVForecast - Use common utility functions to allow for general testing at one spot. - to_datetime - CacheFileStore - Use logging instead of print to easily capture in testing. - Add validation of the json schema for Akkudoktor PV forecast data. - Allow to create an empty PVForecast instance as base instance for testing. - Make process_data() complete for filling a PVForecast instance for testing. - Normalize forecast datetime to timezone of system given in loaded data. - Do not print report but provide report for test checks. - Get rid of cache file path using the CachFileStore to automate cache file usage. - Improved module documentation. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com> * Add test for PVForecast and newly extracted utility modules. - Add test for PVForecast - Add test for CacheFileStore in the new cachefilestore module - Add test for to_datetime, to_timestamp, to_timezone in the new datetimeutil module - Add test for get_logger in the new logutil module Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com> --------- Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com> Co-authored-by: Normann <github@koldrack.com>
2024-11-10 23:49:10 +01:00
{"meta":{"lat":52.52,"lon":13.405,"power":[5000,4800,1400,1600],"azimuth":[-10,-90,-40,5],"tilt":[7,7,60,45],"timezone":"Europe/Berlin","albedo":0.25,"past_days":5,"inverterEfficiency":0.8,"powerInverter":[5000,4800,1400,1600],"cellCoEff":-0.36,"range":false,"horizont":[[{"altitude":20,"azimuthFrom":-180,"azimuthTo":-90},{"altitude":27,"azimuthFrom":-90,"azimuthTo":0},{"altitude":22,"azimuthFrom":0,"azimuthTo":90},{"altitude":20,"azimuthFrom":90,"azimuthTo":180}],[{"altitude":30,"azimuthFrom":-180,"azimuthTo":-90},{"altitude":30,"azimuthFrom":-90,"azimuthTo":0},{"altitude":30,"azimuthFrom":0,"azimuthTo":90},{"altitude":50,"azimuthFrom":90,"azimuthTo":180}],[{"altitude":60,"azimuthFrom":-180,"azimuthTo":-90},{"altitude":30,"azimuthFrom":-90,"azimuthTo":0},{"altitude":0,"azimuthFrom":0,"azimuthTo":90},{"altitude":30,"azimuthFrom":90,"azimuthTo":180}],[{"altitude":45,"azimuthFrom":-180,"azimuthTo":-90},{"altitude":25,"azimuthFrom":-90,"azimuthTo":0},{"altitude":30,"azimuthFrom":0,"azimuthTo":90},{"altitude":60,"azimuthFrom":90,"azimuthTo":180}]],"horizontString":["20,27,22,20","30,30,30,50","60,30,0,30","45,25,30,60"]},"values":[[{"datetime":"2024-10-06T00:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-43.03892891605494,"sunAzimuth":163.14263622624128,"temperature":7,"relativehumidity_2m":88,"windspeed_10m":7.9},{"datetime":"2024-10-06T01:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-44.13778324543035,"sunAzimuth":-176.22585898864278,"temperature":6.5,"relativehumidity_2m":91,"windspeed_10m":6.8},{"datetime":"2024-10-06T02:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-41.87117274960936,"sunAzimuth":-155.9729639229445,"temperature":6,"relativehumidity_2m":91,"windspeed_10m":5.9},{"datetime":"2024-10-06T03:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-36.70531092777589,"sunAzimuth":-137.8059489226708,"temperature":5.5,"relativehumidity_2m":92,"windspeed_10m":5.1},{"datetime":"2024-10-06T04:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-29.46443142893699,"sunAzimuth":-122.16602054266892,"temperature":5.1,"relativehumidity_2m":92,"windspeed_10m":6.2},{"datetime":"2024-10-06T05:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-20.930765133481234,"sunAzimuth":-108.58249513077881,"temperature":4.9,"relativehumidity_2m":93,"windspeed_10m":5.8},{"datetime":"2024-10-06T06:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-11.710347315474053,"sunAzimuth":-96.31140508589108,"temperature":5.1,"relativehumidity_2m":92,"windspeed_10m":6.5},{"datetime":"2024-10-06T07:00:00.000+02:00","dcPower":0,"power":0,"sunTilt":-2.2689443207496223,"sunAzimuth":-84.62890292197706,"temperature":5.3,"relativehumidity_2m":92,"windspeed_10m":7.6},{"datetime":"2024-10-06T08:00:00.000+02:00","dcPower":11.737826509478335,"power":9.390261207582668,"sunTilt":6.991906328571172,"sunAzimuth":-72.87999206290318,"temperature":5.5,"relativehumidity_2m":91,"windspeed_10m":8.4},{"datetime":"2024-10-06T09:00:00.000+02:00","dcPower":242.57051171912266,"power":194.05640937529813,"sunTilt":15.663160391528187,"sunAzimuth":-60.45596163553978,"temperature":6.3,"relativehumidity_2m":90,"windspeed_10m":9.3},{"datetime":"2024-10-06T10:00:00.000+02:00","dcPower":479.53210925713626,"power":383.625687405709,"sunTilt":23.268816289666535,"sunAzimuth":-46.79827360798693,"temperature":8,"relativehumidity_2m":85,"windspeed_10m":11.6},{"datetime":"2024-10-06T11:00:00.000+02:00","dcPower":2020.1663735831366,"power":1616.1330988665095,"sunTilt":29.234287239795027,"sunAzimuth":-31.503805204051176,"temperature":9.5,"relativehumidity_2m":86,"windspeed_10m":15.1},{"datetime":"2024-10-06T12:00:00.000+02:00","dcPower":1840.0674202135267,"power":1472.0539361708215,"sunTilt":32.93002248275174,"sunAzimuth":-14.578212396799534,"temperature":10.8,"relativehumidity_2m":82,"windspeed_10m":16.3},{"datetime":"2024-10-06T13:00:00.000+02:00","dcPower":1958.118125361256,"power":1566.494500289005,"sunTilt":33.84613522696556,"sunAzimuth":3.3037874055175505,"temperature":10.9,"relativehumidity_2m":82,"windspeed_10m":16.9},{"datetime":"2024-10-06T14:00:00.000+02:00","dcPower":1862.34412446005,"