FAQ / Troubleshooting๏ƒ

๐Ÿงฉ Common issues and how to fix them when working with this project template.


๐Ÿ Import Error: from template_project import plotters๏ƒ

Problem: Python canโ€™t find the template_project module.

๐Ÿ›  Option 2: Add the path manually (in a notebook)๏ƒ

If youโ€™re working in a Jupyter notebook and havenโ€™t installed the package, insert this before importing:

import sys
sys.path.append("/path/to/your/template-project")

Then you can run:

from template_project import plotters

This is useful for testing during development, but installation is preferred.


๐Ÿ’ฅ Pip install error in GitHub Actions๏ƒ

Error message:

ร— Getting requirements to build editable did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> See above for output.

This usually means something is wrong with the local installation process. Try the following locally in a clean environment:

virtualenv venv
source venv/bin/activate && micromamba deactivate
pip install -r requirements.txt
pip install -e .

If this works locally, your GitHub Actions will likely succeed too.

๐Ÿ“ GitHub workflows live in .github/workflows/*.yml


๐Ÿค” Whatโ€™s the difference between template-project and template_project?๏ƒ

  • template-project is the name of the repository โ€” itโ€™s fine to use hyphens in GitHub repo names.

  • template_project is the name of the Python package (i.e., the importable module) โ€” dashes are not allowed in Python package names.

Term

Use For

template-project

GitHub repository name

template_project

Python package (import syntax)

Could they be the same name?๏ƒ

  • โœ… Yes: Both could be template_project

  • ๐Ÿšซ No: Avoid template-project for the Python module

Why this setup?๏ƒ

  • Originally accidental, but it reinforces the distinction between repo and code module.

  • Helps clarify which name to use in each context, especially when editing docs, imports, or packaging configs.


๐Ÿ˜ฌ I accidentally committed to main instead of a branch๏ƒ

It happens! If you havenโ€™t pushed yet:

๐Ÿงผ Option 1: Create a new branch from the current commit๏ƒ

git branch new-feature-branch

Then switch to it:

git checkout new-feature-branch

Youโ€™re now safe to push your changes and create a pull request.

๐Ÿ—‘ Option 2: Move the commit off main (before push)๏ƒ

git branch temp-fix

git reset --hard origin/main  # resets main to the last pushed commit

git checkout temp-fix

Now your main is clean and you can cherry-pick or merge your changes onto a feature branch properly.

โš ๏ธ Only use reset --hard if youโ€™re sure you havenโ€™t pushed yet and donโ€™t need to keep local-only changes.


๐Ÿšจ Continuous Integration (CI) is failing๏ƒ

๐Ÿงช If the failure is in tests:๏ƒ

Run tests locally to reproduce the issue:

pytest

Try running an individual test:

pytest tests/test_tools.py::test_my_function

๐Ÿ“š See: writing_tests.md

๐Ÿ“š If the failure is in documentation:๏ƒ

Try rebuilding the docs locally:

cd docs
make html

Then open _build/html/index.html in a browser.

๐Ÿ“š See: build_docs.md

If your changes involve docstrings or .md files, a local preview will help catch errors before pushing.

๐Ÿ’ก The GitHub Actions logs show exactly which step failed โ€” start there!


๐Ÿงญ How do I check which branch Iโ€™m on?๏ƒ

In the terminal:

git branch

The active branch is marked with an asterisk.

In VSCode:

  • Look at the lower-left corner โ€” your current branch name is shown there.


๐Ÿ”„ I cloned the repo but donโ€™t see the latest updates๏ƒ

Make sure youโ€™re on the main branch and that itโ€™s up to date:

git checkout main
git pull origin main

If you forked the repo, check out gitcollab.md for syncing instructions.


โœ๏ธ I made changes but GitHub doesnโ€™t show them๏ƒ

You need to commit and push your work:

git add .
git commit -m "Describe your changes"
git push origin your-branch-name

๐Ÿ’ก Pushing updates your branch on GitHub. Committing saves changes locally.


๐Ÿ“‹ I opened a pull request โ€” what happens now?๏ƒ

  • Your changes will be reviewed.

  • GitHub Actions (CI) will check that tests and docs pass.

  • You might be asked to tweak something.

  • Once all is approved, your changes will be merged.


๐Ÿ™‹ Still stuck?๏ƒ

Check setup.md, or ask a question by opening an issue at github.com/eleanorfrajka/template-project.

โœ… This FAQ is a living document โ€” feel free to suggest improvements!