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

draft schema design #950

Closed
wants to merge 0 commits into from

Conversation

Vidushi-GitHub
Copy link
Member

#921 in progress

@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (7c178e7) 5.63% compared to head (1434f52) 5.63%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #950   +/-   ##
=====================================
  Coverage   5.63%   5.63%           
=====================================
  Files         99      99           
  Lines       2414    2414           
  Branches     295     295           
=====================================
  Hits         136     136           
  Misses      2276    2276           
  Partials       2       2           
Files Changed Coverage Δ
app/routes/docs.tsx 0.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dakota002
Copy link
Contributor

A useful link to have somewhere in this documentation: https://www.learnjsonschema.com/2020-12/

@Vidushi-GitHub
Copy link
Member Author

Vidushi-GitHub commented May 22, 2023

Will add schema related step at New Notice Producers.

@Vidushi-GitHub Vidushi-GitHub force-pushed the schema_design branch 2 times, most recently from 0144db6 to d70a2c0 Compare May 31, 2023 19:29
@jracusin
Copy link
Contributor

jracusin commented Jul 6, 2023

For submitting schema, we need to add something about making a PR with their branch, that's what initiates our review. Also do we really need the details of exactly how to use git?

@jracusin jracusin added the documentation Improvements or additions to documentation label Jul 10, 2023
@Vidushi-GitHub Vidushi-GitHub marked this pull request as ready for review August 1, 2023 19:50
@Vidushi-GitHub
Copy link
Member Author

For submitting schema, we need to add something about making a PR with their branch, that's what initiates our review. Also do we really need the details of exactly how to use git?

Done!

@Vidushi-GitHub
Copy link
Member Author

@lpsinger This pull request is ready for review! I am attaching screenshots for reference. Seperate attachments for HealPix page is removed for now, which will require parsing healpix instructions from you and @israelmcmc.
schema_doc1
<img width="1026" alt="schema_doc2" src="ht
schema_doc3
tps://github.com/nasa-gcn/gcn.nasa.gov/assets/103223246/0
schema_doc4
827a7c1-240a-4865-aef0-580ee3f4017c">

Copy link
Member

@lpsinger lpsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase. Sorry, we just merged #840, which touched nearly all of the route modules.

@Vidushi-GitHub
Copy link
Member Author

Please rebase. Sorry, we just merged #840, which touched nearly all of the route modules.

No problem.

@Vidushi-GitHub Vidushi-GitHub force-pushed the schema_design branch 2 times, most recently from 208a7f4 to 71cd4de Compare August 3, 2023 20:10
Copy link
Member

@lpsinger lpsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FAQ items are great, but I am not sure that they belong in the FAQ. I think a tutorial or primer on writing JSON Schema would be more useful. Then, your content for the FAQ entry titled "Which option, "allOf", "anyOf", or "oneOf" should be used?" would go into a section of the primer on inheritance.

app/routes/docs.producers.schema-documentation.mdx Outdated Show resolved Hide resolved
@@ -66,6 +66,30 @@ This warning means that there have not been any recent alerts on that topic.

To get started, [sign in or sign up](https://gcn.nasa.gov/login) and then select 'Email Notifications' from account dropdown menu. See also [GCN Circular 32517](https://gcn.gsfc.nasa.gov/gcn3/32517.gcn3).

## Notice Producers

### Which unit system is recommended to be used?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminate passive voice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be moved from FAQ to tutorial page.

app/routes/docs.faq.md Outdated Show resolved Hide resolved

We recommend utilizing the "allOf" option, as none of the properties in the core schema are required. However, this flexibility, with no required property, can lead to false positives when "anyOf" is used, as anything will technically validate against it.

### How can I refer the coincident detection with another instrument?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence seems non-grammatical. @jracusin, would you please help re-word it?

app/routes/docs.faq.md Outdated Show resolved Hide resolved
app/routes/docs.producers._index.mdx Outdated Show resolved Hide resolved
app/routes/docs.producers._index.mdx Outdated Show resolved Hide resolved
Comment on lines 76 to 79
data = str({
'$schema':'your/schema',
'key':'value'
...
}).encode() # any bytes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's not how you serialize a data structure to JSON in Python. Use json.dumps.

I don't think that you need to explicitly encode it to bytes. If memory servers, Producer.produce happily accepts either strings or bytes. (Please test that.)

Copy link
Member Author

@Vidushi-GitHub Vidushi-GitHub Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json.dumps update done!

We tested producer.produce with a string and it threw errors when not a byte string

@dakota002 please check this is true

@Vidushi-GitHub
Copy link
Member Author

The FAQ items are great, but I am not sure that they belong in the FAQ. I think a tutorial or primer on writing JSON Schema would be more useful. Then, your content for the FAQ entry titled "Which option, "allOf", "anyOf", or "oneOf" should be used?" would go into a section of the primer on inheritance.

@lpsinger do you suggest that FAQ related to notice producers should be placed under New Notice Producers as Tutorial Section (similar as schema document)? @jracusin @dakota002

@Vidushi-GitHub
Copy link
Member Author

Vidushi-GitHub commented Aug 16, 2023

@lpsinger and @dakota002 I accidentally closed this branch, I was working on rebase! Don't deploy it!

@lpsinger
Copy link
Member

That's alright, @Vidushi-GitHub. You closed it, but you didn't merge it. You could re-open it if you want to.

@Vidushi-GitHub Vidushi-GitHub deleted the schema_design branch August 22, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants