• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tonegas / nnodely / 16502811447

24 Jul 2025 04:44PM UTC coverage: 97.767% (+0.1%) from 97.651%
16502811447

push

github

web-flow
New version 1.5.0

This pull request introduces version 1.5.0 of **nnodely**, featuring several updates:
1. Improved clarity of documentation and examples.
2. Support for managing multi-dataset features is now available.
3. DataFrames can now be used to create datasets.
4. Datasets can now be resampled.
5. Random data training has been fixed for both classic and recurrent training.
6. The `state` variable has been removed.
7. It is now possible to add or remove a connection or a closed loop.
8. Partial models can now be exported.
9. The `train` function and the result analysis have been separated.
10. A new function, `trainAndAnalyse`, is now available.
11. The report now works across all network types.
12. The training function code has been reorganized.

2901 of 2967 new or added lines in 53 files covered. (97.78%)

16 existing lines in 6 files now uncovered.

12652 of 12941 relevant lines covered (97.77%)

0.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/nnodely/support/mathutils.py
1
import torch
1✔
2

3
def argmax_max(iterable):
1✔
NEW
4
    return max(enumerate(iterable), key=lambda x: x[1])
×
5

6
def argmin_min(iterable):
1✔
NEW
7
    return min(enumerate(iterable), key=lambda x: x[1])
×
8

9
def argmax_dict(iterable: dict):
1✔
10
    return max(iterable.items(), key=lambda x: x[1])
1✔
11

12
def argmin_dict(iterable: dict):
1✔
13
    return min(iterable.items(), key=lambda x: x[1])
1✔
14

15
# Linear interpolation function, operating on batches of input data and returning batches of output data
16
def linear_interp(x, x_data, y_data):
1✔
17
    # Inputs:
18
    # x: query point, a tensor of shape torch.Size([N, 1, 1])
19
    # x_data: map of x values, sorted in ascending order, a tensor of shape torch.Size([Q, 1])
20
    # y_data: map of y values, a tensor of shape torch.Size([Q, 1])
21
    # Output:
22
    # y: interpolated value at x, a tensor of shape torch.Size([N, 1, 1])
23

24
    # Saturate x to the range of x_data
25
    x = torch.min(torch.max(x, x_data[0]), x_data[-1])
1✔
26

27
    # Find the index of the closest value in x_data
28
    idx = torch.argmin(torch.abs(x_data[:-1] - x), dim=1)
1✔
29

30
    # Linear interpolation
31
    y = y_data[idx] + (y_data[idx + 1] - y_data[idx]) / (x_data[idx + 1] - x_data[idx]) * (x - x_data[idx])
1✔
32
    return y
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc