-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support secondary config files with --config #17
Conversation
This allows alternate study "modes" like different label setups. Just point -c or --config at the path of your custom config.
if isinstance(saved, list): | ||
self.annotations = simplify.simplify_full(self.labelstudio_json, self.annotator) | ||
else: | ||
# TODO: int keys cant be saved in JSON, compatability hack use instead LabelStudio.py | ||
compat = dict() | ||
compat["files"] = saved["files"] | ||
compat["annotations"] = dict() | ||
for k in saved["annotations"].keys(): | ||
compat["annotations"][int(k)] = saved["annotations"][k] | ||
self.annotations = compat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unrelated cleanup - this code path was for a no-longer-used workflow with custom hacked label studio exports.
) # TODO: refactor labelstudio.py | ||
self.config = proj_config | ||
self.project_dir = self.config.project_dir | ||
self.labelstudio_json = self.config.path("labelstudio-export.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: is there a usecase for having more than one of these configs? would you ever want to pass the filename in directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could imagine a use case, where maybe you spread chart reviews (annotations) across multiple Label Studio projects instead of one. Then we could maybe unify the annotations of multiple files.
My gut reaction for handling that would be a config field like "label-studio-exports: [list of names]" or something (defaulting to [labelstudio-export.json]
).
If you had instead spread your annotations across different Label Studio instances... that would be very interesting to support, because now the user IDs wouldn't necessarily line up. I don't wanna support that... :) (You could always manually integrate that by creating an external label file like you do for icd10 labels from athena)
# Support config.json in case folks prefer that | ||
try: | ||
return self._read_yaml(self.path("config.json")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know we've talked about this before but it's still kind of wild
This allows alternate study "modes" like different label setups.
Just point -c or --config at the path of your custom config.
Should solve #14