Skip to content

Commit d38e01c

Browse files
authored
[1206] Experimentation for extra data readers (#1207)
* initial implementation * changes * toml
1 parent 46f1c51 commit d38e01c

File tree

9 files changed

+721
-497
lines changed

9 files changed

+721
-497
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
[project]
2+
name = "weathergen-readers-extra"
3+
version = "0.1.0"
4+
description = "The WeatherGenerator Machine Learning Earth System Model"
5+
readme = "../../README.md"
6+
requires-python = ">=3.12,<3.13"
7+
# TODO: incomplete: it also implicitly depends on the main project for the base classes
8+
# There is currently a circular dependency readers-extra => root => readers-extra
9+
# It needs to be broken by moving the base class of the readers code to its own package.
10+
dependencies = [
11+
"xarray",
12+
"zarr",
13+
"weathergen-common",
14+
]
15+
16+
[dependency-groups]
17+
dev = [
18+
"pytest~=8.3.5",
19+
"pytest-mock>=3.14.1",
20+
"ruff==0.9.7",
21+
"pyrefly==0.36.0",
22+
]
23+
24+
25+
[tool.pyrefly]
26+
project-includes = ["src/"]
27+
project-excludes = [
28+
]
29+
30+
[tool.pyrefly.errors]
31+
bad-argument-type = false
32+
unsupported-operation = false
33+
missing-attribute = false
34+
no-matching-overload = false
35+
bad-context-manager = false
36+
37+
# To do:
38+
bad-assignment = false
39+
bad-return = false
40+
index-error = false
41+
not-iterable = false
42+
not-callable = false
43+
44+
45+
46+
47+
# The linting configuration
48+
[tool.ruff]
49+
50+
# Wide rows
51+
line-length = 100
52+
53+
[tool.ruff.lint]
54+
# All disabled until the code is formatted.
55+
select = [
56+
# pycodestyle
57+
"E",
58+
# Pyflakes
59+
"F",
60+
# pyupgrade
61+
"UP",
62+
# flake8-bugbear
63+
"B",
64+
# flake8-simplify
65+
"SIM",
66+
# isort
67+
"I",
68+
# Banned imports
69+
"TID",
70+
# Naming conventions
71+
"N",
72+
# print
73+
"T201"
74+
]
75+
76+
# These rules are sensible and should be enabled at a later stage.
77+
ignore = [
78+
# "B006",
79+
"B011",
80+
"UP008",
81+
"SIM117",
82+
"SIM118",
83+
"SIM102",
84+
"SIM401",
85+
# To ignore, not relevant for us
86+
"SIM108", # in case additional norm layer supports are added in future
87+
"N817", # we use heavy acronyms, e.g., allowing 'import LongModuleName as LMN' (LMN is accepted)
88+
"E731", # overly restrictive and less readable code
89+
"N812", # prevents us following the convention for importing torch.nn.functional as F
90+
]
91+
92+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
93+
"numpy.ndarray".msg = "Do not use 'ndarray' to describe a numpy array type, it is a function. Use numpy.typing.NDArray or numpy.typing.NDArray[np.float32] for example"
94+
95+
[tool.ruff.format]
96+
# Use Unix `\n` line endings for all files
97+
line-ending = "lf"
98+
99+
100+
101+
[build-system]
102+
requires = ["hatchling"]
103+
build-backend = "hatchling.build"
104+
105+
[tool.hatch.build.targets.wheel]
106+
packages = ["src/weathergen"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""
2+
readers-extra package.
3+
4+
Contains additional data readers for the WeatherGenerator project.
5+
6+
This code is not as stable and tested as the main readers.
7+
"""

0 commit comments

Comments
 (0)