Skip to content

first rework of project setup chapter#106

Merged
chStaiger merged 5 commits into
mainfrom
project-setup
Apr 10, 2026
Merged

first rework of project setup chapter#106
chStaiger merged 5 commits into
mainfrom
project-setup

Conversation

@nehamoopen
Copy link
Copy Markdown
Collaborator

@nehamoopen nehamoopen commented Mar 12, 2026

Hi! I've made a first attempt at updating the Project Setup chapter. There's still some things to be cleaned up, both in the chapter and the slides. I'm happy to get feedback before I get to the second round of edits.

Comment thread book/chapters/project-setup.qmd Outdated

Where:

- _read-only (RO)_: not edited by either code or researcher
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not so sure about that. Data is usually updated, extended or even fully revised (e.g. an experiment that did not go well).
I like the distinction between human-writeable and project-generated. Although I would also rename the latter to "output files" or "generated files" ...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it's more about the principle, in that there are some folders that may only be read-only? It doesn't necessarily have to be the data directory. It can be another one. Or perhaps the raw data directory.

Comment thread book/chapters/project-setup.qmd Outdated

- **Relative paths** specify the location of a file or directory relative to the current working directory (e.g., `./data/file.csv`). If you’ve structured your project as a self-contained directory, the root of that directory should be your working directory. Relative paths are portable and reproducible, provided the working directory remains consistent.

In R, you can further ensure a consistent working directory by using an R Project File (.Rproj), which automatically sets the working directory to the project root.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
In R, you can further ensure a consistent working directory by using an R Project File (.Rproj), which automatically sets the working directory to the project root.
Let's inspect the following example file structure and some best parctices for R, Matlab and python.
```sh
my_project/
├ data/
│ file.csv
└ script.py

Python

Open the folder my_project in your Development environment (IDE), e.g. Jupyter Notebooks or PyCharm (see some suggestions below.). You can address the csv file like this:

import pandas as pd

df = pd.read_csv("data/file.csv")

Since the working directory of your IDE is your project folder, the compiler will find the data automatically.

R

In R you can use RStudio as IDE, simply create File → New Project → New Directory

data <- read.csv("data/file.csv")

Matlab

Similar as in R you can set up a project folder in Matlab and use:

data = readtable("data/file.csv");

In general IDEs help you to make use of relative paths:

Language Beginner IDE Feature
Python Visual Studio Code workspace folder
R RStudio built-in projects
MATLAB MATLAB current folder

Comment thread book/chapters/project-setup.qmd Outdated
Comment on lines 117 to 127
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

Comment thread book/chapters/project-setup.qmd

If you want to retroactively apply a naming convention, you can use your programming language of choice or the command line.

## Absolute vs. Relative Paths
Copy link
Copy Markdown
Member

@chStaiger chStaiger Mar 16, 2026

Choose a reason for hiding this comment

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

I am not sure whether this chapter fits here or better in book/chapters/reusability.qmd

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I revisited the reusability chapter and I think we could keep the stuff about paths here, so people can focus on the concept of functionalizing/modularizing code in that section. But you can let me know if you think otherwise!

Copy link
Copy Markdown
Member

@chStaiger chStaiger left a comment

Choose a reason for hiding this comment

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

Many thanks this looks good.

I gave some inspiration to extend the relative paths section a bit and I think this section can be moved or at least referenced in the resuability section of the book.
I would be fine either way. Doing the deep dive here and mentioning it in the resuability section; or the other way around.

@nehamoopen
Copy link
Copy Markdown
Collaborator Author

@chStaiger, I made some changes and did a quick update of the slides! Could you do a final review? And we can merge after the workshop, don't want to break something 😅

Comment thread book/chapters/project-setup.qmd Outdated
Comment on lines 165 to 167
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The video needs to be removed

:::

## Being reproducible
## Let's Git Started!
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pun intended ;)

Copy link
Copy Markdown
Member

@chStaiger chStaiger left a comment

Choose a reason for hiding this comment

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

I fixed the layout for the slide that only show code blocks.
Thank you for adjusting the contents. Approved by me.

@chStaiger chStaiger merged commit 61dd804 into main Apr 10, 2026
1 check failed
@chStaiger chStaiger deleted the project-setup branch April 10, 2026 08:43
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