Skip to content

feat(sda): add first templates and creators - #64

Open
ohrenschmaus wants to merge 5 commits into
mainfrom
chk/sda
Open

feat(sda): add first templates and creators#64
ohrenschmaus wants to merge 5 commits into
mainfrom
chk/sda

Conversation

@ohrenschmaus

Copy link
Copy Markdown
Collaborator
  • fix typo in TargetsEventPreprocessor
  • add two sda-templates
  • add create_design to sda.py
  • add src/c_compile/sda.py
  • add generate_c_files-tests

- fix typo in TargetsEventPreprocessor
- add two sda-templates
- add create_design to sda.py
- add src/c_compile/sda.py
- add generate_c_files-tests
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
2278 2235 98% 0% 🟢

New Files

File Coverage Status
elasticai/creator_plugins/eventdetection/src/c_compile/preprocessor.py 100% 🟢
elasticai/creator_plugins/sda/src/c_compile/sda.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
elasticai/preprocessor/eventdetection/preprocessors.py 100% 🟢
elasticai/preprocessor/sda/sda.py 97% 🟢
TOTAL 99% 🟢

updated for commit: 0a3fa47 by action🐍

@ohrenschmaus

Copy link
Copy Markdown
Collaborator Author

Der linting-error ist komisch. Als ich die init.py-Datei angepasst hatte -> wie vorgeschlagen, wurde geschrieben, dass ich es so schreiben soll, wie es vorher war.

- add elasticai/creator_plugins/eventdetection/c/preprocessing_abs_template.h
- add elasticai/creator_plugins/eventdetection/c/preprocessing_neo_template.h
- add elasticai/creator_plugins/eventdetection/c/preprocessing_normal_template.h
- add elasticai/creator_plugins/eventdetection/src/c_compile/preprocessor.py
- update elasticai/preprocessor/eventdetection/preprocessors.py
- update elasticai/preprocessor/eventdetection/preprocessors_test.py
@ohrenschmaus

Copy link
Copy Markdown
Collaborator Author

I started in the wrong place. Here are the correct templates and builders in eventdetection/preprocessors.py

#include <stdint.h>
#include <stdlib.h>

#ifndef DEF_NEW_SDA_ABSOLUTE_CONST_IMPL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name: That's not really SDA. It is more like the event-preprocessing input

bool calc_sda_abs_const_ ## id(input_type data, input_type *out) { \
static const input_type thr = (input_type)(threshold); \
*out = (input_type)abs(data); \
return (input_type)abs(data) >= thr; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is here the comparison? This should be done later with the EventProcessor/Detector

)


def build_sda_normal_const(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming

bool calc_neo_ ## id(input_type data, input_type *out) { \
static input_type taps[3] = {0}; \
static int8_t count = 0; \
if (count < 3) { \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stimmt die Logik mit dem count?

#include <stdbool.h>
#include <stdint.h>

#ifndef DEF_NEW_SDA_NORMAL_CONST_IMPL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants