Skip to content
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

Add mypy static type checker #96

Merged
merged 45 commits into from
Nov 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
039595d
chore: setup mypy
samuelrince Nov 22, 2024
cd6f4c5
refactor: check models is not none to init repository
samuelrince Nov 22, 2024
06a899b
refactor: make electricity mix default to WOR
samuelrince Nov 22, 2024
d0f28e5
refactor: remove incompatible type assignment for mistral
samuelrince Nov 22, 2024
4f6de6e
refactor: typing of class attributes for DAG
samuelrince Nov 22, 2024
edb9c4b
refactor: implement __radd__ for RangeValue
samuelrince Nov 22, 2024
0a2fe85
refactor: change comparison argument for impact model
samuelrince Nov 22, 2024
12da5a6
refactor: typing of internal results when computing llm impacts
samuelrince Nov 22, 2024
73a4eb2
refactor: accurate typing of add method for impacts
samuelrince Nov 22, 2024
a359f3d
fix: import issues of undefined objects or models
samuelrince Nov 22, 2024
a9ee4de
refactor: fix typing for model parameters in dag function
samuelrince Nov 22, 2024
991f02d
refactor: cannot use RangeValue as a min value
samuelrince Nov 22, 2024
f9565be
refactor: ignore wrapt is not typed
samuelrince Nov 22, 2024
2e0e003
refactor: prefer using official typing for Steam and AsyncStream
samuelrince Nov 22, 2024
481fbdc
refactor: remove try-catch on import error.
samuelrince Nov 22, 2024
db2f461
refactor: remove optional on electricity zone
samuelrince Nov 22, 2024
2caf422
refactor: use check on parameters instead of arch type
samuelrince Nov 22, 2024
e794e77
refactor: remove irrelevant fix
samuelrince Nov 22, 2024
9e753c6
refactor: cast type and add exception when computing multiple dags
samuelrince Nov 23, 2024
9a5e206
style: format function parameters
samuelrince Nov 23, 2024
1d4fed8
refactor: change imports for mistral v0
samuelrince Nov 23, 2024
8c39ee3
chore: run pre-commit
samuelrince Nov 23, 2024
bd53bf5
chore: configure mypy to ignore docs and tests
samuelrince Nov 23, 2024
c36d4a8
refactor: change imports for mistral v1
samuelrince Nov 23, 2024
799cdc7
refactor: rollback loading of Mistral instrumentor and add mypy ignor…
samuelrince Nov 23, 2024
7e31987
style: reorder imports
samuelrince Nov 23, 2024
816cbe7
refactor: change imports for anthropic
samuelrince Nov 23, 2024
506edc3
refactor: make impacts optional
samuelrince Nov 23, 2024
c6d1cc3
refactor: model_name is not optional
samuelrince Nov 23, 2024
ae10292
refactor: fix types with message streams
samuelrince Nov 23, 2024
c3218fe
refactor: change imports for google
samuelrince Nov 23, 2024
af94f8f
refactor: typing issue with generators
samuelrince Nov 23, 2024
964512e
refactor: change imports for cohere
samuelrince Nov 23, 2024
8c4efc3
refactor: make impacts optional
samuelrince Nov 23, 2024
d7edb74
refactor: change imports for litellm
samuelrince Nov 23, 2024
f6a78e6
refactor: typing issue with generators
samuelrince Nov 23, 2024
a88e916
refactor: change imports for huggingface hub
samuelrince Nov 23, 2024
85478ae
chore: run pre-commit
samuelrince Nov 23, 2024
9a1941f
tests: fix google
samuelrince Nov 23, 2024
7c1bacc
refactor: add py.typed file
samuelrince Nov 23, 2024
f14a894
fix: typo in exception
samuelrince Nov 23, 2024
ada6250
fix: use object for other type (similar to comparison)
samuelrince Nov 23, 2024
f83d487
Merge branch 'main' into refactor/mypy
samuelrince Nov 29, 2024
f2fa689
chore: poetry lock
samuelrince Nov 29, 2024
f2347d1
chore: setup mypy
samuelrince Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove optional on electricity zone
samuelrince committed Nov 22, 2024
commit db2f461758742949d4d375cc41ddf14e08476eb1
2 changes: 1 addition & 1 deletion ecologits/tracers/utils.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ def llm_impacts(
model_name: str,
output_token_count: int,
request_latency: float,
electricity_mix_zone: Optional[str] = "WOR",
electricity_mix_zone: str = "WOR",
) -> Optional[Impacts]:
"""
High-level function to compute the impacts of an LLM generation request.