My own corner of monopam
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-spacedata: defer Eio examples and add missing mdx libs

Both [let ()] blocks called [Eio_main.run] at top level, so mdx ran
the live HTTP requests (failing on Space-Track 401 even when the
network was available). Wrap as [starlink_count ()] / [iss_orbit
~username ~password], switch to [Fmt.pr], and add [eio*] / [requests]
/ [fmt] to the mdx libraries.

+9 -9
+8 -8
ocaml-spacedata/README.md
··· 26 26 ## Usage 27 27 28 28 ```ocaml 29 - (* CelesTrak: no auth required *) 30 - let () = 29 + (* CelesTrak: no auth required. *) 30 + let starlink_count () = 31 31 Eio_main.run @@ fun env -> 32 32 Eio.Switch.run @@ fun sw -> 33 33 let session = Requests.v ~sw env in 34 34 let starlink = Spacedata.Celestrak.gp_by_group session "starlink" in 35 - Printf.printf "Starlink satellites: %d\n" (List.length starlink) 35 + Fmt.pr "Starlink satellites: %d@." (List.length starlink) 36 36 37 - (* Space-Track: requires account *) 38 - let () = 37 + (* Space-Track: requires account. *) 38 + let iss_orbit ~username ~password = 39 39 Eio_main.run @@ fun env -> 40 40 Eio.Switch.run @@ fun sw -> 41 41 let session = Requests.v ~sw env in 42 - Spacedata.Spacetrack.login session ~username:"..." ~password:"..."; 42 + Spacedata.Spacetrack.login session ~username ~password; 43 43 let iss = Spacedata.Spacetrack.gp_by_catnr session 25544 in 44 44 List.iter 45 45 (fun gp -> 46 - Printf.printf "%s: e=%.6f i=%.2f\n" 47 - gp.Spacedata.object_name gp.eccentricity gp.inclination) 46 + Fmt.pr "%s: e=%.6f i=%.2f@." gp.Spacedata.object_name gp.eccentricity 47 + gp.inclination) 48 48 iss 49 49 ``` 50 50
+1 -1
ocaml-spacedata/dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries spacedata eio_main)) 7 + (libraries spacedata eio_main eio eio.core eio.unix requests fmt))