Skip to content

Commit 12d1c2b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7f9cc5d commit 12d1c2b

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

pyfixest/estimation/estimation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Mapping
2-
from typing import Any, Optional, Union, Sequence
2+
from typing import Any, Optional, Union
33

44
import pandas as pd
55

@@ -503,7 +503,7 @@ def fepois(
503503
fml: str,
504504
data: DataFrameType, # type: ignore
505505
vcov: Optional[Union[VcovTypeOptions, dict[str, str]]] = None,
506-
offset: Union[None, str] = None,
506+
offset: Union[None, str] = None,
507507
ssc: Optional[dict[str, Union[str, bool]]] = None,
508508
fixef_rm: FixedRmOptions = "none",
509509
fixef_tol: float = 1e-08,

pyfixest/estimation/feols_.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ def prepare_model_matrix(self):
379379
self._offset = self._set_offset()
380380
self._N, self._N_rows = self._set_nobs()
381381

382-
383382
def _set_nobs(self) -> tuple[int, int]:
384383
"""
385384
Fetch the number of observations used in fitting the regression model.
@@ -417,7 +416,7 @@ def _set_weights(self) -> np.ndarray:
417416
_weights = np.ones(N)
418417

419418
return _weights.reshape((N, 1))
420-
419+
421420
def _set_offset(self) -> np.ndarray:
422421
"""
423422
Return the offset used in the regression model.
@@ -429,7 +428,6 @@ def _set_offset(self) -> np.ndarray:
429428
If no offset is used, returns an array of zeros
430429
with the same length as the dependent variable array.
431430
"""
432-
433431
N = len(self._Y)
434432

435433
if self._offset_df is not None:

pyfixest/estimation/fepois_.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def prepare_model_matrix(self):
149149
raise ValueError(
150150
"The dependent variable must be a weakly positive integer."
151151
)
152-
152+
153153
# check for separation
154154
na_separation: list[int] = []
155155
if (
@@ -170,7 +170,9 @@ def prepare_model_matrix(self):
170170
self._Y.drop(na_separation, axis=0, inplace=True)
171171
self._X.drop(na_separation, axis=0, inplace=True)
172172
self._fe.drop(na_separation, axis=0, inplace=True)
173-
self._offset = np.delete(self._offset,na_separation,axis=0) # _offset is a numpy array so we use delete instead of drop
173+
self._offset = np.delete(
174+
self._offset, na_separation, axis=0
175+
) # _offset is a numpy array so we use delete instead of drop
174176
self._data.drop(na_separation, axis=0, inplace=True)
175177
self._N = self._Y.shape[0]
176178

@@ -699,4 +701,3 @@ def _fepois_input_checks(drop_singletons: bool, tol: float, maxiter: int):
699701
raise TypeError("maxiter must be integer.")
700702
if maxiter <= 0:
701703
raise AssertionError("maxiter must be greater than 0.")
702-

pyfixest/estimation/model_matrix_fixest_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def model_matrix_fixest(
147147
if offset is not None:
148148
offset_df = mm["offset"]
149149

150-
for df in [Y, X, Z, endogvar, weights_df,offset_df]:
150+
for df in [Y, X, Z, endogvar, weights_df, offset_df]:
151151
if df is not None:
152152
cols_to_convert = df.select_dtypes(exclude=["int64", "float64"]).columns
153153
if cols_to_convert.size > 0:

0 commit comments

Comments
 (0)