Skip to content

Commit

Permalink
Minor formatting and edits to docstrings - wip remove validation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jan 19, 2025
1 parent 264c4cc commit d630543
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ repos:

- id: ruff-format

- repo: https://github.com/numpy/numpydoc
rev: v1.8.0
hooks:
- id: numpydoc-validation
files: ^src/
exclude: ^tests/
# - repo: https://github.com/numpy/numpydoc
# rev: v1.8.0
# hooks:
# - id: numpydoc-validation
# files: ^src/
# exclude: ^tests/
1 change: 1 addition & 0 deletions src/scribe_data/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def print_formatted_data(data: Union[dict, list], data_type: str) -> None:
----------
data : Union[dict, list]
The data to format and print.
data_type : str
The type of data being printed, used to determine formatting style.
"""
Expand Down
22 changes: 22 additions & 0 deletions src/scribe_data/cli/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ def convert_to_json(
----------
language : str
The language of the file to convert.
data_type : Union[str, List[str]]
The data type of the file to convert.
output_type : str
The output format, should be "json".
input_file : str
The input CSV/TSV file path.
output_dir : Path
The output directory path for results.
overwrite : bool
Whether to overwrite existing files.
identifier_case : str
The case format for identifiers. Default is "camel".
Expand Down Expand Up @@ -202,10 +208,13 @@ def convert_to_csv_or_tsv(
----------
language : str
The language of the file to convert.
data_type : Union[str, List[str]]
The data type of the file to convert.
output_type : str
The output format, should be "csv" or "tsv".
input_file : str
The input JSON file path.
Expand Down Expand Up @@ -386,16 +395,22 @@ def convert_to_sqlite(
----------
language : str
The language of the file to convert.
data_type : str
The data type of the file to convert.
output_type : str
The output format, should be "sqlite".
input_file : str, optional
The input file path for the data to be converted.
output_dir : str, optional
The output directory path for results.
overwrite : bool, optional
Whether to overwrite existing files.
identifier_case : str, optional
The case format for identifiers. Default is "camel".
Expand Down Expand Up @@ -451,18 +466,25 @@ def convert_wrapper(
----------
languages : Union[str, List[str]]
The language(s) of the data to convert.
data_types : Union[str, List[str]]
The data type(s) of the data to convert.
output_type : str
The desired output format. Can be 'json', 'csv', 'tsv', or 'sqlite'.
input_files : Union[str, List[str]]
The path(s) to the input file(s).
output_dir : str
The output directory where converted files will be stored.
overwrite : bool, optional
Whether to overwrite existing output files.
identifier_case : str, optional
The case format for identifiers. Default is "camel".
all : bool, optional
Convert all languages and data types.
Expand Down
1 change: 1 addition & 0 deletions src/scribe_data/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def check_wd_dump_exists(target_entity):
-------
str
The URL of the dump file if it exists.
None
If the dump file does not exist.
"""
Expand Down
3 changes: 2 additions & 1 deletion src/scribe_data/load/data_to_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def create_table(data_type, cols):
----------
data_type : str
The name of the table to be created.
cols : list of str
The names of columns for the new table.
"""
# Convert column names to snake_case if requested.
cols = [
Expand All @@ -137,6 +137,7 @@ def table_insert(data_type, keys):
----------
data_type : str
The name of the table to be inserted into.
keys : list of str
The values to be inserted into the table row.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/scribe_data/load/send_dbs_to_scribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Example
--------
-------
python3 src/scribe_data/load/send_dbs_to_scribe.py
.. raw:: html
Expand Down
4 changes: 3 additions & 1 deletion src/scribe_data/unicode/unicode_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
# See: https://getemoji.com/
def get_emojis_to_ignore():
"""
Returns a list of emojis based on relationships that we want to remove from autosuggestions.
Returns a list of emojis based on relationships that we want to remove from autosuggestions.
Returns
-------
str
All emojis that should not be included in emoji suggestions.
"""
return """
🀰 πŸ«ƒ 🀱 πŸ‘©β€πŸΌ πŸ‘¨β€πŸΌ πŸ‘­ πŸ‘¬ πŸ‘« πŸ‘©β€β€οΈβ€πŸ‘© πŸ’‘ πŸ‘¨β€β€οΈβ€πŸ‘¨ πŸ‘©β€β€οΈβ€πŸ‘¨ πŸ‘©β€β€οΈβ€πŸ’‹β€πŸ‘© πŸ’ πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨ πŸ‘©β€β€οΈβ€πŸ’‹β€πŸ‘¨ πŸ‘¨β€πŸ‘©β€πŸ‘¦ πŸ‘¨β€πŸ‘©β€πŸ‘§ πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ πŸ‘¨β€πŸ‘©β€πŸ‘¦β€πŸ‘¦ πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§ πŸ‘¨β€πŸ‘¨β€πŸ‘¦ πŸ‘¨β€πŸ‘¨β€πŸ‘§ πŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘¦ πŸ‘¨β€πŸ‘¨β€πŸ‘¦β€πŸ‘¦ πŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘§ πŸ‘©β€πŸ‘©β€πŸ‘¦ πŸ‘©β€πŸ‘©β€πŸ‘§ πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦ πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦ πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§ πŸ‘¨β€πŸ‘¦ πŸ‘¨β€πŸ‘¦β€πŸ‘¦ πŸ‘¨β€πŸ‘§ πŸ‘¨β€πŸ‘§β€πŸ‘¦ πŸ‘¨β€πŸ‘§β€πŸ‘§ πŸ‘©β€πŸ‘¦ πŸ‘©β€πŸ‘¦β€πŸ‘¦ πŸ‘©β€πŸ‘§ πŸ‘©β€πŸ‘§β€πŸ‘¦ πŸ‘©β€πŸ‘§β€πŸ‘§
Expand Down
1 change: 1 addition & 0 deletions src/scribe_data/wikidata/check_query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self, message: str, query: QueryFile) -> None:
----------
message : str
The error message.
query : QueryFile
The query that failed.
"""
Expand Down

0 comments on commit d630543

Please sign in to comment.