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

Refactor - functional programming #275

Open
ethanstrominger opened this issue Nov 12, 2024 · 1 comment
Open

Refactor - functional programming #275

ethanstrominger opened this issue Nov 12, 2024 · 1 comment

Comments

@ethanstrominger
Copy link
Collaborator

ethanstrominger commented Nov 12, 2024

Change

self._calculate_balance_point_and_ua(
            initial_balance_point_sensitivity,
            stdev_pct_max,
            max_stdev_pct_diff,
            next_balance_point_sensitivity,
        )

=>

{   balance_point, stdev_pct
                balance_point_graph } =
             _get_graph (initial_balance_point_sensitivity,
            stdev_pct_max,
            max_stdev_pct_diff,
            next_balance_point_sensitivity,
            bills_winter)
@stemgene
Copy link
Contributor

stemgene commented Feb 5, 2025

We found inside this if statement:

if (
                # the outlier has been removed
                new_stdev_pct - stdev_pct_i
                < max_stdev_pct_diff
            ):  # if it's a small enough change
                # add the outlier back in
                self.winter_processed_energy_bills.append(
                    outlier
                )  # then it's not worth removing it, and we exit
                outlier.eliminated_as_outlier = False
                break  # may want some kind of warning to be raised as well
            else:
                self.uas, avg_ua, stdev_pct = uas_i, avg_ua_i, stdev_pct_i

The values of avg_ua and stdev_pct didn't affect the pytest, even after deleting the else part. Moreover, the self.uas has just been defined but not been used ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants