Skip to content

Commit

Permalink
add mkdocs gh action; clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kshefchek committed Oct 11, 2021
1 parent 7b20646 commit 750c247
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Builds and runs pytest on ubuntu-latest
# Tests python versions >=3.6
name: Build
name: build

on:
push:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy documentation
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mkdocs
- run: mkdocs gh-deploy --force
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
koza.monarchinitiative.org
14 changes: 9 additions & 5 deletions docs/ingest_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ delimiter: '\t'
# Optional delimiter for header row
header_delimiter: '|'

# Boolean to configure presence of header, default is true
has_header: 'False'

# Number of lines to be ignored at the head of an ingest data file, default is 0
skip_lines: 10
# Optional, int | 'infer' | 'none', Default = 'infer'
# The index (0 based) in which the header appears in the file.
#
# If header is set to 'infer' the headers will be set to the first
# line that is not blank or commented with a hash.
#
# If header is set to 'none' then the columns field will be used,
# or raise a ValueError if columns are not supplied
header: 0

# Boolean to skip blank lines, default is true
skip_blank_lines: True
Expand Down
4 changes: 3 additions & 1 deletion koza/io/reader/csv_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def __init__(
:param header: 0 based index of the file that contains the header,
or header mode 'infer'|'none' ( default='infer' )
if 'infer' will use the first non-empty and uncommented line
if 'none' will use the field_type_map keys, if field_type_map
if 'none' will use the user supplied columns in field_type_map keys,
if field_type_map is None this will raise a ValueError
:param header_delimiter: delimiter for the header row, default = self.delimiter
:param dialect: csv dialect, default=excel
:param skip_blank_lines: true to skip blank lines, false to insert NaN for blank lines,
Expand Down
11 changes: 10 additions & 1 deletion koza/model/config/source_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ class SourceConfig:
header appears in the file. If header is set to infer
the headers will be set to the first line that is not blank
or commented with a hash. If header is set to 'none'
then the columns field will be used
then the columns field will be used, or raise a ValueError
if columns are not supplied
delimiter:
separator string similar to what works in str.split()
Expand Down Expand Up @@ -256,6 +257,14 @@ def __post_init_post_parse__(self):
for column in self.columns
]

if self.header == HeaderMode.none and not self.columns:
raise ValueError(
f"there is no header and columns have not been supplied\n"
f"configure the 'columns' field or set header to the 0-based"
"index in which it appears in the file, or set this value to"
"'infer'"
)

for column in filtered_columns:
if column not in all_columns:
raise (ValueError(f"Filter column {column} not in column list"))
Expand Down

0 comments on commit 750c247

Please sign in to comment.