Skip to content

Commit

Permalink
changes to enable uploads to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvalal committed Sep 8, 2024
1 parent ccf6933 commit 8bd0532
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/*
*.db
**/__pycache__/**
*.egg-info/
Expand Down Expand Up @@ -34,4 +35,4 @@
*build
debug.py
pyvenv.cfg
intro.ipynb
intro.ipynb
12 changes: 9 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ See examples in `notebooks/introduction.ipynb`.
<img src="https://static.independent.co.uk/s3fs-public/thumbnails/image/2016/02/14/12/duck-rabbit.png" width="350">
</p>

install (preferably in a `venv`) with
- install

```
pip install duckreg
```

- dev install (preferably in a `venv`) with
```
(uv) pip install git+https://github.com/apoorvalal/duckreg.git
```
Expand All @@ -28,7 +34,7 @@ $$
3. `DuckDoubleDemeaning`: Double demeaning regression, which compresses the data to y averages by all values of $w$ after demeaning. This also eliminates unit and time FEs

$$
y \sim (W\_{it} - \bar{w}\_{i, .} - \bar{w}\_{., t} + \bar{w}\_{., .})
y \sim (W\_{it} - \bar{w}\_{i, .} - \bar{w}\_{., t} + \bar{w}\_{., .})
$$

4. `DuckMundlakEventStudy`: Two-way mundlak with dynamic treatment effects. This incorporates treatment-cohort FEs ($\psi\_i$), time-period FEs ($\gamma\_t$) and dynamic treatment effects $\tau\_k$ given by cohort X time interactions.
Expand All @@ -37,7 +43,7 @@ $$
y \sim \psi\_i + \gamma\_t + \sum\_{k=1}^{T} \tau\_{k} D\_i 1(t = k)
$$

All the above regressions are run in compressed fashion with `duckdb`.
All the above regressions are run in compressed fashion with `duckdb`.

---
references:
Expand Down
35 changes: 30 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
from setuptools import setup, find_packages
import os

here = os.path.abspath(os.path.dirname(__file__))

# Function to read the contents of the requirements.txt file
def read_requirements():
with open("requirements.txt", "r") as req:
return req.read().splitlines()
try:
with open(os.path.join(here, "requirements.txt"), "r") as req:
return req.read().splitlines()
except FileNotFoundError:
return []

def read_long_description():
try:
with open(os.path.join(here, "README.md"), "r", encoding="utf-8") as fh:
return fh.read()
except FileNotFoundError:
return ""

setup(
name="duckreg",
version="0.1",
version="0.1.1", # Use semantic versioning
packages=find_packages(),
install_requires=read_requirements(),
# Additional metadata about your package
author="Apoorva Lal",
author_email="[email protected]",
description="A package for Regression in compressed representation powered by DuckDB",
long_description=read_long_description(),
long_description_content_type="text/markdown",
license="MIT",
keywords="statistics, econometrics, sufficient statistics, bootstrap",
url="https://github.com/apoorvalal/duckreg",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires='>=3.7',
include_package_data=True,
package_data={
'duckreg': ['*.py'],
},
)

0 comments on commit 8bd0532

Please sign in to comment.