Thread overview
Contributing CDF bindings to Deimos
Mar 23, 2021
Chris Piker
Mar 23, 2021
mw
Mar 25, 2021
Chris Piker
Mar 25, 2021
mw
Mar 25, 2021
Bastiaan Veelo
Mar 25, 2021
Chris Piker
Mar 26, 2021
Jordan Wilson
Mar 26, 2021
Chris Piker
Mar 31, 2021
Jacob Carlborg
March 23, 2021
Hi D

There is a C library that's important for my line of work,

  https://cdf.gsfc.nasa.gov/

but it's not exactly a popular library in the general sense.  I willing to contribute & maintain D bindings for this library following the Deimos guidelines but am wondering if it's too specific to be allowed into the repository.

If D bindings for the Common Data Format library are an acceptable addition, can you point me to a procedure document for issuing pull requests for package submissions?

Thanks for the guidance,

March 23, 2021
On Tuesday, 23 March 2021 at 05:34:57 UTC, Chris Piker wrote:
> Hi D
>
> There is a C library that's important for my line of work,
>
>   https://cdf.gsfc.nasa.gov/
>
> but it's not exactly a popular library in the general sense.  I willing to contribute & maintain D bindings for this library following the Deimos guidelines but am wondering if it's too specific to be allowed into the repository.
>
> If D bindings for the Common Data Format library are an acceptable addition, can you point me to a procedure document for issuing pull requests for package submissions?
>
> Thanks for the guidance,

Create a github repo, and create an account on:

https://code.dlang.org/


Then you can register your project there, and supported by dub build.

March 25, 2021
On Tuesday, 23 March 2021 at 05:54:13 UTC, mw wrote:
> On Tuesday, 23 March 2021 at 05:34:57 UTC, Chris Piker wrote:
>
> Create a github repo, and create an account on:
>
> https://code.dlang.org/
>
> Then you can register your project there, and supported by dub build.

Okay, that's done.

The repo https://github.com/das-developers/deimos.cdf and package https://code.dlang.org/packages/cdf have been drafted and tested on Linux, I'm about to test on Windows and MacOS.  As an aside, software developers at NASA Goddard have now heard of D which is nice.  They were pleased to see that it was supported by gcc. (Hat tip to the GDC team)

I've attempted to follow all guidelines as best I understood them, but this is my first package.  It likely has some style and functionality issues.  Is there a peer review stage to this process that is triggered automatically or could be requested?

March 25, 2021
On Thursday, 25 March 2021 at 04:00:33 UTC, Chris Piker wrote:
> The repo https://github.com/das-developers/deimos.cdf and package https://code.dlang.org/packages/cdf have been drafted and tested on Linux, I'm about to test on Windows and MacOS.  As an aside, software developers at NASA Goddard have now heard of D which is nice.  They were pleased to see that it was supported by gcc. (Hat tip to the GDC team)
>

Thanks for the contribution.

> I've attempted to follow all guidelines as best I understood them, but this is my first package.  It likely has some style and functionality issues.  Is there a peer review stage to this process that is triggered automatically or could be requested?

No, D packages is mostly community driven, there is no formal process.

The more users use one package, the more feedback one will get, typically logged as  github issues, and people communicate on github.

You can check some of the most popular packages here:

https://code.dlang.org/?sort=score
March 25, 2021
On Thursday, 25 March 2021 at 04:00:33 UTC, Chris Piker wrote:
> As an aside, software developers at NASA Goddard have now heard of D which is nice.  They were pleased to see that it was supported by gcc. (Hat tip to the GDC team)

That’s cool. I’d love to see NASA on https://dlang.org/orgs-using-d.html one day.

— Bastiaan.
March 25, 2021
On Thursday, 25 March 2021 at 16:57:05 UTC, Bastiaan Veelo wrote:
> On Thursday, 25 March 2021 at 04:00:33 UTC, Chris Piker wrote:
>> As an aside, software developers at NASA Goddard have now heard of D which is nice.  They were pleased to see that it was supported by gcc. (Hat tip to the GDC team)
>
> That’s cool. I’d love to see NASA on https://dlang.org/orgs-using-d.html one day.
>
> — Bastiaan.

I'd like that too, we'll see.

The next set of NASA C code that needs bindings is the navigation library at https://naif.jpl.nasa.gov/naif/index.html.  This is an older library and so it isn't listed in the expected location https://software.nasa.gov/

A next step for the the CDF bindings would be to parse the existing external text documentation for each function and output ddoc comments.  Text processing is not my forte so any hints or volunteers are more than welcome.  I'll open an issue for that on github.

March 26, 2021
On Thursday, 25 March 2021 at 04:00:33 UTC, Chris Piker wrote:
> On Tuesday, 23 March 2021 at 05:54:13 UTC, mw wrote:
>> [...]
>
> Okay, that's done.
>
> The repo https://github.com/das-developers/deimos.cdf and package https://code.dlang.org/packages/cdf have been drafted and tested on Linux, I'm about to test on Windows and MacOS.  As an aside, software developers at NASA Goddard have now heard of D which is nice.  They were pleased to see that it was supported by gcc. (Hat tip to the GDC team)
>
> I've attempted to follow all guidelines as best I understood them, but this is my first package.  It likely has some style and functionality issues.  Is there a peer review stage to this process that is triggered automatically or could be requested?

Nice one. I've used HDF5/NetCDF, will have to check out and see what CDF offers.

Jordan
March 26, 2021
On Friday, 26 March 2021 at 00:50:36 UTC, Jordan Wilson wrote:
> Nice one. I've used HDF5/NetCDF, will have to check out and see what CDF offers.

AFAIK CDF is much simpler than NetCDF.  If you do generate CDF files and want other common tools to understand your data structures, use the ISTP metadata scheme:

  https://spdf.gsfc.nasa.gov/istp_guide/istp_guide.html

Since deimos.cdf just provides C bindings and type safety, a higher level module would be nicer.  Currently, the most natural interface to CDF files that I've used is the spacepy.pycdf python package.





March 31, 2021
On 2021-03-25 05:00, Chris Piker wrote:

> I've attempted to follow all guidelines as best I understood them, but this is my first package.  It likely has some style and functionality issues.

There's a general convention to name the top level module or package the same as the project. To avoid causing conflict with other projects.

I see that you have used DStep to create the bindings. I also see that you had to make some changes to the output. Please report any issues or enhancement requests to [1].

I you need any DStep specific help or have any questions, please ask here in the learn forum or on the DStep specific discussions section (which I just enabled) on GitHub [2]. I'll do my best to help you.

[1] https://github.com/jacob-carlborg/dstep
[2] https://github.com/jacob-carlborg/dstep/discussions

-- 
/Jacob Carlborg