Skip to content

Commit

Permalink
Merge v1.1.0 - Dart 3.3.0
Browse files Browse the repository at this point in the history
 - sdk: '>=3.3.0 <4.0.0'

 - intl: ^0.19.0
 - collection: ^1.18.0
 - data_serializer: ^1.1.0

 - lints: ^3.0.0
 - test: ^1.25.2
 - coverage: ^1.7.2
  • Loading branch information
gmpassos committed Feb 15, 2024
2 parents 3d5dc3c + e405fe3 commit 5e8492d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 1.1.0

- sdk: '>=3.3.0 <4.0.0'

- intl: ^0.19.0
- collection: ^1.18.0
- data_serializer: ^1.1.0

- lints: ^3.0.0
- test: ^1.25.2
- coverage: ^1.7.2

## 1.0.26

- Fix:
Expand Down
23 changes: 11 additions & 12 deletions lib/src/statistics_bayesnet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ValidationError implements Exception {
}

/// An interface for objects that can be validated.
abstract class Validatable {
mixin Validatable {
/// Validates the instance. Returns the invalid [Object] or `null` when valid.
Object? validate();

Expand All @@ -39,7 +39,7 @@ abstract class Validatable {
}
}

abstract class Freezeable {
mixin Freezeable {
void checkNotFrozen() {
if (isFrozen) {
throw ValidationError("$runtimeType already frozen!");
Expand Down Expand Up @@ -517,7 +517,7 @@ extension BayesValueSignalExtension on BayesValueSignal {
}

/// A value in a [BayesianNetwork].
class BayesValue extends Validatable implements Comparable<BayesValue> {
class BayesValue with Validatable implements Comparable<BayesValue> {
/// Name of the value.
final String name;

Expand Down Expand Up @@ -655,7 +655,7 @@ class BayesEvent implements Comparable<BayesEvent> {
String toJson() => '${node.name}=${value.name}';
}

abstract class BayesNode extends Validatable with Freezeable {
abstract class BayesNode with Validatable, Freezeable {
/// The network of this element.
final BayesianNetwork network;

Expand Down Expand Up @@ -2217,7 +2217,7 @@ abstract class BayesAnalyser {

/// A [BayesianNetwork] analyser using the "Variable Elimination" method.
class BayesAnalyserVariableElimination extends BayesAnalyser {
BayesAnalyserVariableElimination(BayesianNetwork network) : super(network);
BayesAnalyserVariableElimination(super.network);

@override
Answer infer(String targetVariable, String selectedVariables,
Expand Down Expand Up @@ -3032,12 +3032,11 @@ class ObservedEventProbabilities {
class ObservedDependencyEvent extends ObservedEvent {
final List<String> _dependentVariables;

ObservedDependencyEvent._(
Iterable<String> dependentVariables, Iterable values,
{required NetworkCache? networkCache})
ObservedDependencyEvent._(Iterable<String> dependentVariables, super.values,
{required super.networkCache})
: _dependentVariables =
_resolveDependentVariables(dependentVariables, networkCache),
super._(values, networkCache: networkCache) {
super._() {
_check();
}

Expand All @@ -3049,11 +3048,11 @@ class ObservedDependencyEvent extends ObservedEvent {
}

ObservedDependencyEvent.withValues(
Iterable<String> dependentVariables, Iterable<ObservedEventValue> values,
{required NetworkCache? networkCache})
Iterable<String> dependentVariables, super.values,
{required super.networkCache})
: _dependentVariables =
_resolveDependentVariables(dependentVariables, networkCache),
super.withValues(values, networkCache: networkCache) {
super.withValues() {
_check();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/statistics_benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ BenchmarkResult<R> benchmark<R>(String name, int loops, BenchMarkFunction<R> f,
class BenchmarkResult<R> extends Chronometer {
late R _result;

BenchmarkResult(String name) : super(name);
BenchmarkResult(super.name);

R get result => _result;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/statistics_tools_csv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension SeriesMapExtension<E> on Map<String, List<E>?> {
e ??= nullValue;
e ??= (nullValue = _toDefault())!;

var v = valueNormalizer(e);
var v = valueNormalizer(e as E);

line.write(separator);
line.write(v);
Expand Down
16 changes: 8 additions & 8 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: statistics
description: Statistics package for easy and efficient data manipulation with built-in Bayesian Network (Bayes Net), many mathematical functions and tools.
version: 1.0.26
version: 1.1.0
homepage: https://github.com/gmpassos/statistics

environment:
sdk: '>=2.14.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'

dependencies:
intl: ^0.18.1
collection: ^1.17.0
data_serializer: ^1.0.7
intl: ^0.19.0
collection: ^1.18.0
data_serializer: ^1.1.0

dev_dependencies:
lints: ^2.0.1
test: ^1.24.0
lints: ^3.0.0
test: ^1.25.2
dependency_validator: ^3.2.3
coverage: ^1.6.3
coverage: ^1.7.2

#dependency_overrides:
# data_serializer:
Expand Down

0 comments on commit 5e8492d

Please sign in to comment.