Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 35 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,56 @@
</div>
<!-- markdownlint-restore -->

This repository collects the [UCL ARC] recommendations for a research software
project in Python. It contains a template for new Python packages and a
[website] documenting our recommendations. We've turned on
[discussions](https://github.com/UCL-ARC/python-tooling/discussions) for this
repo, and we welcome questions there or in the `#helpme` channel on the
[UCL research programming hub Slack](https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub).
This repository collects our recommendations for a research software project in Python.
Copy link
Member Author

Choose a reason for hiding this comment

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

I got rid of [UCL ARC] because our name is already in the title up on line 4, and in the repo header in GitHub's UI.

We have a [website] if you need some advice, and a template if you're starting from scratch.
Copy link
Member

Choose a reason for hiding this comment

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

This is vague, advice for what? And starting what from stratch?

Copy link
Member Author

Choose a reason for hiding this comment

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

advice for what?

Python tooling?

And starting what from stratch?

a research software project in Python. (the subject of the preceding sentence, pretty sure that's legal)

Copy link
Member Author

@samcunliffe samcunliffe Oct 8, 2025

Choose a reason for hiding this comment

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

This repository collects our recommendations for a research software project in Python. # Unchanged
We have a [website] if you need some advice for what tools to use, and a template if you're starting a project from scratch.

This feels redundant (to me) but does improve the three remaining readability scores slightly. Is that OK?


🍪 Our template is a [cookiecutter] template which automatically creates new
Python packages with our recommended tooling set up and ready to go.
🍪 Our template uses [cookiecutter] to set up a new package with our preferred tools ready to go.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
🍪 Our template uses [cookiecutter] to set up a new package with our preferred tools ready to go.
🍪 Our template uses the [cookiecutter] tool to set up a new package with our preferred tools ready to go.


> [!NOTE]
> If you're making a package within a community that has an existing
> package template (e.g., [`SciKit-Surgery`](https://github.com/SciKit-Surgery/PythonTemplate)),
> we recommend using their template instead of this one.
> If you're making a package in a research community that already has a template, use theirs instead!
Copy link
Member

Choose a reason for hiding this comment

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

I think it's worth keeping an example here of a community that uses a specific/different template.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a deliberate change.

The parentheses and abbreviation (e.g.) decrease readability. And I wasn't too enthusiastic about the specific example.


## Using our Python package template
## How to use our template

Some quick instructions for using our template are below.
We also have a longer [tutorial](./tutorial.md) that has been presented in workshops for researchers at UCL.
If you're comfortable with the command line, here are some quick start steps.
Copy link
Member

Choose a reason for hiding this comment

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

What if you're not comfortable with using the command line?

Suggested change
If you're comfortable with the command line, here are some quick start steps.
Here are some quick start steps. We assume you're already familiar with using the command line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Lol. Good point.

Copy link
Member Author

@samcunliffe samcunliffe Oct 8, 2025

Choose a reason for hiding this comment

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

Your suggestion reduces readability (although I agree that it's good). If we drop the second sentence, the scires are much better:

Here are some quick start steps.

That works, right?

We also have a more detailed [tutorial](./tutorial.md) that has been presented in workshops for researchers at UCL.

If you have [uv] installed, you can use our template with the following command:
If you have [uv] installed, run:

```sh
uvx cookiecutter gh:ucl-arc/python-tooling --checkout latest
```

If you don't want to use uv you can [install cookiecutter] using pip, and run the above command without the leading `uvx`.
If you don't want to use uv you can [install cookiecutter], then run without `uvx`:

When [cookiecutter] runs, it will ask you a series of questions to configure your project.
Type the answer or hit return without typing anything to use the default option (shown in parenthesis).
At the end, it will print some more follow-up information in the terminal for things like creating a remote repository and making a website for your package.
```sh
cookiecutter gh:ucl-arc/python-tooling --checkout latest
```

[cookiecutter] will ask you questions to set up your project.
Type your answer, or hit return without typing anything to use the defaults.

When finished, it prints some information to the terminal.
These are tips for next steps like creating a repository and making a website for your package.

It will have created a directory for your project:

```sh
ls -ltr | tail -n1 # Show the last directory that was created
Copy link
Member

Choose a reason for hiding this comment

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

I find the number of non-exapanded flags in this command a bit overwhelming (but appreciate it's a hangover from before this PR, so doesn't need to be improved here)

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like:

ls -lt --reverse | tail --lines=1

(-l and -t don't have expansions)

Is that better?

```

It will have created a directory for your project.
You can see the structure with the `tree` command.
In our example we've called our project `example-research-software-project`:

```sh
ls -ltr | tail -n1 # Shows the last directory that was created
tree example-research-software-project
```

To work on your project, initialise a `git` repository and _install_ your new package editable mode.
To start working on your project:

- change directory to your project directory,
- initialise a `git` repository,
- and _install_ your new package editable mode.
Comment on lines +54 to +56
Copy link
Member

Choose a reason for hiding this comment

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

Should this be an ordered (numbered) list, since it has to be done in the specific listed order?

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
- change directory to your project directory,
- initialise a `git` repository,
- and _install_ your new package editable mode.
1. change directory to your project directory,
2. initialise a `git` repository,
3. and _install_ your new package editable mode.


You probably want to do this in a [virtual environment](./docs/pages/virtual.md).
The comments show how to do this in [uv] with `uv venv`:

Expand All @@ -58,16 +66,19 @@ git init
uv sync
```

Note that `uv>=0.6.7` is required to use the `--group` option.
## Need help?

You can ask questions in [discussions] or in the `#helpme` channel on UCL's [Research Programming Hub Slack].

<!-- links here -->

<!-- prettier-ignore-start -->
[website]: https://github-pages.arc.ucl.ac.uk/python-tooling
[UCL ARC]: https://ucl.ac.uk/arc
[cookiecutter]: https://cookiecutter.readthedocs.io/en/stable
[install cookiecutter]: https://cookiecutter.readthedocs.io/en/stable/README.html#installation
[uv]: https://docs.astral.sh/uv
[discussions]: https://github.com/UCL-ARC/python-tooling/discussions
[Research Programming Hub Slack]: https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub
<!-- prettier-ignore-end -->

## Contributors
Expand Down