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 Project structure and Writing code sections #59

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

robmoss
Copy link
Owner

@robmoss robmoss commented Sep 27, 2023

I started sketching out content for a project structure section, but this quickly branched out to include a variety of topics that are better described as writing code.

Sources of motivation include:

  • Having some content about choosing a project structure ahead of the next malaria group meeting, when we're going to talk about this topic;
  • Writing down my key arguments for considering code as a primary research output; and
  • Explaining why the way that we approach writing code, and learning to write code, is extremely important.

I want to refer to real examples of public repositories (such as my 2020 COVID-19 forecasts one, which I mention in Project structure / Explain how it all works) and highlight what they do well and what they don't do well.

@github-actions
Copy link

github-actions bot commented Sep 27, 2023

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-08-07 00:05 UTC

@robmoss
Copy link
Owner Author

robmoss commented Sep 27, 2023

... and now it occurs to me that I should probably end the "Writing code" section with a reminder, or an exercise, to seek feedback on code that you're currently writing (i.e., code that isn't finished) ...

@robmoss
Copy link
Owner Author

robmoss commented Oct 18, 2023

Scientific Python provides helpful guides on a number of relevant topics, including some general design principles. Some of the topical guides are very detailed and, perhaps, a bit too much detail for our audience.

@robmoss
Copy link
Owner Author

robmoss commented Oct 18, 2023

We should share this PR with the CoP and ask them to provide suggestions, comments, etc, building on what we covered in yesterday's meeting. We can provide the live preview of the Project structure and Writing code sections.

@robmoss
Copy link
Owner Author

robmoss commented Feb 28, 2024

@EamonConway I've migrated this PR from mdBook to MkDocs

As per my previous comment, we should consider sharing this PR with the CoP and ask them to provide suggestions, comments, etc. It probably covers some things that are relevant to the orientation guide.

I started sketching out content for a project structure section, but
this quickly branched out to include a variety of topics that are better
described as writing code.

These sections include several exercises. One uses my Australian 2020
COVID-19 forecasts repository as an example and asks the reader to think
about how the README.md file could be improved.
@robmoss
Copy link
Owner Author

robmoss commented Apr 11, 2024

I've rebased this so that it applies cleanly on the new site structure (Introduction / Orientation / Topical Guides / Community).

@michaelplanknz
Copy link

Sorry git novice here so not sure if this is the right place to post this!

As a suggestion for the Orientation section (which already looks super useful), it might be useful to have a few examples of code that are small and self-contained and do some simple task. For example, a function that reads in a long-form CSV data set and returns some aggregated values, e.g. number of occurrences of X on each day between Y and Z. This could serve as an exemplar for how to structure good code (comments, good variable naming, no magic numbers, well defined function inputs/outputs, etc.). It could also include an example of a test function, as I think the idea of automated tests may be a new concept for many (me included!). Ideally, keeping the tasks relatively simple will mean that code doesn't need to use too many language-specific features or packages but can illustrate principles in a language-agnostic way.

Again apologies if this is in the wrong place, please feel free to tell me if I should post this somewhere else!

@robmoss
Copy link
Owner Author

robmoss commented Apr 11, 2024

Hi @michaelplanknz that's a great suggestion! Having examples that show rather than tell would be really useful.

I've created a new issue #69 to act as a starting point, because it's not directly related to this pull request (absolutely no drama, and apologies for not having clearer instructions on the orientation guide page itself).

@robmoss
Copy link
Owner Author

robmoss commented Jul 2, 2024

@EamonConway can you please let me know if you're happy for me to merge this?

@robmoss
Copy link
Owner Author

robmoss commented Jul 2, 2024

@EamonConway mind you, I could probably cut down the cake analogy

The previous version was far too long and detailed; the intent is to
make a simple point, rather than tell a long story.
@robmoss
Copy link
Owner Author

robmoss commented Jul 3, 2024

@EamonConway I've revised the cake analogy and added two more specific tips at the end.

@robmoss
Copy link
Owner Author

robmoss commented Jul 3, 2024

Hmm, the Coding Advice page could probably do with a few (very short) code examples too.

@robmoss
Copy link
Owner Author

robmoss commented Aug 7, 2024

@EamonConway I'm going to merge this in advance of our next CoP meeting, as we discussed yesterday. Thanks!

@robmoss robmoss merged commit 7fdde03 into master Aug 7, 2024
2 checks passed
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.

3 participants