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

fixed issue with run live or frozen #119

Merged
merged 4 commits into from
Oct 30, 2024
Merged

Conversation

giuliag92
Copy link
Collaborator

@giuliag92 giuliag92 commented Oct 25, 2024

Summary

Add your summary here - keep it brief, to the point, and in plain English.

Checklists

This pull request meets the following requirements:

  • installable with all dependencies recorded
  • runs without error
  • follows PEP8 and project specific conventions
  • appropriate use of comments, for example no descriptive comments
  • functions documented using Numpy style docstings
  • assumptions and decisions log considered and updated if appropriate
  • unit tests have been updated to cover essential functionality for a reasonable range of inputs and conditions
  • other forms of testing such as end-to-end and user-interface testing have been considered and updated as required
  • tests suite passes (locally as a minimum)
  • peer reviewed with review recorded

If you feel some of these conditions do not apply for this pull request, please
add a comment to explain why.

5,C,5,5
6,E,6,
7,W,7,
target,error,live,frozen,frozen_error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does frozen_error have a numerical type? Does this not relate to the other error in col2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frozen_error contains the deleted adjusted values.

@@ -316,8 +317,10 @@ def run_live_or_frozen(
)

if state == "frozen":

df.loc[df[error_marker].isin(error_values), target] = np.nan
df["frozen_error"] = df.apply(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of lambda function to simplify copying over the value from the target column :)

@@ -104,13 +104,16 @@ def test_run_live_or_frozen(filepath):

df = pd.read_csv(filepath / "test_run_live_or_frozen.csv")

df_in = df.drop(columns=["frozen"])
df_in = df.drop(columns=["frozen", "frozen_error"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing you are using one input data to have the input and correct output which is why its being dropper early in test?

expected_output_frozen = df.copy()

expected_output_frozen.drop(columns=["frozen"], inplace=True)
expected_output_frozen = expected_output_frozen.fillna("")

assert_frame_equal(frozen_output, expected_output_frozen)
assert_frame_equal(live_ouput, df_in)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never noticed this before, but what happens if the first assert fails, but the second passes? or vice versa? Just want to make sure the unit test fails if both or one fail

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked together and it fails if either one fails.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted this, agreed that if one fails the unit test fails. Only appears as one unit test though

@giuliag92 giuliag92 merged commit 51e2db9 into main Oct 30, 2024
5 checks passed
@giuliag92 giuliag92 deleted the 571-frozen-pipeline-option branch October 30, 2024 10:41
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

Successfully merging this pull request may close these issues.

2 participants