Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
9
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
fabc15fe
Commit
fabc15fe
authored
5 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
Update
parent
cfc5e92e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CONTRIBUTING.md
+53
-4
53 additions, 4 deletions
CONTRIBUTING.md
with
53 additions
and
4 deletions
CONTRIBUTING.md
+
53
−
4
View file @
fabc15fe
# Coding conventions
# Adding new functions/tests
## Interface
-
All user exposed quality checks and processing algorithms need to implement the following interface:
```
python
der
yourTestFunction
(
data
:
pandas
.
DataFrame
,
field
:
str
,
flagger
:
saqc
.
flagger
.
BaseFlagger
,
*
args
:
Any
,
**
kwargs
:
Any
)
->
(
pd
.
DataFrame
,
saqc
.
flagger
.
BaseFlagger
)
```
## Argument Descriptions
| Name | Description |
| ---- | ----------- |
|
`data`
| The actual dataset |
|
`field`
| The field/column within
`data`
, the function is checking/processing |
|
`flagger`
| A instance of a flagger, responsible for the translation of test results into quality attributes |
|
`args`
| Any other arguments needed to parametrize the function |
|
`kwargs`
| Any other keyword arguments needed tp parametrize the function |
## Integrate into SaQC
In order make your function available to the system it needs to be registered. We provide the decorator
[
`register`
](
saqc/functions/register.py
)
in the module
`saqc.functions.register`
, to integrate your
test functions into SaQC and expose them via a name of your choice. A complete, yet useless example might
look like that:
```
python
@register
(
"
myFunc
"
)
def
yourTestFunction
(
data
,
field
,
flagger
,
*
args
,
**
kwargs
):
return
data
,
flagger
```
## Example
The function
[
`flagRange`
](
saqc/funcs/functions.py
)
provides a simple, yet complete implementation of the
entire test function contribution process. You might want to look into this implementation before you start.
# Adding a new flagger
TODO
# Testing
SaQC comes with an extensive test suite based on
[
pytest
](
https://docs.pytest.org/en/latest/
)
. In order to
run all tests use:
```
sh
python
-m
pytest .
```
# Coding conventions
## Naming
## Naming
### Code
We follow the follwing naming conventions
-
Classes: CamelCase
-
Classes: CamelCase
-
Functions: camelCase
-
Functions: camelCase
-
Variables/Arguments: snake_case
-
Variables/Arguments: snake_case
### Test Functions
-
testnames: testModule_testName
## Formatting
## Formatting
We use (black)[https://black.readthedocs.io/en/stable/]
We use (black)[https://black.readthedocs.io/en/stable/]
## Imports
## Imports
Only absolute imports are accepted
Only absolute imports are accepted
## Testnames in configuration file
-
testnames: theModule_testName
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment