Skip to content

Commit

Permalink
Update .pre-commit-config.yaml (Project-MONAI#1274)
Browse files Browse the repository at this point in the history
* Update .pre-commit-config.yaml

* Fix precommit

Signed-off-by: Sachidanand Alle <[email protected]>

---------

Signed-off-by: Sachidanand Alle <[email protected]>
  • Loading branch information
SachidanandAlle authored Feb 4, 2023
1 parent cd0d012 commit 4a96ae7
Show file tree
Hide file tree
Showing 65 changed files with 680 additions and 707 deletions.
21 changes: 15 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,43 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-yaml
- id: check-executables-have-shebangs
- id: check-toml
- id: check-case-conflict
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: forbid-new-submodules
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys', '--indent=4']
- id: end-of-file-fixer
- id: mixed-line-ending

- repo: https://github.com/pycqa/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: ["--line-length=120", "--profile=black"]

- repo: https://github.com/pycqa/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
name: isort (python) (check)
args: ["--line-length=120", "--profile=black", "--check"]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args: ["--line-length=120"]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
name: black (check)
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ license: "Apache-2.0"
repository-code: "https://github.com/Project-MONAI/MONAILabel"
cff-version: "1.1.0"
message: "If you use this software, please cite it using these metadata."
...
...
2 changes: 1 addition & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ limitations under the License.
@import url('https://fonts.googleapis.com/css?family=Lekton:700|Roboto&display=swap');
body{font-family:'Roboto',sans-serif;}.wy-menu-vertical p.caption{color:#7cccc7;}
*{font-variant-ligatures: none;}.autoclasstoc td {padding:0.2rem;line-height:normal;}
dl.field-list>dt{word-break: normal}
dl.field-list>dt{word-break: normal}
2 changes: 1 addition & 1 deletion docs/images/modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/images/monai-server-application-callflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def generate_apidocs(*args):


class GenerateTagLinks(SphinxTransform):

linkref_prefix = "LINKREF_"
git_tag = "MONAILABEL_GIT_TAG"
linkref_lut = {"LINKREF_GITHUB_MONAILABEL": f"https://github.com/Project-MONAI/MONAILabel/tree/{{{git_tag}}}"}
Expand All @@ -174,9 +173,7 @@ def basetext(obj):
return isinstance(obj, Text) and obj.startswith(GenerateTagLinks.linkref_prefix)

def apply(self):

for node in self.document.traverse(GenerateTagLinks.baseref):

# find the entry for the link reference we want to substitute
link_key = None
for k in self.linkref_lut.keys():
Expand Down
2 changes: 0 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,3 @@ If you have `DSA <https://digitalslidearchive.github.io/digital_slide_archive/>`
monailabel start_server --app apps/pathology --studies http://0.0.0.0:8080/api/v1

Refer `DSA Plugin <https://github.com/Project-MONAI/MONAILabel/tree/main/plugins/dsa>`_ for running a sample pathology use-case in MONAILabel using DSA.


4 changes: 2 additions & 2 deletions monailabel/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ def save_result(files, tmpdir):
def encode_multipart_formdata(fields, files):
limit = "----------lImIt_of_THE_fIle_eW_$"
lines = []
for (key, value) in fields.items():
for key, value in fields.items():
lines.append("--" + limit)
lines.append('Content-Disposition: form-data; name="%s"' % key)
lines.append("")
lines.append(value)
for (key, filename) in files.items():
for key, filename in files.items():
if isinstance(filename, tuple):
filename, data = filename
else:
Expand Down
1 change: 0 additions & 1 deletion monailabel/deepedit/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(
click_probability_key: str = "probability",
max_interactions: int = 1,
) -> None:

self.deepgrow_probability = deepgrow_probability
self.transforms = Compose(transforms) if not isinstance(transforms, Compose) else transforms
self.train = train
Expand Down
94 changes: 47 additions & 47 deletions monailabel/endpoints/user/users.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"admin": {
"username": "admin",
"full_name": "Admin",
"email": "[email protected]",
"hashed_password": "$2b$12$CexVjWGTX//w8kt.f3CbGuznFtnlHCVte1EUScwzDCRKMRmltGBDa",
"disabled": false,
"scopes": [
"admin",
"reviewer",
"annotator",
"user"
]
},
"reviewer": {
"username": "reviewer",
"full_name": "Reviewer",
"email": "[email protected]",
"hashed_password": "$2b$12$KJzEvm8iQFOwiLLecBjxg./g/9XLt1VMIDBrEFqJnqEOonxaWZ1y2",
"disabled": false,
"scopes": [
"reviewer",
"annotator",
"user"
]
},
"annotator": {
"username": "annotator",
"full_name": "Annotator",
"email": "[email protected]",
"hashed_password": "$2b$12$6RPP.jL.8GZmP7DtJhWRLO.Exvh6LGUleXq.KLyBv9/leoV8KY8Pm",
"disabled": false,
"scopes": [
"annotator",
"user"
]
},
"user": {
"username": "user",
"full_name": "User",
"email": "[email protected]",
"hashed_password": "$2b$12$Py6rSaJyhJIYfgnEOmCzLuQ9Kz7FtMdzjRCimtPUmPspbIPbRH6Dq",
"disabled": false,
"scopes": [
"user"
]
}
}
"admin": {
"username": "admin",
"full_name": "Admin",
"email": "[email protected]",
"hashed_password": "$2b$12$CexVjWGTX//w8kt.f3CbGuznFtnlHCVte1EUScwzDCRKMRmltGBDa",
"disabled": false,
"scopes": [
"admin",
"reviewer",
"annotator",
"user"
]
},
"reviewer": {
"username": "reviewer",
"full_name": "Reviewer",
"email": "[email protected]",
"hashed_password": "$2b$12$KJzEvm8iQFOwiLLecBjxg./g/9XLt1VMIDBrEFqJnqEOonxaWZ1y2",
"disabled": false,
"scopes": [
"reviewer",
"annotator",
"user"
]
},
"annotator": {
"username": "annotator",
"full_name": "Annotator",
"email": "[email protected]",
"hashed_password": "$2b$12$6RPP.jL.8GZmP7DtJhWRLO.Exvh6LGUleXq.KLyBv9/leoV8KY8Pm",
"disabled": false,
"scopes": [
"annotator",
"user"
]
},
"user": {
"username": "user",
"full_name": "User",
"email": "[email protected]",
"hashed_password": "$2b$12$Py6rSaJyhJIYfgnEOmCzLuQ9Kz7FtMdzjRCimtPUmPspbIPbRH6Dq",
"disabled": false,
"scopes": [
"user"
]
}
}
182 changes: 91 additions & 91 deletions monailabel/logging.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
{
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"single": {
"format": "%(message)s"
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"single": {
"format": "%(message)s"
},
"simple": {
"format": "[%(asctime)s] [%(process)s] [%(threadName)s] [%(levelname)s] (%(name)s:%(lineno)d) - %(message)s"
},
"debug": {
"format": "[%(asctime)s] [%(process)s] [%(threadName)s] [%(levelname)s] (%(name)s:%(lineno)d) - %(message)s"
}
},
"simple": {
"format": "[%(asctime)s] [%(process)s] [%(threadName)s] [%(levelname)s] (%(name)s:%(lineno)d) - %(message)s"
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "simple"
},
"task_console": {
"class": "logging.StreamHandler",
"formatter": "single"
},
"task_handler": {
"class": "logging.handlers.RotatingFileHandler",
"formatter": "single",
"filename": "${LOGFILE}",
"backupCount": 10,
"maxBytes": 10485760,
"encoding": "utf-8"
},
"file_handler": {
"class": "logging.handlers.RotatingFileHandler",
"formatter": "simple",
"filename": "${LOGFILE}",
"backupCount": 10,
"maxBytes": 10485760,
"encoding": "utf-8"
}
},
"debug": {
"format": "[%(asctime)s] [%(process)s] [%(threadName)s] [%(levelname)s] (%(name)s:%(lineno)d) - %(message)s"
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "simple"
},
"task_console": {
"class": "logging.StreamHandler",
"formatter": "single"
},
"task_handler": {
"class": "logging.handlers.RotatingFileHandler",
"formatter": "single",
"filename": "${LOGFILE}",
"backupCount": 10,
"maxBytes": 10485760,
"encoding": "utf-8"
},
"file_handler": {
"class": "logging.handlers.RotatingFileHandler",
"formatter": "simple",
"filename": "${LOGFILE}",
"backupCount": 10,
"maxBytes": 10485760,
"encoding": "utf-8"
}
},
"root": {
"level": "INFO",
"propagate": false,
"handlers": [
"console",
"file_handler"
]
},
"loggers": {
"task_train": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"task_scoring": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"task_batch_infer": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"uvicorn": {
"level": "INFO",
"propagate": false,
"handlers": [
"console"
]
},
"uvicorn.access": {
"level": "WARNING",
"propagate": false,
"handlers": [
"console"
]
"root": {
"level": "INFO",
"propagate": false,
"handlers": [
"console",
"file_handler"
]
},
"urllib3.connectionpool": {
"level": "ERROR",
"propagate": false,
"handlers": [
"console"
]
"loggers": {
"task_train": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"task_scoring": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"task_batch_infer": {
"level": "INFO",
"propagate": false,
"handlers": [
"task_console",
"task_handler"
]
},
"uvicorn": {
"level": "INFO",
"propagate": false,
"handlers": [
"console"
]
},
"uvicorn.access": {
"level": "WARNING",
"propagate": false,
"handlers": [
"console"
]
},
"urllib3.connectionpool": {
"level": "ERROR",
"propagate": false,
"handlers": [
"console"
]
}
}
}
}
}
Loading

0 comments on commit 4a96ae7

Please sign in to comment.