-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a minimal environment with core dependencies #830
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 29 files with indirect coverage changes 🚀 New features to boost your workflow:
|
I adjusted the pyproject toml so that the (pyfixest) PS C:\Users\alexa\Documents\pyfixest> pixi list -x
Package Version Build Size Kind Source
formulaic 1.1.1 371.3 KiB pypi formulaic-1.1.1-py3-none-any.whl
great_tables 0.16.1 6.4 MiB pypi great_tables-0.16.1-py3-none-any.whl
joblib 1.4.2 886.2 KiB pypi joblib-1.4.2-py3-none-any.whl
narwhals 1.29.1 1.5 MiB pypi narwhals-1.29.1-py3-none-any.whl
numba 0.61.0 11.7 MiB pypi numba-0.61.0-cp312-cp312-win_amd64.whl
numpy 2.1.3 40.2 MiB pypi numpy-2.1.3-cp312-cp312-win_amd64.whl
pandas 2.2.3 37.7 MiB pypi pandas-2.2.3-cp312-cp312-win_amd64.whl
pyfixest 0.28.0 pypi (editable)
python 3.12.8 h3f84c4b_1_cpython 15.1 MiB conda python
scipy 1.15.2 115.1 MiB pypi scipy-1.15.2-cp312-cp312-win_amd64.whl
seaborn 0.13.2 1018.2 KiB pypi seaborn-0.13.2-py3-none-any.whl
tabulate 0.9.0 128.4 KiB pypi tabulate-0.9.0-py3-none-any.whl
tqdm 4.67.1 220.5 KiB pypi tqdm-4.67.1-py3-none-any.whl
(pyfixest) PS C:\Users\alexa\Documents\pyfixest> pixi shell --environment minimal
(pyfixest:minimal) PS C:\Users\alexa\Documents\pyfixest> pixi list -x
Environment: minimal
Package Version Build Size Kind Source
formulaic 1.1.1 371.3 KiB pypi formulaic-1.1.1-py3-none-any.whl
narwhals 1.29.1 1.5 MiB pypi narwhals-1.29.1-py3-none-any.whl
numba 0.61.0 11.7 MiB pypi numba-0.61.0-cp312-cp312-win_amd64.whl
numpy 2.1.3 40.2 MiB pypi numpy-2.1.3-cp312-cp312-win_amd64.whl
pandas 2.2.3 37.7 MiB pypi pandas-2.2.3-cp312-cp312-win_amd64.whl
pyfixest 0.28.0 pypi (editable)
python 3.12.8 h3f84c4b_1_cpython 15.1 MiB conda python
scipy 1.15.2 115.1 MiB pypi scipy-1.15.2-cp312-cp312-win_amd64.whl
seaborn 0.13.2 1018.2 KiB pypi seaborn-0.13.2-py3-none-any.whl I guess we should still check with the |
|
||
try: | ||
from tqdm import tqdm | ||
except ImportError: | ||
|
||
def tqdm(iterable, *args, **kwargs): | ||
"Define a dummy tqdm function." | ||
return iterable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being repeated a lot ... why don't we let tqdm be a core dep? It seems very lightweight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with joblib
, actually - it has no other dependencies except for python . More or less the motivation of this PR is to make the package so lightweight that it can easily be installed in closed environments (with no access to pypi / conda). My prior would be that both joblib and tqdm should actually be installed on every system that runs Python, though I'm not 100% sure.
I am more or less gravitating towards having a default / core env that includes joblib, tqdm, GT etc that users install with pip install pyfixest
and then a minimal but still functional env for those who can really only work with numpy, scipy, etc. Would be your suggestion to keep tqdm in the "minimal" dependency set @juanitorduz?
Hi @elchorro , here is a first attempt at creating a minimal environment.
It allows users to access all estimation function and methods (
feols
,fepois
,feglm
etc) and a range of post-processing methods (tidy
,summary
, plotting viaplt
).It drops
joblib
,great_tables
,tqdm
andtabulate
from the main env and moves it into a secondary environmentfull
which will be installable by typingpip install pyfixest[full]
.In the new "core" env
tqdm
is replaced by a dummy functionjoblib
only executed when installedGT
produces anImportError
tabulate
produces anImportError
What still would have to be done:
pip install pyfixest
. I assume that it would be more user friendly to install etable etc by default and require users with other specs to specifically install the "core" env? I would be curious about @dsliwka's and @juanitorduz's thoughts on this?seaborn
an optional dependency? If no, we could replace the seaborn dependency by a matplotlib dependecy (the only piece of code that relies on seaborn is the plotting method for randomization inference which should be an easy fix.narwhals
optional, in which case we'd have to thrown an error wherever it converts nonpd.DataFrame
's for us (happens in maybe 3 scripts).try from tqdm import tqdm
parts).If you have some time to polish this PR, it would be much appreciated @elchorro ! =)