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

DaveFoss / DAVE_data / 10689762467

03 Sep 2024 08:00PM UTC coverage: 78.98% (-7.4%) from 86.4%
10689762467

Pull #10

github

uvchik
Rename module to just polygon.py
Pull Request #10: Add basic functions

66 of 90 branches covered (73.33%)

Branch coverage included in aggregate %.

160 of 211 new or added lines in 7 files covered. (75.83%)

2 existing lines in 1 file now uncovered.

321 of 400 relevant lines covered (80.25%)

4.01 hits per line

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

93.33
/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 : str
13
    source_date : datetime.date or None
14

15

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

25
    def __init__(
5✔
26
        self,
27
        source_license,
28
        source_date=None,
29
        organisation=None,
30
        source_url=None,
31
        source_meta=None,
32
    ):
33
        self.license = source_license
5✔
34
        self.source_date = source_date
5✔
35
        self.fetch_date = datetime.datetime.now(tz=datetime.timezone.utc)
5✔
36
        self.source_url = source_url
5✔
37
        self.organisation = organisation
5✔
38
        if source_meta is None:
5✔
39
            source_meta = {}
5✔
40
        self.source_meta = source_meta
5✔
41

42

43
class Data:
5✔
44
    """
45
    Attributes
46
    ----------
47
    name
48
    """
49

50
    def __init__(
5✔
51
        self,
52
        name,
53
        description=None,
54
        data=None,
55
        meta=None,
56
        polygon=None,
57
        tags=None,
58
    ):
59
        """
60

61
        Parameters
62
        ----------
63
        data : geopandas.geoDataFrame
64
            Data table with the original data.
65

66
        """
67
        self.name = name
5✔
68
        self.description = description
5✔
69
        self.data = data  # geopandas.geoDataFrame
5✔
70
        self.meta = meta  # MetaData object
5✔
71
        self.polygon = polygon  # Searching polygon
5✔
72
        self.tags = tags  # list
5✔
73

74
    def store(self):
5✔
UNCOV
75
        pass
×
76

77
    def restore(self):
5✔
UNCOV
78
        pass
×
79

80

81
def compute(args):
5✔
82
    return max(args, key=len)
5✔
83

84

85
def get_data(datatype):
5✔
86
    """
87

88
    Parameters
89
    ----------
90
    datatype :str
91
        The category of your data.
92

93
    Returns
94
    -------
95
    pandas.Series
96

97
    Examples
98
    --------
99
    >>> get_data("building")
100
    Here is your building data.
101
    0    1
102
    1    2
103
    2    3
104
    3    4
105
    dtype: int64
106
    """
107
    print(f"Here is your {datatype} data.")
5✔
108
    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