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

[Enhancement] Extra steps and error messages in schema validation #65

Open
Udayraj123 opened this issue Oct 4, 2022 · 9 comments
Open

Comments

@Udayraj123
Copy link
Owner

Udayraj123 commented Oct 4, 2022

This extends #43

  1. All labels in all of the QBlocks should be covered in either Singles or concatenations (tally the qNo labels to exist in either of them).
  2. Also none of the labels in qBlocks should overlap (show warning in this case)
  3. User friendly messages: suggestion to convert key into camelCase (in which case validation error should mention that).

Originally posted by @Udayraj123 in #60 (comment)

@Udayraj123 Udayraj123 changed the title [Enhancement] Enhancements in schema validation [Enhancement] Extra steps and error messages in schema validation Oct 5, 2022
@SpyzzVVarun
Copy link
Contributor

We can close the previous issue and update this one.

@SpyzzVVarun
Copy link
Contributor

In #43 we added a json schema, which is basically a blueprint for the input template.json file, that validates the template file and we wrote a function that validates the template using python jsonschema library. Both the schema and the error messages need a lot of improvement and that is where this issue comes in.

  1. Talking about improvements in the validation schema, we have to write the constraints in much more detail. By constraint I mean for eg: the dimensions key should only take in an array of 2 integers, so if the number of integers don't match, it should give a proper error message. So, detailed constraints have to be included in the schema.

  2. Regarding the error messages, currently we only print the key where the error takes place (key comes from schema and not the input template which is a problem) and we print a default error message which is not sufficient currently. So we need to improve the error messages, add a warning/error info/level and also find a way to get the key with the error from the input template.json instead of the schema (for cases of spelling mistake or case mistake in the keys).

@Udayraj123
Copy link
Owner Author

Udayraj123 commented Oct 7, 2022

Well detailed breakdown 👍
you(and others) can raise PRs in small mergeable/deliverable chunks as we discussed yesterday.

Reiterating that discussion here as well for reference -

I'll share a concept I shared with one of you recently.

This comes from Agile development practiced in the industry.

image

Each small ball is a small change that is eligible for merge.

Break the task down into as many parts as possible, as long as one meaningful PR for each of the parts exists. This helps in teams and communities to work independently and efficiently

@Udayraj123
Copy link
Owner Author

@SpyzzVVarun adding few more criteria

  • inner schema of each QBlock should be validated too.
  • singles array should not contain duplicate qNos
  • concatenations keys + arrays should not contain duplicate qNos

@Udayraj123
Copy link
Owner Author

Udayraj123 commented Oct 22, 2022

This issue needs a bit more attention now. Bumping updated time with this comment.

@Udayraj123
Copy link
Owner Author

@SpyzzVVarun are you available to work on this now?

@Udayraj123
Copy link
Owner Author

Marking issue as easy since a few improvements have been merged in the evaluation + revamp PR #118

@anaghninja432
Copy link

Sir i would like to contribute to this project. Please tell me how, I'm pretty new to Open Source.

@Udayraj123
Copy link
Owner Author

@anaghninja432 Hello, if you're new to the project I suggest you to run the project locally on a new OMR sheet and submit a sample. Then in the process try to go through the code flow for your images. This task is around schema validation so you can experiment passing incorrect template jsons by thinking of common mistakes people can do. We need to provide accurate error messages to guide the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

3 participants