Skip to content

Commit

Permalink
refactor: fix format task
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexmmaldonado committed Nov 8, 2024
1 parent 1aa47b0 commit c7fcf24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ docs = ["docs"]
vaxstats = { path = ".", editable = true }

[tool.pixi.tasks]
mdlint = { cmd = [
"markdownlint-cli2",
'"**/*.{md,markdown}"',
"--fix",
"--config",
".markdownlint.yaml",
"||",
"true"
]}
isort = { cmd = ["isort", "--settings-path", "pyproject.toml", "./content"] }
black = { cmd = ["black", "--config", "pyproject.toml", "./content"] }
format = { depends-on = ["mdlint", "isort", "black"] }

[tool.pixi.dependencies]
python = ">=3.12.0,<3.13"
Expand All @@ -58,8 +46,8 @@ pip = ">=24.3.1,<25"

[tool.pixi.feature.dev.tasks]
mdlint = { cmd = ["markdownlint-cli2", '"**/*.{md,markdown}"', "--fix", "--config", ".markdownlint.yaml", "||", "true"] }
isort = { cmd = ["isort", "--settings-path", "pyproject.toml", "./content"] }
black = { cmd = ["black", "--config", "pyproject.toml", "./content"] }
isort = { cmd = ["isort", "--settings-path", "pyproject.toml", "./vaxstats", "||", "true"] }
black = { cmd = ["black", "--config", "pyproject.toml", "./vaxstats"] }
format = { depends-on = ["mdlint", "isort", "black"] }
tests = { cmd = [
"pytest",
Expand Down
8 changes: 6 additions & 2 deletions vaxstats/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ def prep_forecast_df(
[pl.concat_str([df.columns[0], df.columns[1]], separator=" ").alias("ds")]
)
logger.debug(
f"Parsing datetimes with date format '{input_date_fmt}' and time format '{input_time_fmt}'"
f"Parsing datetimes with date format '{input_date_fmt}' and time format '{input_time_fmt}'"
)
df = df.with_columns(
[
pl.col("ds")
.str.strptime(pl.Datetime, format=f"{input_date_fmt} {input_time_fmt}", strict=False)
.str.strptime(
pl.Datetime,
format=f"{input_date_fmt} {input_time_fmt}",
strict=False,
)
.alias("parsed_datetime")
]
)
Expand Down

0 comments on commit c7fcf24

Please sign in to comment.