JohnCoker / thrustcurve3

ThrustCurve.org third revision
ISC License
12 stars 7 forks source link

Heads up:`thrustcurve` npm module #31

Closed broofa closed 3 years ago

broofa commented 3 years ago

Hi John,

I've created a thrustcurve NPM module, here: https://www.npmjs.com/package/thrustcurve

[Whups, premature submit. More coming momentarily!]

JohnCoker commented 3 years ago

Robert,

I would prefer if you didn't take that name for this, maybe something like "thrustcurve-snapshot"? I think an NPM module for accessing the data through the API would be more natural for that name.

As you know, I prefer people to access the data live through the API rather than having out-of-date versions of it in various places.

John

On Tue, Jun 8, 2021 at 5:33 PM Robert Kieffer @.***> wrote:

Hi John,

I've created a thrustcurve NPM module, here: https://www.npmjs.com/package/thrustcurve

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JohnCoker/thrustcurve3/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH2VKLROPVKCDYNNKZXWVDTR2ZGFANCNFSM46LABJVA .

broofa commented 3 years ago

Gotcha. I'm happy to do that. More comments coming, but it's gonna take me a moment to type out my rationale for this ... :-)

broofa commented 3 years ago

So, briefly...

The reason I went with a snapshot approach here is several-fold:

  1. The database here is simply not that big. The search.json data (all 1,097 motors) is surprisingly small when gzipped+minified... ~60KB. The download.json data ("samples") is 250-300KB. If you include the data files ("both", not that there's much reason to) it's ~1MB. Or, if you normalize both these datasets and "trim the fat", as I've done in this module, you get a thrustcurve.json file bundle sie of 178KB for everything.
  2. The data doesn't change that often. E.g. It looks like there were ~50 updates in 2020 (based on the updatedOn dates). There's been 12 in 2021 so far. Less than 5% of the data changes per year.

Having a data snapshot provides the following benefits:

I understand your reservation with having out-of-date data out there, but I've tried to set this up so that it's easy to push a new release. (The entirety of the release process is npm version patch && git push && npm publish).

JohnCoker commented 3 years ago

OK, it does sound reasonable. My only request is to leave the "thrustcurve" name for something that uses the API, so supports search, the motor guide etc.

John

On Tue, Jun 8, 2021 at 6:12 PM Robert Kieffer @.***> wrote:

So, briefly...

The reason I went with a snapshot approach here is several-fold:

  1. The database here is simply not that big. The search.json data (all 1,097 motors) is surprisingly small when gzipped+minified... ~60KB. The download.json data ("samples") is 250-300KB. If you include the data files ("both", not that there's much reason to) it's ~1MB. Or, if you normalize both these datasets and "trim the fat", as I've done in this module, you get a thrustcurve.json file that's 178KB for everything.
  2. The data doesn't change that often. E.g. It looks like there were ~50 updates in 2020 (based on the updatedOn dates). There's been 12 in 2021 so far. Less than 5% of the data changes per year.

Having a data snapshot provides the following benefits:

  • Works on any platform, any language (that supports JSON so... basically all of them.)
  • Results in better QoS (apps don't depend the internet or thrustcurve.org to be working)
  • Querying is "CPU-fast", as opposed to "network-fast".
  • Querying can be done using native language features. E.g. thrustcurve.filter(motor => motor.impulseClass > 'K')
  • Provides a single, normalized structure (e.g. removes the annoyance of duplicate RASP / RockSim sample sets)
  • Allows developers to "munge" data as they see fit should they choose to do so.

I understand your reservation with having out-of-date data out there, but I've tried to set this up so that it's easy to push a new release. (The entirety of the release process is npm patch && git push && npm publish).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JohnCoker/thrustcurve3/issues/31#issuecomment-857296294, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH2VKNTNHKS63IYM6L46PTTR25XXANCNFSM46LABJVA .

broofa commented 3 years ago

Okay, I'll probably go with thrustcurve-db for the new name, as there is a bit of precedent for that with the mime-db project that is somewhat similar in nature. (Provides a JSON file of file extensions-MIME type mappings.)

There's actually a few lessons to be learned from that project, but we can save that for a different conversation. :-)

broofa commented 3 years ago

Okay, I've moved my module to "thrustcurve-db". I still "own" the "thrustcurve" NPM module, but I can transfer that to you whenever. Just let me know your NPM handle. Or we can just leave things as they are and if/when you decide to do something with it you can reach out to me, or point NPM support at this comment and ask them to transfer it to you.

In the meantime (until a new "thrustcurve" module version gets published by whoever), the NPM page will show a deprecated warning that redirects to "thrustcurve-db".

JohnCoker commented 3 years ago

Thanks, that'll be fine. I have no immediate plans to publish anything. Maybe when the next revision of the API comes out, an NPM module to go with it would be a good idea.

John

On Tue, Jun 8, 2021 at 7:06 PM Robert Kieffer @.***> wrote:

Closed #31 https://github.com/JohnCoker/thrustcurve3/issues/31.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JohnCoker/thrustcurve3/issues/31#event-4862159108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH2VKPHVY6BHNPDDLZZWV3TR3ECVANCNFSM46LABJVA .

JohnCoker commented 3 years ago

@broofa I created an account "johncoker" on NPM.

broofa commented 3 years ago

Okay, I've added you as an owner of that module. I'm still listed as a co-owner, but either one of us can remove me by doing npm rm broofa thrustcurve.