Skip to content

Commit 96d2614

Browse files
committed
Initial setup with project-starter
1 parent 0f686b9 commit 96d2614

File tree

11 files changed

+40
-259
lines changed

11 files changed

+40
-259
lines changed

README.md

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,37 @@
1-
# 🚀 PyMC Labs Project Starter
1+
# embeddings_similarity_rating
22

3-
All project code goes off the rails to some extent.
4-
It happens in tiny increments with awkward commits that "solves the problem".
5-
This is entirely forgivable when a codebase is not designed for the new problem and there are time constraints.
6-
It is inevitable.
3+
*Description of the project/package. Make it super easy for people to understand what it does. Add links to external resources like Notion, SOWs, etc.if needed.*
74

8-
However, this chaos can be mitigated with some decent guardrails. This **project template** provides the following:
5+
## Features
6+
7+
*Bullet form list of the most important features of the project/package.*
8+
9+
## Usage
10+
11+
*How to use `embeddings_similarity_rating`. Include examples and code snippets.*
12+
13+
## Project Structure
14+
15+
- `embeddings_similarity_rating/`: Contains the package logic
16+
- `tests/`: Contains tests for the package
17+
- `notebooks/`: Contains exploratory code for testing new features
18+
19+
## Development
20+
21+
This package has been created with [pymc-labs/project-starter](https://github.com/pymc-labs/project-starter). It features:
922

1023
- 📦 **`pixi`** for dependency and environment management.
1124
- 🧹 **`pre-commit`** for formatting, spellcheck, etc. If everyone uses the same standard formatting, then PRs won't have flaky formatting updates that distract from the actual contribution. Reviewing code will be much easier.
1225
- 🏷️ **`beartype`** for runtime type checking. If you know what's going in and out of functions just by reading the code, then it's easier to debug. And if these types are even enforced at runtime with tools like `beartype`, then there's a whole class of bugs that can never enter your code.
1326
- 🧪 **`pytest`** for testing. Meanwhile, with `beartype` handling type checks, tests do not have to assert types, and can merely focus on whether the actual logic works.
1427
- 🔄 **Github Actions** for running the pre-commit checks on each PR, automated testing and dependency management (dependabot).
1528

16-
## Usage
17-
18-
This is a pretty minimal template,
19-
that assumes you have opinions and may want to add/remove stuff too.
20-
To use it as intended (not that you have to),
21-
you should put your main model logic in the `package_name/models.py` file,
22-
adjacent logic split into sibling files,
23-
and then have a script that imports from `package_name` and runs the model,
24-
e.g. in a `scripts/run_model.py` file,
25-
or a notebook somewhere (e.g. in `experimentation`).
26-
2729
### Prerequisites
2830

2931
- Python 3.11 or higher
3032
- [Pixi package manager](https://pixi.sh/latest/)
3133

3234
### Get started
3335

34-
1. On GitHub, click on the green **Use this template** button, and create a new repository.
35-
2. Git clone the new repository to your local machine.
36-
3. Run the setup script `bash setup.sh` and follow the instructions.
37-
38-
<video src="https://github.com/user-attachments/assets/4a1ab682-bdc6-4ac9-90ad-013157c1128d" controls></video>
39-
40-
### Philosophy
41-
42-
There are some example files in this repository.
43-
Have a look at them.
44-
Each of the files in `package_name` has a docstring that explains their role in your package.
45-
You may not want to follow this dogma entirely,
46-
but having split out the code for custom types, main model logic, preprocessing, string parsing, etc.
47-
into separate files is always a good idea.
48-
Mostly, however, you can use these as an example to build upon.
49-
50-
And please contribute. If you add some guardrails that you think would be generally useful, please make a PR.
36+
1. Run `pixi install` to install the dependencies.
37+
2. Run `pixi r test` to run the tests.

package_name/__init__.py renamed to embeddings_similarity_rating/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Top-level module for package_name."""
1+
"""Top-level module for embeddings_similarity_rating."""
22

33
from beartype.claw import beartype_this_package
44

package_name/model.py renamed to embeddings_similarity_rating/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
✨ For usage examples, see /tests/test_model.py.
55
"""
66

7-
from package_name.types import DataClean
7+
from embeddings_similarity_rating.types import DataClean
88

99

1010
def my_model(data: DataClean) -> int:

package_name/types.py renamed to embeddings_similarity_rating/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def my_function(data: dict[str, Union[list[str], str]]):
1313
pass
1414
1515
Prefer:
16-
from package_name.types import DataRaw
16+
from embeddings_similarity_rating.types import DataRaw
1717
def my_function(data: DataRaw):
1818
pass
1919
"""

package_name/utils.py renamed to embeddings_similarity_rating/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
2-
Various utility functions, for use outside of the `package_name` module.
2+
Various utility functions, for use outside of the `embeddings_similarity_rating` module.
33
4-
Do not add any functions here that gets imported into the `package_name` module.
5-
If you need to add logic that gets imported into the `package_name` module,
4+
Do not add any functions here that gets imported into the `embeddings_similarity_rating` module.
5+
If you need to add logic that gets imported into the `embeddings_similarity_rating` module,
66
add it to another file in this directory where it logically belongs. If none such file
77
exists, create a new file in this directory.
88
99
These are are utilities that can be used in runner scripts, tests, etc.
1010
"""
1111

12-
from package_name.types import DataRaw, DataClean
12+
from embeddings_similarity_rating.types import DataRaw, DataClean
1313

1414

1515
def data_cleaner(data: DataRaw) -> DataClean:

pixi.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
authors = [{name = "pymc-labs", email = "[email protected]"}]
33
dependencies = []
44
description = "Add a short description here"
5-
name = "package_name"
5+
name = "embeddings_similarity_rating"
66
requires-python = ">= 3.11"
77
version = "0.1.0"
88

@@ -18,7 +18,7 @@ channels = ["conda-forge"]
1818
platforms = ["osx-arm64", "linux-64", "osx-64"]
1919

2020
[tool.pixi.pypi-dependencies]
21-
package_name = { path = ".", editable = true }
21+
embeddings_similarity_rating = { path = ".", editable = true }
2222

2323
[tool.pixi.dependencies]
2424
pandas = "*"

setup.sh

Lines changed: 0 additions & 169 deletions
This file was deleted.

template_README.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from package_name import my_model
1+
from embeddings_similarity_rating import my_model
22

33
data = {"series": [1, 2, 3, 4, 5], "index": 1}
44

0 commit comments

Comments
 (0)