Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
126 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[tool.pylint.pep8] | ||
'max-line-length' = 120 | ||
|
||
[tool.pylint.'MESSAGES CONTROL'] | ||
disable = [ | ||
"logging-fstring-interpolation", | ||
"missing-module-docstring" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions
18
tests/integration/pybaseball/analysis/projections/marcels/test_marcels_batting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from pybaseball.analysis.projections.marcels import MarcelProjectionsBatting | ||
from pandas import DataFrame | ||
import pytest | ||
|
||
|
||
class TestMarcelBatting: | ||
def test_batting_projections_season(self) -> None: | ||
md = MarcelProjectionsBatting() | ||
md.projections(2020) | ||
|
||
@pytest.mark.parametrize( | ||
"season, expected", [(2020, 36), (2019, 38), (2018, 41), (2017, 34), (2004, 42)] | ||
) | ||
def test_batting_metric_projections(self, season: int, expected: int) -> None: | ||
|
||
md = MarcelProjectionsBatting() | ||
proj = md.metric_projection("HR", season) | ||
assert round(proj.HR.max()) == expected |
19 changes: 19 additions & 0 deletions
19
tests/integration/pybaseball/analysis/projections/marcels/test_marcels_pitching.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from pybaseball.analysis.projections.marcels import MarcelProjectionsPitching | ||
from pandas import DataFrame | ||
import pytest | ||
|
||
|
||
class TestMarcelPitching: | ||
def test_pitching_projections_season(self) -> None: | ||
md = MarcelProjectionsPitching() | ||
md.projections(2020) | ||
|
||
@pytest.mark.parametrize( | ||
"season, expected", | ||
[(2020, 242), (2019, 235), (2018, 229), (2017, 224), (2004, 207)], | ||
) | ||
def test_pitching_metric_projections(self, season: int, expected: int) -> None: | ||
|
||
md = MarcelProjectionsPitching() | ||
proj = md.metric_projection("SO", season) | ||
assert round(proj.SO.max()) == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters