Skip to content

Commit

Permalink
Fix remaining bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo3zehn committed Sep 26, 2023
1 parent 0bb0928 commit 1fd8a80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vs/
.venv/
artifacts/
BenchmarkDotNet.Artifacts

Expand Down
12 changes: 9 additions & 3 deletions tests/Nexus.Sources.Remote.Tests/dotnet/remote.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Globalization;
using System.Buffers;
using System.Globalization;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
using Nexus.DataModel;
Expand Down Expand Up @@ -265,8 +266,13 @@ void GenerateData(ReadRequest request, ReadOnlySpan<double> dataFromNexus)

foreach (var request in requests)
{
var dataFromNexus = await readData("/need/more/data", begin, end, cancellationToken);
GenerateData(request, dataFromNexus.Span);
var length = (int)((end - begin).Ticks / request.CatalogItem.Representation.SamplePeriod.Ticks);

using var memoryOwner = MemoryPool<double>.Shared.Rent(length);
var buffer = memoryOwner.Memory.Slice(0, length);

await readData("/need/more/data/1_s", begin, end, buffer, cancellationToken);
GenerateData(request, buffer.Span);
}
}
}
2 changes: 1 addition & 1 deletion tests/Nexus.Sources.Remote.Tests/python/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async def _read_and_modify_nexus_data(
report_progress: Callable[[float], None]):

for request in requests:
data_from_nexus = await read_data("/need/more/data", begin, end)
data_from_nexus = await read_data("/need/more/data/1_s", begin, end)
double_data = request.data.cast("d")

for i in range(0, len(double_data)):
Expand Down

0 comments on commit 1fd8a80

Please sign in to comment.