Fork me on GitHub
#clojure
<
2021-07-31
>
dpsutton15:07:09

Where can i report some issues on ? Lots of the links in the readme point to which understandably throw return a 403. Examples:

* [List of projects]()
...
* If you are using Clojure 1.2, use clojure-contrib 1.2, or the new [modular Contrib]() libraries.
* If you are using Clojure 1.3, use the new [modular Contrib]() libraries.

seancorfield17:07:01

@dpsutton clojure-contrib is essentially "dead" and unmaintained... I don't know where you'd file issues with it. I guess you could post on ask...?

seancorfield17:07:50

Looks like I have write access to that README so I can fix all the links if you list them in a post on ask with their new locations?

dpsutton17:07:58

Had someone following a tutorial that used that. And unfortunately all of the links pointing to how to use the modern variants 403

dpsutton17:07:30

I can do that after lunch. Thanks Sean

2
seancorfield17:07:56

And then I can update README after I've had breakfast 🙂

🍳 2
dpsutton18:07:05

Here's a suggested patch. Points to the list of contrib libs, removes information about how to create a new contrib project, and removes the section for maven configuration

seancorfield18:07:19

The "favorite contrib" piece is covered on the new contrib_libs page too "If you find that active development for a library has ceased and you would like to take over as owner, please contact <mailto:[email protected]|[email protected]>. ..." so, yeah, taking that piece out instead seems like a good approach. Thanks!

👍 2
seancorfield18:07:54

OK, README updated.

West17:07:50

I’m wondering how I can create better tests for these sorts of calculations.

(deftest greenwich-mean-sidereal-time
  (testing "Get GMST given the Julian date.\n
            Using reference values from XEphmem 4.0.1"
    (are [sidtime jd] (= sidtime (sut/greenwich-mean-sidereal-time jd))
      {:h 20 :m 31 :s 24} 2459425.5
      {:h 14 :m 55 :s 50} 2127164.96610
      {:h 16 :m 13 :s 23} 0.0
      {:h 18 :m 48 :s 53} 3547273.0)))
Right now I’m taking values I got from an old astronomy program, but I’m not sure if my tests or my implementation failed.

West17:07:22

wildwestrom.sidereal-time-clock.time-test
4 non-passing tests:

Fail in greenwich-mean-sidereal-time
Get GMST given the Julian date.

            Using reference values from XEphmem 4.0.1

expected: {:h 20, :m 31, :s 24}

  actual: {:h 20, :m 34, :s 30}          
    diff: - {:s 24, :m 31}          
          + {:s 30, :m 34}            


Fail in greenwich-mean-sidereal-time
Get GMST given the Julian date.

            Using reference values from XEphmem 4.0.1

expected: {:h 14, :m 55, :s 50}            

  actual: {:h 14, :m 58, :s 48}          
    diff: - {:s 50, :m 55}          
          + {:s 48, :m 58}            


Fail in greenwich-mean-sidereal-time
Get GMST given the Julian date.

            Using reference values from XEphmem 4.0.1

expected: {:h 16, :m 13, :s 23}            

  actual: {:h 16, :m 9, :s 26}          
    diff: - {:s 23, :m 13}          
          + {:s 26, :m 9}            


Fail in greenwich-mean-sidereal-time
Get GMST given the Julian date.

            Using reference values from XEphmem 4.0.1

expected: {:h 18, :m 48, :s 53}            

  actual: {:h 18, :m 50, :s 36}          
    diff: - {:s 53, :m 48}          
          + {:s 36, :m 50}            

West17:07:18

And here’s my function

(defn greenwich-mean-sidereal-time
  "For longitude zero, calculates the sidereal time given a Julian day."
  [jd]
  (let [MJD0     2415020.0
        J2000    (- jd MJD0)
        GMST     (+ 18.697374558 (* 24.06570982441908 J2000))
        GMST-24h (mod GMST 24)]
    (sidereal-time-map GMST-24h)))

vemv18:07:06

stating the obvious, but if you don't know the right answer for a given computation, you cannot possibly create a meaningful test for it :) either you'll have to take the old program's values as canon, or you'll have to understand your own program very carefully

vemv18:07:54

an 'outside of the box' way to solving this might be jumping to a semi-related problem that would depend on the greenwich-mean-sidereal-time impl being correct. if the solution to the other problem is grossly incorrect, then that might give you a hint that greenwich-mean-sidereal-time is also incorrect

West20:07:24

Hmmmm, that makes things difficult I guess. So I guess for now I’ll see if I can find a good reference implementation.

West12:08:35

I’m thinking of using graalvm to link with an existing astronomy library.

West03:08:58

I’m gonna have to revisit this another time.

emccue20:07:35

NOTE: Transit is intended primarily as a wire protocol for transferring data between applications. If storing Transit data durably, readers and writers are expected to use the same version of Transit and you are responsible for migrating/transforming/re-storing that data when and if the transit format changes.

emccue20:07:57

has there been any breaking changes in this so far?

emccue20:07:07

considering using transit for durable storage

p-himik20:07:57

Even if there have been such changes - nothing prevents you from not upgrading the transit libraries. Or from migrating the data upon an upgrade that's not backwards compatible.

didibus20:07:16

I don't think it has, but they would hesitate too if they needed would be the idea.

didibus20:07:35

I thought Freesian on the other hand was intended for persistent storage?

💯 2
didibus18:08:59

You can also give Nippy a look: https://github.com/ptaoussanis/nippy I heard a lot of good things about it.

potetm22:07:37

It was made clear to me that the core team intends on treating breaking changes to Transit the same way they treat breaking changes to everything else.

potetm22:07:47

iow: possible, but they will try very hard not to