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

Corrections to Refactor course #68

Open
Scottan opened this issue Mar 19, 2024 · 0 comments
Open

Corrections to Refactor course #68

Scottan opened this issue Mar 19, 2024 · 0 comments

Comments

@Scottan
Copy link

Scottan commented Mar 19, 2024

Instructions

Thanks for piloting the lesson! ❤️

Please let us know about your plan and dates for the pilot workshop.

If you want to provide us feedback after your pilot, you can use this issue to provide more details, e.g. on the following topics:

  • Sources of Confusion

In the first exercise "Writing Tests Before Refactoring", there is essentially a refactoring that occurs before the actual exercise by changing the function to output data instead of making the figure. It is also not clear which "data" is being referred to here.

I would recommend adding some code-along which makes the following changes:

Change the lines in compute_data.py

    graph_data = {
        'daily standard deviation': daily_standard_deviation
    }

    views.visualize(graph_data)

to

    return daily_standard_deviation

The change the lines in catchment-analysis.py from

        compute_data.analyse_data(os.path.dirname(InFiles[0]))

to

        daily_standard_deviation = compute_data.analyse_data(os.path.dirname(InFiles[0]))
        graph_data = {
            'daily standard deviation': daily_standard_deviation
        }

        views.visualize(graph_data)

The get the students to check the figure is the same when you run the function. From there, we can do the exercise to write the test, knowing that the code still works as before and everyone will be on the same page.

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

1 participant