Skip to content
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

Add FlascDataFrame for better handling of user data in FLASC #212

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Sep 12, 2024

Add FlascDataFrame

This pull request is taking over from #199 to add a new object called a FlascDataFrame inherits from pandas.DataFrame, but will provide some extra utilities for mapping between different naming conventions and dataframe formats ("long" data, "wide" data, etc). Still a work in progress but nearing readiness so opening draft pull request.

Feature or improvement description

  • Implements a new FlascDataFrame object that inherits from pandas.DataFrame but provides extra utility
  • Implements methods to convert to user formats such as long or wide with alternative channel names
  • Provides methods to convert to a wind-up (https://github.com/resgroup/wind-up) style frame and use import wind-up modules to conduct uplift analysis using those methods
  • Updated documentation and examples

Left to do:

  • Have we brought in enough capabliities, thinking especially of deprecating some of the functions in dataframe_manipulations.py that could better be FlascDataframe members
  • Go through code and look to update type hints and returns where appropriate from pd.Dataframe to and/or FlascDataframe
  • Add test of df_reduce_precision with FlascDataFrame (updated df_reduce_precision for use with FlascDataFrame and it's used in the examples)
  • Add test for FlascDataframe driving energy ratio with polars conversion
  • Test time operations with FlascDataframe
  • Add FlascDataframe to top-level init and chain through code
  • Update examples to use FlascDataframe
  • Add a documention page for FlascDataframe and wind-up
  • Review and merge

Additional notes

misi9170 and others added 3 commits September 4, 2024 17:16
…199)

* Adding at the root level for now; could consider moving to utilities/

* Ruff.

* precommit stuff.

* Add example notebook

* Add wide to long

* Add test

* Update README.md engagement

* Update README.md replacing 'FLORIS' typo

* Feature/add docstrings (#197)

* Update to 15 (#202)

* Update for PyPI installation. (#204)

* Update version number; ignore version.py for ruff.

* Adhere to FLASC formatting rules.

* psuedocode for conversions. Tests for saving dataframe to file.

* Print warning when to_feather used.

* String formatting.

* Add several more tests and n_turbines property.

* Adding TODOs for long/wide conversions.

* Clean up, a few more tests.

* Improved printout.

* ruff format.

---------

Co-authored-by: Paul <[email protected]>
Co-authored-by: christiannvaughn <[email protected]>
@paulf81 paulf81 added the enhancement An improvement of an existing feature label Sep 12, 2024
@paulf81 paulf81 mentioned this pull request Sep 17, 2024
paulf81 and others added 4 commits October 16, 2024 14:12
* Merge recent changes.

* Update functions to use FlascDataFrames; getter and setter for channel_name_map; metadata copying method.

* Smarteole examples now using FlascDataFrame

* Add brief demonstration of switch to user data format; rename 09 notebook for clarity.

* Update artifical data examples.

* Had weird behavior in the getter/setter caused by not providing the true underlying attribute in _metadata.

* formatting.

* Simplify imports of FlascDataFrame throughout.

* Add wind-up to pyproject.toml after setup.py was removed.
@misi9170 misi9170 marked this pull request as ready for review October 17, 2024 20:11
@misi9170 misi9170 merged commit 8456524 into develop Oct 17, 2024
6 checks passed
@misi9170 misi9170 deleted the flasc-dataframe branch October 17, 2024 20:15
@misi9170 misi9170 changed the title Flasc dataframe Add FlascDataFrame for better handling of user data in FLASC Oct 17, 2024
@misi9170 misi9170 mentioned this pull request Oct 17, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants