Skip to content

Commit 4267726

Browse files
committed
add: docs slightly improved
1 parent 366e433 commit 4267726

File tree

6 files changed

+25
-31
lines changed

6 files changed

+25
-31
lines changed

docs/insiders/development.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## Development
1+
# Development
2+
3+
## Build and Publish Package
24

3-
- Generate new pdocs: `.\generate_docs.sh`
45
- Install package locally: `pip install -e .`
56
- Run tests locally with pytest: `pytest ./tests`
67

src/ts_shape/context/value_mapping.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ class ValueMapper(Base):
66
"""
77
A class to map values from specified columns of a DataFrame using a mapping table (CSV or JSON file),
88
inheriting from the Base class.
9-
10-
Attributes:
11-
mapping_table (pd.DataFrame): The table containing the mapping rules.
12-
map_column (str): The column in the DataFrame to be mapped.
13-
mapping_key_column (str): The column in the mapping table that contains keys for mapping.
14-
mapping_value_column (str): The column in the mapping table that contains corresponding values for mapping.
159
"""
1610

1711
def __init__(

src/ts_shape/transform/filter/custom_filter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def filter_custom_conditions(cls, dataframe: pd.DataFrame, conditions: str) -> p
1212
that can be interpreted by pandas' DataFrame.query() method.
1313
1414
Args:
15-
- dataframe (pd.DataFrame): The DataFrame to apply the filter on.
16-
- conditions (str): A string representing the conditions to filter the DataFrame.
15+
dataframe (pd.DataFrame): The DataFrame to apply the filter on.
16+
conditions (str): A string representing the conditions to filter the DataFrame.
1717
The string should be formatted according to pandas query syntax.
1818
1919
Returns:
20-
- pd.DataFrame: A DataFrame containing only the rows that meet the specified conditions.
20+
pd.DataFrame: A DataFrame containing only the rows that meet the specified conditions.
2121
2222
Example:
2323
--------
@@ -26,7 +26,7 @@ def filter_custom_conditions(cls, dataframe: pd.DataFrame, conditions: str) -> p
2626
>>> print(filtered_data)
2727
2828
Note:
29-
- Ensure that the column names and values used in conditions match those in the DataFrame.
30-
- Complex expressions and functions available in pandas query syntax can also be used.
29+
Ensure that the column names and values used in conditions match those in the DataFrame.
30+
Complex expressions and functions available in pandas query syntax can also be used.
3131
"""
3232
return dataframe.query(conditions)

src/ts_shape/transform/filter/datetime_filter.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ def filter_after_date(cls, dataframe: pd.DataFrame, column_name: str = 'systime'
1616
Filters the DataFrame to include only rows after the specified date.
1717
1818
Args:
19-
- date (str): The cutoff date in 'YYYY-MM-DD' format.
19+
date (str): The cutoff date in 'YYYY-MM-DD' format.
2020
2121
Returns:
22-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is after the specified date.
22+
pd.DataFrame: A DataFrame containing rows where the 'systime' is after the specified date.
2323
2424
Example:
2525
--------
@@ -34,10 +34,10 @@ def filter_before_date(cls, dataframe: pd.DataFrame, column_name: str = 'systime
3434
Filters the DataFrame to include only rows before the specified date.
3535
3636
Args:
37-
- date (str): The cutoff date in 'YYYY-MM-DD' format.
37+
date (str): The cutoff date in 'YYYY-MM-DD' format.
3838
3939
Returns:
40-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is before the specified date.
40+
pd.DataFrame: A DataFrame containing rows where the 'systime' is before the specified date.
4141
4242
Example:
4343
--------
@@ -52,11 +52,11 @@ def filter_between_dates(cls, dataframe: pd.DataFrame, column_name: str = 'systi
5252
Filters the DataFrame to include only rows between the specified start and end dates.
5353
5454
Args:
55-
- start_date (str): The start date of the interval in 'YYYY-MM-DD' format.
56-
- end_date (str): The end date of the interval in 'YYYY-MM-DD' format.
55+
start_date (str): The start date of the interval in 'YYYY-MM-DD' format.
56+
end_date (str): The end date of the interval in 'YYYY-MM-DD' format.
5757
5858
Returns:
59-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is between the specified dates.
59+
pd.DataFrame: A DataFrame containing rows where the 'systime' is between the specified dates.
6060
6161
Example:
6262
--------
@@ -72,10 +72,10 @@ def filter_after_datetime(cls, dataframe: pd.DataFrame, column_name: str = 'syst
7272
Filters the DataFrame to include only rows after the specified datetime.
7373
7474
Args:
75-
- datetime (str): The cutoff datetime in 'YYYY-MM-DD HH:MM:SS' format.
75+
datetime (str): The cutoff datetime in 'YYYY-MM-DD HH:MM:SS' format.
7676
7777
Returns:
78-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is after the specified datetime.
78+
pd.DataFrame: A DataFrame containing rows where the 'systime' is after the specified datetime.
7979
8080
Example:
8181
--------
@@ -90,10 +90,10 @@ def filter_before_datetime(cls, dataframe: pd.DataFrame, column_name: str = 'sys
9090
Filters the DataFrame to include only rows before the specified datetime.
9191
9292
Args:
93-
- datetime (str): The cutoff datetime in 'YYYY-MM-DD HH:MM:SS' format.
93+
datetime (str): The cutoff datetime in 'YYYY-MM-DD HH:MM:SS' format.
9494
9595
Returns:
96-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is before the specified datetime.
96+
pd.DataFrame: A DataFrame containing rows where the 'systime' is before the specified datetime.
9797
9898
Example:
9999
--------
@@ -108,11 +108,11 @@ def filter_between_datetimes(cls, dataframe: pd.DataFrame, column_name: str = 's
108108
Filters the DataFrame to include only rows between the specified start and end datetimes.
109109
110110
Args:
111-
- start_datetime (str): The start datetime of the interval in 'YYYY-MM-DD HH:MM:SS' format.
112-
- end_datetime (str): The end datetime of the interval in 'YYYY-MM-DD HH:MM:SS' format.
111+
start_datetime (str): The start datetime of the interval in 'YYYY-MM-DD HH:MM:SS' format.
112+
end_datetime (str): The end datetime of the interval in 'YYYY-MM-DD HH:MM:SS' format.
113113
114114
Returns:
115-
- pd.DataFrame: A DataFrame containing rows where the 'systime' is between the specified datetimes.
115+
pd.DataFrame: A DataFrame containing rows where the 'systime' is between the specified datetimes.
116116
117117
Example:
118118
--------

src/ts_shape/transform/time_functions/timezone_shift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ def calculate_time_difference(cls, dataframe: pd.DataFrame, start_column: str, e
147147
# Calculate the difference in seconds
148148
time_difference = (end_times - start_times).dt.total_seconds()
149149

150-
return time_difference
150+
return time_difference

src/ts_shape/utils/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ def __init__(self, dataframe: pd.DataFrame, column_name: str = 'systime') -> pd.
77
and sorts the DataFrame by the specified column (or the detected time column if applicable).
88
99
Args:
10-
- dataframe (pd.DataFrame): The DataFrame to be processed.
11-
- column_name (str): The column to sort by. Default is 'systime'. If the column is not found
12-
or is not a time column, the class will attempt to detect other time columns.
10+
dataframe (pd.DataFrame): The DataFrame to be processed.
11+
column_name (str): The column to sort by. Default is 'systime'. If the column is not found or is not a time column, the class will attempt to detect other time columns.
1312
"""
1413
self.dataframe = dataframe.copy()
1514

0 commit comments

Comments
 (0)