Coder Social home page Coder Social logo

gen_report.py about energyutils HOT 6 OPEN

pjmm1 avatar pjmm1 commented on July 18, 2024
gen_report.py

from energyutils.

Comments (6)

dresdner353 avatar dresdner353 commented on July 18, 2024

can you highlight any specific fields you are trying to remove?

The entire data aggregation processing is a pretty involved to convert data from hours to days, weeks, months etc and a lot of those fields are required to make things work in terms of that aggregation.

That said, to provide a means of removing fields, I'd have to look into adding a filter option of sorts where you invoke the report generator and give it a list of fields you do not want in the resulting sheets. That would have knock-on effect on the graphs also, causing some to vanish if the related fields are not present in the sheet data.

The Excel format has a concept of hiding columns and its likely I can leverage that in the generation.

from energyutils.

pjmm1 avatar pjmm1 commented on July 18, 2024

Several of the fields like dates and times are duplicates.
Would it be possible to list the Colom's you do not want to display would that be easier.
see attached
Capture

from energyutils.

pjmm1 avatar pjmm1 commented on July 18, 2024

If it was also possable to change the width of the calms this would save space

from energyutils.

dresdner353 avatar dresdner353 commented on July 18, 2024

Those date/time fields are there instead for data pivots. You can use them to apply filters and show all data for selected years, months or weeks by using those fields as filter references. It allows for fast filtering of data when you're trying to reduce the data set.

I will look into adding an option to list columns for hiding. This should result in the desired columns being hidden when the file is opened. You can still use the menus to show the hidden columns after the fact.

I'll play around with it later tonight and ping back to this post if I manage to get something working.

from energyutils.

dresdner353 avatar dresdner353 commented on July 18, 2024

This turned out to be a pretty easy tweak. So do a git pull to update the code or re-download the zip file.

In the batch file to generate the report, you can now add a new option --hide_columns with a space separated list of fields to hide. The names used in this list are the lowercase internal keys for the fields and not necessarily the same as the title names shown.

Example here.. hiding year, month and week fields..

%PYTHON% %GEN_REPORT_SCRIPT% ^
--idir %SHELLY_DATA% ^
--file shelly_report_ev.xlsx ^
--reports %REPORTS% ^
--hide_columns year month week ^
--tariff_rate Day:0.4320 Night:0.2086 Boost:0.1225 ^
--tariff_interval 08-23:Day 23-08:Night 02-04:Boost ^
--annual_standing_charge 303 ^
--fit_rate 0.21

The full list can be determined by running the script with the --help option or checking the usage document at.. https://github.com/dresdner353/energyutils/blob/main/GEN_REPORT.md

That full list of field codes is..
datetime
ts
year
month
week
day
weekday
hour
hours
tariff_name
tariff_rate
standing_rate
standing_cost
import
import_cost
solar
battery_solar_charge
battery_grid_charge
battery_charge
battery_discharge
battery_storage
battery_capacity
solar_consumed
solar_consumed_percent
solar_credit
export_rate
export
export_percent
export_credit
consumed
rel_import
savings
savings_percent
bill_amount

from energyutils.

pjmm1 avatar pjmm1 commented on July 18, 2024

Many Thanks I will have a look at this tomorrow and let you know how I get on
Regards

from energyutils.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.