Skip to content

Commit

Permalink
disabled C0114,C0115,C0116,C0103,E0401,W1203,B101 in the github pylin…
Browse files Browse the repository at this point in the history
…t action
  • Loading branch information
ChaoPang committed Sep 6, 2024
1 parent 6a21a4a commit ba04dd4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
pylint $(git ls-files '*.py') --disable=C0114,C0115,C0116,C0103,E0401,W1203,B101,B311
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ repos:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--disable=pointless-statement,duplicate-code" # do not warn on bit operator statements
"--disable=pointless-statement,duplicate-code,line-too-long,missing-module-docstring,missing-class-docstring"
# do not warn on bit operator statements
]

- repo: https://github.com/DanielNoord/pydocstringformatter
Expand Down Expand Up @@ -87,3 +88,4 @@ repos:
rev: '1.7.7'
hooks:
- id: bandit
args: ["--skip", "B101,B311"]
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ dev = [

[tool.black]
line-length = 100

[tool.flake8]
max-line-length = 100
11 changes: 4 additions & 7 deletions src/cehrbert/data_generators/data_generator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ def __init__(self, concept_tokenizer: ConceptTokenizer, *args, **kwargs):

def _clean_dataframe(self):
self._training_data = self._training_data[
self._training_data[self.default_required_column].apply(
lambda token_ids: len(token_ids)
)
self._training_data[self.default_required_column].apply(len)
>= max(self.default_min_num_of_concepts, self._min_num_of_concepts)
]

Expand Down Expand Up @@ -330,9 +328,9 @@ def __init__(
max_num_of_concepts: int,
include_att_prediction: bool,
include_visit_prediction: bool,
*args,
min_num_of_concepts: int = 5,
min_num_of_visits: int = 2,
*args,
**kwargs,
):

Expand All @@ -341,7 +339,7 @@ def __init__(
self._max_num_of_visits = max_num_of_visits
self._max_num_of_concepts = max_num_of_concepts

super(HierarchicalBertDataGenerator, self).__init__(
super().__init__(
concept_tokenizer=concept_tokenizer,
visit_tokenizer=visit_tokenizer,
max_num_of_visits=max_num_of_visits,
Expand Down Expand Up @@ -410,8 +408,7 @@ def __init__(
):
self._include_readmission = include_readmission
self._include_prolonged_length_stay = include_prolonged_length_stay

super(HierarchicalBertMultiTaskDataGenerator, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _get_learning_objective_classes(self):

Expand Down

0 comments on commit ba04dd4

Please sign in to comment.