Skip to content

Commit

Permalink
✅ Ready to clone and code.
Browse files Browse the repository at this point in the history
  • Loading branch information
serviceosaurus[bot] authored and github-actions[bot] committed Sep 27, 2024
1 parent c1dddcb commit 0242461
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/rename_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ echo "Description: $description";
echo "Renaming project..."

original_author="UKPLab"
original_name="ukp_project_template"
original_urlname="ukp-project-template"
original_description="The official template for new Python projects at UKP Lab"
original_name="llm_classifier"
original_urlname="llm_classifier"
original_description="Awesome llm_classifier created by UKPLab"
# Iterate over all files in the repository
git ls-files | while read -r filename; do
# Exclude .github/workflows/rename_project.yml from renaming
Expand Down
1 change: 0 additions & 1 deletion .github/template.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ dmypy.json

# Project files
sketch*
ukp_project_template/sketch*
llm_classifier/sketch*
10 changes: 5 additions & 5 deletions ABOUT_THIS_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ It includes:
- 📃 Documentation structure using [mkdocs](http://www.mkdocs.org)
- 🧪 Testing structure using [pytest](https://docs.pytest.org/en/latest/)
- ✅ Code linting using [pylint](https://pypi.org/project/pylint/)
- 🎯 Entry points to execute your program using `python -m <ukp_project_template>` with basic CLI argument parsing.
- 🔄 Continuous integration using [Github Actions](https://github.com/UKPLab/ukp-project-template/actions) with jobs to check, lint and test your project.
- 🎯 Entry points to execute your program using `python -m <llm_classifier>` with basic CLI argument parsing.
- 🔄 Continuous integration using [Github Actions](https://github.com/UKPLab/llm_classifier/actions) with jobs to check, lint and test your project.

Are there any changes you'd like to request? Feel free to fork and open a pull request!

Expand Down Expand Up @@ -46,7 +46,7 @@ Lets take a look at the structure of this template:
├───docs # Auto-generated documentation
│ index.md # Landing page of docs
├───ukp_project_template # The main python package for the project
├───llm_classifier # The main python package for the project
│ base.py # The base module for the project
│ cli.py # Defines CLI instructions
│ __init__.py # This tells Python that this is a package
Expand All @@ -63,7 +63,7 @@ Lets take a look at the structure of this template:

### Where should I add new stuff ?

You should create new files and subpackages inside ukp_project_template and implement your functionalities there. Remember to add what you write to `__init__.py` so that the imports work smoothly. Take a look at `base.py` and `__init__.py` to understand how it works.
You should create new files and subpackages inside llm_classifier and implement your functionalities there. Remember to add what you write to `__init__.py` so that the imports work smoothly. Take a look at `base.py` and `__init__.py` to understand how it works.

### Why is `requirements.txt` empty ?

Expand All @@ -79,7 +79,7 @@ This file lists all the requirements for testing and development. Use it to sepa

### What is the `.github` folder?

It contains [GitHub Actions](https://docs.github.com/en/actions) that are executed automatically when pushing your code. You can see results for your repository [here](https://github.com/UKPLab/ukp-project-template/actions).
It contains [GitHub Actions](https://docs.github.com/en/actions) that are executed automatically when pushing your code. You can see results for your repository [here](https://github.com/UKPLab/llm_classifier/actions).

### What does the linter workflow do?

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<img src='logo.png' width='200'>
</p>

# ukp_project_template
# llm_classifier
[![Arxiv](https://img.shields.io/badge/Arxiv-YYMM.NNNNN-red?style=flat-square&logo=arxiv&logoColor=white)](https://put-here-your-paper.com)
[![License](https://img.shields.io/github/license/UKPLab/ukp-project-template)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/github/license/UKPLab/llm_classifier)](https://opensource.org/licenses/Apache-2.0)
[![Python Versions](https://img.shields.io/badge/Python-3.9-blue.svg?style=flat&logo=python&logoColor=white)](https://www.python.org/)
[![CI](https://github.com/UKPLab/ukp-project-template/actions/workflows/main.yml/badge.svg)](https://github.com/UKPLab/ukp-project-template/actions/workflows/main.yml)
[![CI](https://github.com/UKPLab/llm_classifier/actions/workflows/main.yml/badge.svg)](https://github.com/UKPLab/llm_classifier/actions/workflows/main.yml)

This is the official template for new Python projects at UKP Lab. It was adapted for the needs of UKP Lab from the excellent [python-project-template](https://github.com/rochacbruno/python-project-template/) by [rochacbruno](https://github.com/rochacbruno).

Expand Down Expand Up @@ -48,7 +48,7 @@ pip install -r requirements-dev.txt # Only needed for development

### Using the classes

To import classes/methods of `ukp_project_template` from inside the package itself you can use relative imports:
To import classes/methods of `llm_classifier` from inside the package itself you can use relative imports:

```py
from .base import BaseClass # Notice how I omit the package name
Expand All @@ -59,19 +59,19 @@ BaseClass().something()
To import classes/methods from outside the package (e.g. when you want to use the package in some other project) you can instead refer to the package name:

```py
from ukp_project_template import BaseClass # Notice how I omit the file name
from ukp_project_template.subpackage import SubPackageClass # Here it's necessary because it's a subpackage
from llm_classifier import BaseClass # Notice how I omit the file name
from llm_classifier.subpackage import SubPackageClass # Here it's necessary because it's a subpackage

BaseClass().something()
SubPackageClass().something()
```

### Using scripts

This is how you can use `ukp_project_template` from command line:
This is how you can use `llm_classifier` from command line:

```bash
$ python -m ukp_project_template
$ python -m llm_classifier
```

### Expected results
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Docs

::: ukp_project_template
::: llm_classifier
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Entry point for ukp_project_template."""
"""Entry point for llm_classifier."""

from .cli import main # pragma: no cover

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions ukp_project_template/cli.py → llm_classifier/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""CLI interface for ukp_project_template project.
"""CLI interface for llm_classifier project.
Be creative! do whatever you want!
Expand All @@ -13,7 +13,7 @@
def main(): # pragma: no cover
"""
The main function executes on commands:
`python -m ukp_project_template` and `$ ukp_project_template `.
`python -m llm_classifier` and `$ llm_classifier `.
This is your program's entry point.
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: ukp_project_template
site_name: llm_classifier
nav:
- Home: index.md

Expand All @@ -8,7 +8,7 @@ theme:
plugins:
- search
- mkdocstrings:
project_name: ukp_project_template
project_name: llm_classifier
handlers:
python:
options:
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Python setup.py for ukp_project_template package"""
"""Python setup.py for llm_classifier package"""
import io
import os
from setuptools import find_packages, setup


def read(*paths, **kwargs):
"""Read the contents of a text file safely.
>>> read("ukp_project_template", "VERSION")
>>> read("llm_classifier", "VERSION")
'0.1.0'
>>> read("README.md")
...
Expand All @@ -30,15 +30,15 @@ def read_requirements(path):


setup(
name="ukp_project_template",
url="https://github.com/UKPLab/ukp-project-template/",
name="llm_classifier",
url="https://github.com/UKPLab/llm_classifier/",
long_description=read("README.md"),
long_description_content_type="text/markdown",
author="author_name",
packages=find_packages(exclude=["tests", ".github"]),
install_requires=read_requirements("requirements.txt"),
entry_points={
"console_scripts": ["ukp_project_template = ukp_project_template.__main__:main"]
"console_scripts": ["llm_classifier = llm_classifier.__main__:main"]
},
extras_require={"test": read_requirements("requirements-dev.txt")},
)
4 changes: 2 additions & 2 deletions tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tests are defined here
from ukp_project_template import BaseClass
from ukp_project_template.subpackage import SubPackageClass
from llm_classifier import BaseClass
from llm_classifier.subpackage import SubPackageClass

def test_template():
assert True
Expand Down

0 comments on commit 0242461

Please sign in to comment.