• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DaveFoss / DAVE_data / 10488714694

21 Aug 2024 11:09AM UTC coverage: 80.894% (-4.8%) from 85.65%
10488714694

push

github

uvchik
Add core classes

41 of 47 branches covered (87.23%)

Branch coverage included in aggregate %.

8 of 23 new or added lines in 1 file covered. (34.78%)

158 of 199 relevant lines covered (79.4%)

3.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

48.28
/src/dave_data/core.py
1
import datetime
5✔
2

3
import pandas as pd
5✔
4

5

6
class MetaData:
5✔
7
    """
8
    Meta Data Class for DAVE_data.
9

10
    Parameters
11
    ----------
12
    source_license
13
    source_date
14

15

16
    Attributes
17
    ----------
18
    license : str
19
    organisation : str
20
    source_date : str
21
    fetch_date : datetime.date
22
    source meta : dict
23
    """
24

25
    def __init__(self, source_license, source_date, organisation=None):
5✔
NEW
26
        self.license = source_license
×
NEW
27
        self.source_date = self._convert_date(source_date)
×
NEW
28
        self.fetch_date = datetime.datetime.now()
×
NEW
29
        self.source_url = None
×
NEW
30
        self.organisation = None
×
NEW
31
        self.source_meta = None
×
32

33
    def _convert_date(self, value):
5✔
NEW
34
        return ""
×
35

36

37
class Data:
5✔
38
    """
39
    Attributes
40
    ----------
41
    name
42
    """
43

44
    def __init__(
5✔
45
        self,
46
        name,
47
        description = None,
48
        data=None,
49
        meta=None,
50
        polygon=None,
51
        tags=None,
52
    ):
53
        """
54

55
        Parameters
56
        ----------
57
        data : geopandas.geoDataFrame
58
            Data table with the original data.
59
        organ
60
        """
NEW
61
        self.name = name
×
NEW
62
        self.description = description
×
NEW
63
        self.data = data  # geopandas.geoDataFrame
×
NEW
64
        self.meta = meta  # MetaData object
×
NEW
65
        self.polygon = polygon  # Searching polygon
×
NEW
66
        self.tags = tags  # list
×
67

68
    def store(self):
5✔
NEW
69
        pass
×
70

71
    def restore(self):
5✔
NEW
72
        pass
×
73

74

75
def compute(args):
5✔
76
    return max(args, key=len)
5✔
77

78

79
def get_data(datatype):
5✔
80
    """
81

82
    Parameters
83
    ----------
84
    datatype :str
85
        The category of your data.
86

87
    Returns
88
    -------
89
    pandas.Series
90

91
    Examples
92
    --------
93
    >>> get_data("building")
94
    Here is your building data.
95
    0    1
96
    1    2
97
    2    3
98
    3    4
99
    dtype: int64
100
    """
101
    print(f"Here is your {datatype} data.")
5✔
102
    return pd.Series([1, 2, 3, 4])
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc