<commit_before>import 'coordinate.dart';
import 'location.dart';

class StayPoint extends Coordinate {
    LocationDegrees latitude;
    LocationDegrees longitude;

    DateTime arrival;
    DateTime departure;
    List<Location> locationsInvolved;

    StayPoint({this.latitude,
                  this.longitude,
                  this.arrival,
                  this.departure,
                  this.locationsInvolved})
        : super(latitude: latitude, longitude: longitude);

    StayPoint.fromLocations({this.locationsInvolved}) {
        double sumLatitude = 0.0;
        double sumLongitude = 0.0;

        for (Location location in locationsInvolved) {
            sumLatitude += location.latitude.degrees;
            sumLongitude += location.longitude.degrees;
        }

        this.latitude = new LocationDegrees(degrees: sumLatitude);
        this.longitude = new LocationDegrees(degrees: sumLongitude);
        this.arrival = locationsInvolved.first.timestamp;
        this.departure = locationsInvolved.last.timestamp;
        this.locationsInvolved = locationsInvolved;
    }


}<commit_msg>Fix issue with StayPoint class inheritance<commit_after>import 'coordinate.dart';
import 'location.dart';

class StayPoint extends Coordinate {
    DateTime arrival;
    DateTime departure;
    List<Location> locationsInvolved;

    StayPoint({latitude, longitude,
                  this.arrival,
                  this.departure,
                  this.locationsInvolved})
        : super(latitude: latitude, longitude: longitude);

    StayPoint.fromLocations({this.locationsInvolved})
        : this.arrival = locationsInvolved.first.timestamp,
          this.departure = locationsInvolved.last.timestamp,
          super(latitude: sumLatitude(locationsInvolved), longitude: sumLongitude(locationsInvolved));

    static LocationDegrees sumLatitude(List<Location> locations) {
        return new LocationDegrees(degrees: locations.fold(0.0, (value, element) => value + element.latitude.degrees));
    }

    static LocationDegrees sumLongitude(List<Location> locations) {
        return new LocationDegrees(degrees: locations.fold(0.0, (value, element) => value + element.longitude.degrees));
    }
}
{'fraction_non_alphanumeric': 0.09123757904245709, 'fraction_numerical': 0.0036133694670280035, 'mean_word_length': 2.990990990990991, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4431081', 'n_tokens_mistral': 644, 'n_tokens_neox': 576, 'n_words': 118}