File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2+ """Functions to retrieve USAFacts data."""
23import numpy as np
34import pandas as pd
45
56
67def pull_usafacts_data (base_url : str , metric : str , pop_df : pd .DataFrame ) -> pd .DataFrame :
7- """Pulls the latest USA Facts data, and conforms it into a dataset
8+ """Pull the latest USA Facts data, and conforms it into a dataset.
89
910 The output dataset has:
1011
Original file line number Diff line number Diff line change 6767
6868
6969def run_module ():
70-
70+ """Run module for processing USAFacts data."""
7171 params = read_params ()
7272 export_start_date = params ["export_start_date" ]
7373 if export_start_date == "latest" :
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2+ """Smoothing functions."""
23import numpy as np
34
45def identity (x ):
5- ''' Trivial "smoother" that does no smoothing.
6+ """ Trivial "smoother" that does no smoothing.
67
78 Parameters
89 ----------
@@ -13,11 +14,11 @@ def identity(x):
1314 -------
1415 np.ndarray:
1516 Same as x
16- '''
17+ """
1718 return x
1819
1920def kday_moving_average (x , k ):
20- ''' Compute k-day moving average on x.
21+ """ Compute k-day moving average on x.
2122
2223 Parameters
2324 ----------
@@ -28,7 +29,7 @@ def kday_moving_average(x, k):
2829 -------
2930 np.ndarray:
3031 k-day moving average. The first k-1 entries are np.nan.
31- '''
32+ """
3233 if not isinstance (k , int ):
3334 raise ValueError ('k must be int.' )
3435 # temp = np.append(np.zeros(k - 1), x)
You can’t perform that action at this time.
0 commit comments