Giter Site home page Giter Site logo

Comments (2)

bt- avatar bt- commented on July 30, 2024

@jforbess, this may not be the easiest solution, but you can manually edit the translation dictionary attribute (CapData.trans) to change the list of column names assigned to each category key or to add new category keys. The __set_trans() method also sets the CapData.trans_keys attribute and calls CapData.set_plot_attributes, so you may might run into issues related to those attributes not matching your adjustments to CapData.trans. Running CapData__set_trans() after your manual adjustments to CapData.trans may fix those issues.

The other option, which should be more reliable, is to make adjustments to the category dictionaries used to generate the CapData.trans keys and assign columns to them. These are capdata.type_defs, capdata.sub_type_defs, and capdata.irr_sensor_defs. These are ordered dictionaries and can be modified so you get a more useful translation dictionary. If you have repeated search strings in the lists across different categories, you will get unexpected results.

For example, the first two categories in the default sub_type_defs are

sub_type_defs = collections.OrderedDict([
                 ('ghi', [['sun2', 'global horizontal', 'ghi', 'global',
                           'GlobHor']]),
                 ('poa', [['sun', 'plane of array', 'poa', 'GlobInc']]),

If you add 'poa_global' to the list paired with 'poa', the column with that string in it will still be assigned to the 'ghi' category because __series_type() will attempt to assign the 'ghi' category first and it will find 'global' within 'poa_global'.

#18 and #20 are also related to this issue. The idea in #18 is to add some helper functions that could be passed to the pandas dataframe rename method. I am thinking that would help with this issue quite a bit.

from pvcaptest.

bt- avatar bt- commented on July 30, 2024

Closing, after v0.11 refactor. As of v0.11 you can pass a path to a file (json, yaml, or xlsx) explicitly defining the column grouping or a function to group to the group_columns attribute of the load_data function, which is now available from captest.load_data or io.load_data.

An easy workflow to define an explicit column grouping in an excel file is to run load_data twice, first with column_groups_template set to True, which will save out an excel file of sorted (doesn't always sort perfectly) column names. Then you can add whatever column group ids you want, and re-run load_data passing that excel file to group_columns.

from pvcaptest.

Related Issues (20)

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.