Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Function evaluation #35

Merged
merged 9 commits into from
Apr 11, 2017
Merged

Function evaluation #35

merged 9 commits into from
Apr 11, 2017

Conversation

pieterbos
Copy link
Member

@pieterbos pieterbos commented Apr 10, 2017

Function evaluation in rules evaluation

  • Function evaluation framework
  • The ability to register custom functions
  • implementation of the default min() and max() functions
  • implementation of the custom value_when_undefined - to allow for score calculation with not all fields present
  • basic tests
  • Implementation of mean and sum, now they throw an UnsupportedOperationException when called

Copy link
Member

@jpleppers jpleppers left a comment

Choose a reason for hiding this comment

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

One possible change to improve readability, otherwise 👍

throw new FunctionCallException("cannot cast " + value.getValue().getClass() + " to a number");
}

public static int checkLength(List<ValueList> arguments) {
Copy link
Member

Choose a reason for hiding this comment

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

Had to look up the usage to understand this function, maybe rename to checkEqualLength ?


@Override
public ValueList evaluate(List<ValueList> arguments) throws FunctionCallException {
throw new UnsupportedOperationException("The function mean has not yet been implemented");
Copy link
Member

Choose a reason for hiding this comment

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

😄

@codecov-io
Copy link

codecov-io commented Apr 11, 2017

Codecov Report

Merging #35 into master will increase coverage by 0.47%.
The diff coverage is 71.14%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #35      +/-   ##
============================================
+ Coverage     62.77%   63.24%   +0.47%     
- Complexity     2273     2315      +42     
============================================
  Files           323      332       +9     
  Lines         12168    12304     +136     
  Branches       1378     1399      +21     
============================================
+ Hits           7638     7782     +144     
+ Misses         3781     3752      -29     
- Partials        749      770      +21
Impacted Files Coverage Δ Complexity Δ
...evaluation/evaluators/BinaryOperatorEvaluator.java 60.28% <ø> (-2.28%) 60 <0> (-7)
...nedap/archie/rules/evaluation/AssertionsFixer.java 62.71% <ø> (ø) 22 <0> (ø) ⬇️
...archie/rules/evaluation/FunctionCallException.java 0% <0%> (ø) 0 <0> (?)
...evaluation/evaluators/ModelReferenceEvaluator.java 59.25% <0%> (-4.75%) 5 <0> (ø)
.../nedap/archie/rules/evaluation/RuleEvaluation.java 96.61% <100%> (+0.05%) 14 <0> (ø) ⬇️
...ation/evaluators/functions/ValueWhenUndefined.java 60.86% <60.86%> (ø) 5 <5> (?)
...ie/rules/evaluation/evaluators/functions/Mean.java 66.66% <66.66%> (ø) 2 <2> (?)
...hie/rules/evaluation/evaluators/functions/Sum.java 66.66% <66.66%> (ø) 2 <2> (?)
...chie/rules/evaluation/evaluators/FunctionUtil.java 71.87% <71.87%> (ø) 12 <12> (?)
...hie/rules/evaluation/evaluators/functions/Max.java 72.72% <72.72%> (ø) 6 <6> (?)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d89bc7...107ad9b. Read the comment docs.

@pieterbos pieterbos merged commit 8adc025 into master Apr 11, 2017
@pieterbos pieterbos deleted the function_evaluation branch April 11, 2017 10:18
pieterbos added a commit that referenced this pull request Aug 21, 2018
Modified ArchetypeValidator to bypass flattening in case of warnings.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants