lunum | Numeric arrays for the Lua programming language
kandi X-RAY | lunum Summary
kandi X-RAY | lunum Summary
Lunum ('lua' + 'number') is a numeric extension for the Lua programming language. Its goals are to provide flexible and robust facilities for the manipulation of multi-dimensional numeric arrays, using a syntax and style that feels native to Lua, but also guessable to Numpy users. All of the hard work is done in C, making it prefectly acceptable for use in scientific software development. Consistent with the Lua philosophy, Lunum is easy to embed in C applications. This means that C applications may readily embed the Lua interpereter along with the Lunum API, rather than relying on building shared modules as in Python. This has important consequences, especially for distributed memory parallel computing where the embedding application may be using MPI. Thus far, there is no way of (simply) accomplishing this with Python and Numpy. At this time, Lunum does not offer a linear algebra or FFT package. When these things are implemented, they will be built optionally so as not to add unnecessary bulk or build dependencies to the code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lunum
lunum Key Features
lunum Examples and Code Snippets
Community Discussions
Trending Discussions on lunum
QUESTION
I have a DataStream that consists of events with a property that represents a batch of produced elements. That property, let's call it 'batchNumber', is constant in every event I ingest from the same production batch. I receive multiple events per batch.
I want to analyze machine performance within a batch when the 'batchNumber' changes. My approach is to use a global stream and partition it using the 'batchNumber' as a key. I would expect that this partitions the global stream into windows in which there is every event with that 'batchNumber'. Then I define a trigger, which should fire when the 'batchNumber' changes. Then I can analyze the aggregated data in a ProcessWindowFunction.
My problems are:
- The trigger isn't always firing when the prodnr changes
- Even if it does fire, there is only one element being aggregated. I'm expecting close to 200.
This is the code I'm using.
...ANSWER
Answered 2018-Dec-12 at 20:42Are you sure you want to key the stream by event.lunum? That makes sense if you are expecting roughly 200 events for each distinct value of lunum. But if you only have one event per batch for each value of lunum, that would explain the behavior you are seeing.
Also, are you sure your events are being processed in order? If the batches are being interleaved somewhere in your processing pipeline by race conditions between parallel processes, that might also help explain what you are seeing.
Furthermore, you should be clearing the state in the clear method of the Trigger. And you will need to implement an Evictor to that removes elements from the window after it is processed.
This part of the window API is quite complex. I think this particular application would be much more straightforwardly implemented as a RichFlatMap that gathers items in a ListState until the batch number changes (which you'd keep in ValueState).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lunum
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page