Skip to content

Commit cd28769

Browse files
Ready for initial release: bigfixes, more strict linter
1 parent 80b19c2 commit cd28769

File tree

11 files changed

+30
-23
lines changed

11 files changed

+30
-23
lines changed

docs/tss/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The neural radar development kit ships with a small statistical module (`nrdk.ts
4444
```
4545
where `rho_t` is the `t`-lag autocorrelation. The sum of autocorrelations is empirically estimated from the performance metrics, where the sum is calculated up to `N / 2` or the first negative autocorrelation, whichever is first.
4646
47-
For details about how we calculate this, see [`effective_sample_size`][tss.stats.effective_sample_size].
47+
For details about how we calculate this, see [`effective_sample_size`][nrdk.tss.stats.effective_sample_size].
4848
4949
??? question "Why cut off when `rho_t` is negative?"
5050
@@ -62,7 +62,7 @@ The neural radar development kit ships with a small statistical module (`nrdk.ts
6262
6363
## General Usage
6464
65-
In addition to using the [low level API][tss.stats], we provide a [CLI](#cli) and a [high level API][tss] which can be used to index results and evaluations, then load the evaluations and calculate statistics.
65+
In addition to using the [low level API][nrdk.tss.stats], we provide a [CLI](#cli) and a [high level API][nrdk.tss] which can be used to index results and evaluations, then load the evaluations and calculate statistics.
6666
6767
### File Format
6868
@@ -160,7 +160,7 @@ The file path to each evaluation, relative to some base path, should contain inf
160160
161161
## High Level API
162162
163-
**Index evaluations**: using [`index`][tss.index], provide a base path where the evaluations are stored, and a regex pattern for finding evaluation files and extracting their `experiment` and `trace` names.
163+
**Index evaluations**: using [`index`][nrdk.tss.index], provide a base path where the evaluations are stored, and a regex pattern for finding evaluation files and extracting their `experiment` and `trace` names.
164164
165165
```python
166166
import tss
@@ -178,7 +178,7 @@ index = tss.index_results(path, pattern)
178178
a directory with 20k total files on a SMB share). You may want to
179179
cache the index or save them to disk somewhere!
180180

181-
**Compute Statistics**: we provide a all-inclusive [`dataframe_from_index`][tss.dataframe_from_index] function which returns a dataframe containing summary statistics for the specified index, given a key of interest and baseline method.
181+
**Compute Statistics**: we provide a all-inclusive [`dataframe_from_index`][nrdk.tss.dataframe_from_index] function which returns a dataframe containing summary statistics for the specified index, given a key of interest and baseline method.
182182

183183
```python
184184
experiments = ["small/p10", "small/p20", "small/p50", "small/base"]

grt/config/model/decoder/lidar2d.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ occ2d:
1414
d_model: ${globals.d_model}
1515
num_layers: ${globals.dec_layers}
1616
shape: [1, 1, 1024, 256]
17-
pos_scale: [1.0, 1.0, 1.0, 1.0]
18-
global_scale: 16.0
17+
scale: [1.0, 1.0, 1.0, 1.0]
18+
w_min: 0.2
1919
patch: [1, 1, 16, 16]
2020
out_dim: 0

grt/config/model/decoder/lidar3d.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ occ3d:
1414
d_model: ${globals.d_model}
1515
num_layers: 4
1616
shape: [1, 64, 128, 64]
17-
pos_scale: [1.0, 1.0, 1.0, 1.0]
18-
global_scale: 16.0
17+
scale: [1.0, 1.0, 1.0, 1.0]
18+
w_min: 0.2
1919
patch: [1, 8, 8, 8]
2020
out_dim: 0

grt/config/model/decoder/semseg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ semseg:
1414
d_model: ${globals.d_model}
1515
num_layers: 4
1616
shape: [1, 160, 160, 1]
17-
pos_scale: [1.0, 1.0, 0.666, 1.0]
18-
global_scale: 16.0
17+
scale: [1.0, 1.0, 0.666, 1.0]
18+
w_min: 0.2
1919
patch: [1, 5, 5, 1]
2020
out_dim: 8

grt/config/model/tokenizer/grt.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ d_model: ${globals.d_model}
33
patch: [1, 2, 2, 8, 4] # (time, doppler, elevation, azimuth, range)
44
squeeze: [2, 3] # elevation + azimuth
55
n_channels: 3
6-
scale: [1.0, 1.0, 1.0, 1.0, 1.0]
6+
scale: [1.0, 1.0, 1.0]
77
w_min: 0.2
88
positions: nd

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "nrdk"
7-
version = "0.0.0"
7+
version = "0.1.0"
88
authors = [
99
{ name="Tianshu Huang", email="tianshu2@andrew.cmu.edu" },
1010
]
@@ -79,13 +79,16 @@ indent-width = 4
7979

8080
[tool.ruff.lint]
8181
select = [
82-
"W", "N", "I", "D", "NPY"
82+
"E", "F", "W", "N", "I", "D", "NPY"
8383
]
8484
ignore = [
8585
"D102", # Inheriting docstrings is allowed
8686
"D107", # Initializer goes in the class docstring
8787
"D401", # "Imperative mood" NLP doesn't always make sense
8888
"D413", # No blank lines after section is preferred by mkdocstrings
89+
"F722", # Jaxtyping annotations confuse ruff
90+
"F821",
91+
"N806", # We do math, so capitalization should be allowed
8992

9093
# Must pick one...
9194
"D213", # Pick 'multi-line-summary-first-line'.

src/nrdk/config/config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ def expand(path: str | None = None, **nested: Nested) -> list[str]:
2323
"""
2424
def _expand(nested: Nested, base: str | None = None):
2525

26-
if base is not None:
27-
_join = lambda p: os.path.join(base, p)
28-
else:
29-
_join = lambda p: p
26+
def _join(p: str) -> str:
27+
if base is not None:
28+
return os.path.join(base, p)
29+
else:
30+
return p
3031

3132
if isinstance(nested, Sequence):
3233
return [_join(item) for item in nested]

src/nrdk/modules/position.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def forward(
109109
"""
110110
if positions is None:
111111
positions = [
112-
torch.linspace(-1.0, 1.0, steps=n, device=x.device)
112+
torch.linspace(-1.0, 1.0, steps=n, device=x.device)[None, :]
113113
for n in x.shape[1:-1]]
114114

115115
if len(positions) != len(x.shape) - 2:

src/nrdk/objectives/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@
7070
7171
!!! info
7272
73-
Each `*Data` type is described using protocols such that any classes which
74-
have the same attributes as the protocol can be used as inputs. For
75-
example, `SemsegData` can be replaced by any object (e.g., a dataclass)
76-
with a `semseg` attribute with dtype `UInt8` and shape `batch t h w`.
73+
Each `*Data` type is described using protocols such that any classes
74+
which have the same attributes as the protocol can be used as inputs.
75+
For example, `SemsegData` can be replaced by any object (e.g., a
76+
dataclass) with a `semseg` attribute with dtype `UInt8` and shape
77+
`batch t h w`.
7778
```python
7879
class SemsegData(Protocol, Generic[TArray]):
7980
semseg: UInt8[TArray, "batch t h w"]

src/nrdk/tss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
"NestedValues",
4545
"dataframe_from_index", "dataframe_from_stats",
4646
"experiments_from_index", "stats_from_experiments",
47-
"index", "stats", "utils"
47+
"index", "stats", "utils", "_cli_main"
4848
]

0 commit comments

Comments
 (0)