Skip to content
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

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

mikix
Copy link
Contributor

@mikix mikix commented Jan 12, 2024

This allows alternate study "modes" like different label setups.

Just point -c or --config at the path of your custom config.

Should solve #14

This allows alternate study "modes" like different label setups.

Just point -c or --config at the path of your custom config.
Comment on lines -29 to -38
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
Copy link
Contributor Author

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")

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?

Copy link
Contributor Author

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)

Comment on lines +60 to +62
# Support config.json in case folks prefer that
try:
return self._read_yaml(self.path("config.json"))

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

@mikix mikix merged commit 6ece63c into main Jan 16, 2024
2 checks passed
@mikix mikix deleted the mikix/custom-config branch January 16, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants