From f0bdc0d0fab1054434557a8dca49db8eabf30e8e Mon Sep 17 00:00:00 2001 From: Carter Green Date: Tue, 22 Oct 2024 16:02:10 -0500 Subject: [PATCH 1/6] VER: Release 0.15.0 --- Cargo.lock | 309 ++++++++++++++++++++++------------------------------- 1 file changed, 125 insertions(+), 184 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4ebb96..2b26959 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "assert_cmd" @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "futures-core", "memchr", @@ -113,9 +113,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -129,7 +129,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cbindgen" @@ -175,9 +175,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -192,9 +192,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -202,9 +202,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -222,7 +222,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] @@ -325,7 +325,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", "trybuild", ] @@ -390,9 +390,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -405,9 +405,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -415,15 +415,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -432,32 +432,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -467,9 +467,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -485,9 +485,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -503,9 +503,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -531,12 +531,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -578,9 +578,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "linux-raw-sys" @@ -666,23 +666,23 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "pin-project-lite" @@ -704,9 +704,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -755,18 +755,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" +checksum = "3d922163ba1f79c04bc49073ba7b32fd5a8d3b76a87c955921234b8e77333c51" dependencies = [ "cfg-if", "indoc", @@ -782,9 +782,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" +checksum = "bc38c5feeb496c8321091edf3d63e9a6829eab4b863b4a6a65f26f3e9cc6b179" dependencies = [ "once_cell", "target-lexicon", @@ -792,9 +792,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" +checksum = "94845622d88ae274d2729fcefc850e63d7a3ddff5e3ce11bd88486db9f1d357d" dependencies = [ "libc", "pyo3-build-config", @@ -802,27 +802,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" +checksum = "e655aad15e09b94ffdb3ce3d217acf652e26bbc37697ef012f5e5e348c716e5e" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] name = "pyo3-macros-backend" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" +checksum = "ae1e3f09eecd94618f60a455a23def79f79eba4dc561a97324bf9ac8c6df30ce" dependencies = [ "heck 0.5.0", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] @@ -836,9 +836,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -848,9 +848,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -859,9 +859,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" @@ -895,7 +895,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.77", + "syn 2.0.82", "unicode-ident", ] @@ -929,9 +929,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -947,29 +947,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -979,9 +979,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1026,7 +1026,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] @@ -1042,9 +1042,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -1057,11 +1057,17 @@ version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -1081,12 +1087,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1097,22 +1103,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] @@ -1148,9 +1154,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -1166,7 +1172,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.82", ] [[package]] @@ -1201,11 +1207,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -1214,14 +1220,15 @@ dependencies = [ [[package]] name = "trybuild" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" dependencies = [ "glob", "serde", "serde_derive", "serde_json", + "target-triple", "termcolor", "toml 0.8.19", ] @@ -1283,22 +1290,13 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1307,22 +1305,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1331,46 +1314,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1383,48 +1348,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -1433,9 +1374,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] From a354ebe37e942a3431e2945107142f411775bb77 Mon Sep 17 00:00:00 2001 From: Carter Green Date: Wed, 23 Oct 2024 14:05:49 -0500 Subject: [PATCH 2/6] MOD: Upgrade dependencies --- Cargo.lock | 75 +++++++++++++------------------------- Cargo.toml | 8 ++-- c/Cargo.toml | 4 +- rust/dbn-cli/Cargo.toml | 6 +-- rust/dbn-macros/Cargo.toml | 10 ++--- rust/dbn/Cargo.toml | 2 +- 6 files changed, 40 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b26959..885d561 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,20 +157,20 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cbindgen" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" +checksum = "3fce8dd7fcfcbf3a0a87d8f515194b49d6135acab73e18bd380d1d93bb1a15eb" dependencies = [ "heck 0.4.1", - "indexmap 1.9.3", + "indexmap", "log", "proc-macro2", "quote", "serde", "serde_json", - "syn 1.0.109", + "syn 2.0.83", "tempfile", - "toml 0.5.11", + "toml", ] [[package]] @@ -222,7 +222,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -325,7 +325,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", "trybuild", ] @@ -444,7 +444,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -495,12 +495,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.15.0" @@ -519,16 +513,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.6.0" @@ -536,7 +520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown", ] [[package]] @@ -666,7 +650,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -809,7 +793,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -822,7 +806,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -871,9 +855,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "rstest" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afd55a67069d6e434a95161415f5beeada95a01c7b815508a82dcb0e1593682" +checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035" dependencies = [ "futures", "futures-timer", @@ -883,9 +867,9 @@ dependencies = [ [[package]] name = "rstest_macros" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4165dfae59a39dd41d8dec720d3cbfbc71f69744efb480a3920f5d4e0cc6798d" +checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a" dependencies = [ "cfg-if", "glob", @@ -895,7 +879,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.82", + "syn 2.0.83", "unicode-ident", ] @@ -962,7 +946,7 @@ checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -1026,7 +1010,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -1042,9 +1026,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.82" +version = "2.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +checksum = "01680f5d178a369f817f43f3d399650272873a8e7588a7872f7e90edc71d60a3" dependencies = [ "proc-macro2", "quote", @@ -1118,7 +1102,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.83", ] [[package]] @@ -1172,16 +1156,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", + "syn 2.0.83", ] [[package]] @@ -1211,7 +1186,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -1230,7 +1205,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.8.19", + "toml", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8b04547..55623c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,11 @@ repository = "https://github.com/databento/dbn" license = "Apache-2.0" [workspace.dependencies] -anyhow = "1.0.86" +anyhow = "1.0.91" csv = "1.3" -pyo3 = "0.22.3" -pyo3-build-config = "0.22.3" -rstest = "0.21.0" +pyo3 = "0.22.5" +pyo3-build-config = "0.22.5" +rstest = "0.23.0" serde = { version = "1.0", features = ["derive"] } time = ">=0.3.35" zstd = "0.13" diff --git a/c/Cargo.toml b/c/Cargo.toml index 5a43c34..d6f6e60 100644 --- a/c/Cargo.toml +++ b/c/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["staticlib"] [dependencies] anyhow = { workspace = true } dbn = { path = "../rust/dbn", features = [] } -libc = "0.2.155" +libc = "0.2.161" [build-dependencies] -cbindgen = { version = "0.26.0", default-features = false } +cbindgen = { version = "0.27.0", default-features = false } diff --git a/rust/dbn-cli/Cargo.toml b/rust/dbn-cli/Cargo.toml index 4cfbeb3..d4c1ca7 100644 --- a/rust/dbn-cli/Cargo.toml +++ b/rust/dbn-cli/Cargo.toml @@ -25,9 +25,9 @@ zstd = { workspace = true } [dev-dependencies] # CLI integration tests -assert_cmd = "2.0.14" +assert_cmd = "2.0.16" # assert_cmd companion -predicates = "3.1.0" +predicates = "3.1.2" rstest = { workspace = true } # A library for managing temporary files and directories -tempfile = "3.10.1" +tempfile = "3.13.0" diff --git a/rust/dbn-macros/Cargo.toml b/rust/dbn-macros/Cargo.toml index 27cc873..81d5964 100644 --- a/rust/dbn-macros/Cargo.toml +++ b/rust/dbn-macros/Cargo.toml @@ -12,14 +12,14 @@ proc-macro = true [dependencies] # Get name of current crate in macros, like $crate in macro_rules macros -proc-macro-crate = "3.1.0" -proc-macro2 = "1.0.86" +proc-macro-crate = "3.2.0" +proc-macro2 = "1.0.89" # Convert code to token streams -quote = "1.0.36" +quote = "1.0.37" # Token parsing -syn = { version = "2.0.69", features = ["full"] } +syn = { version = "2.0.83", features = ["full"] } [dev-dependencies] csv = { workspace = true } dbn = { path = "../dbn" } -trybuild = "1.0.97" +trybuild = "1.0.101" diff --git a/rust/dbn/Cargo.toml b/rust/dbn/Cargo.toml index 7a74112..6e4457e 100644 --- a/rust/dbn/Cargo.toml +++ b/rust/dbn/Cargo.toml @@ -27,7 +27,7 @@ trivial_copy = [] [dependencies] dbn-macros = { version = "=0.23.0", path = "../dbn-macros" } -async-compression = { version = "0.4.11", features = ["tokio", "zstd"], optional = true } +async-compression = { version = "0.4.17", features = ["tokio", "zstd"], optional = true } csv = { workspace = true } fallible-streaming-iterator = { version = "0.1.9", features = ["std"] } # Fast integer to string conversion From 821735dbc66f3a676e946ac1e7bc21b6eccdbc93 Mon Sep 17 00:00:00 2001 From: Carter Green Date: Wed, 30 Oct 2024 10:09:40 -0500 Subject: [PATCH 3/6] ADD: Add floating point getters for price fields --- CHANGELOG.md | 10 ++ rust/dbn/src/pretty.rs | 11 ++ rust/dbn/src/python/record.rs | 224 ++++++++++++--------------------- rust/dbn/src/record/methods.rs | 154 +++++++++++++++++++++++ 4 files changed, 258 insertions(+), 141 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2311844..dc54721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.23.1 - TBD + +### Enhancements +- Added floating-point getters for price fields + +### Bug fixes +- Fixed `pretty_activation` getter in `databento_dbn` returning `expiration` instead + of `activation` +- Fixed some `pretty_` getters in `databento_dbn` didn't correctly handle `UNDEF_PRICE` + ## 0.23.0 - 2024-10-22 ### Enhancements diff --git a/rust/dbn/src/pretty.rs b/rust/dbn/src/pretty.rs index de2f73e..ba691a7 100644 --- a/rust/dbn/src/pretty.rs +++ b/rust/dbn/src/pretty.rs @@ -81,6 +81,17 @@ pub fn fmt_ts(ts: u64) -> String { } } +/// Converts a fixed-precision price to a floating point. +/// +/// `UNDEF_PRICE` will be converted to NaN. +pub fn px_to_f64(px: i64) -> f64 { + if px == crate::UNDEF_PRICE { + f64::NAN + } else { + px as f64 / FIXED_PRICE_SCALE as f64 + } +} + #[cfg(test)] mod tests { use crate::UNDEF_PRICE; diff --git a/rust/dbn/src/python/record.rs b/rust/dbn/src/python/record.rs index 70cc6f7..7f42cac 100644 --- a/rust/dbn/src/python/record.rs +++ b/rust/dbn/src/python/record.rs @@ -9,13 +9,13 @@ use pyo3::{ use crate::{ compat::{ErrorMsgV1, InstrumentDefMsgV1, SymbolMappingMsgV1, SystemMsgV1}, + pretty::px_to_f64, record::str_to_c_chars, rtype, BboMsg, BidAskPair, CbboMsg, Cmbp1Msg, ConsolidatedBidAskPair, ErrorMsg, FlagSet, - HasRType, ImbalanceMsg, InstrumentDefMsg, MboMsg, Mbp10Msg, Mbp1Msg, OhlcvMsg, Publisher, - Record, RecordHeader, SType, SecurityUpdateAction, StatMsg, StatUpdateAction, StatusAction, - StatusMsg, StatusReason, SymbolMappingMsg, SystemMsg, TradeMsg, TradingEvent, TriState, - UserDefinedInstrument, WithTsOut, FIXED_PRICE_SCALE, UNDEF_ORDER_SIZE, UNDEF_PRICE, - UNDEF_TIMESTAMP, + HasRType, ImbalanceMsg, InstrumentDefMsg, MboMsg, Mbp10Msg, Mbp1Msg, OhlcvMsg, Record, + RecordHeader, SType, SecurityUpdateAction, StatMsg, StatUpdateAction, StatusAction, StatusMsg, + StatusReason, SymbolMappingMsg, SystemMsg, TradeMsg, TradingEvent, TriState, + UserDefinedInstrument, WithTsOut, UNDEF_ORDER_SIZE, UNDEF_PRICE, UNDEF_TIMESTAMP, }; use super::{to_py_err, PyFieldDesc}; @@ -122,17 +122,17 @@ impl MboMsg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -227,18 +227,12 @@ impl BidAskPair { #[getter] fn get_pretty_ask_px(&self) -> f64 { - match self.ask_px { - UNDEF_PRICE => f64::NAN, - _ => self.ask_px as f64 / FIXED_PRICE_SCALE as f64, - } + self.ask_px_f64() } #[getter] fn get_pretty_bid_px(&self) -> f64 { - match self.bid_px { - UNDEF_PRICE => f64::NAN, - _ => self.bid_px as f64 / FIXED_PRICE_SCALE as f64, - } + self.bid_px_f64() } fn __richcmp__(&self, other: &Self, op: CompareOp, py: Python<'_>) -> Py { @@ -341,17 +335,17 @@ impl BboMsg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -488,17 +482,17 @@ impl Cmbp1Msg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -645,17 +639,17 @@ impl CbboMsg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -737,32 +731,22 @@ impl ConsolidatedBidAskPair { #[getter] fn get_pretty_ask_px(&self) -> f64 { - match self.ask_px { - UNDEF_PRICE => f64::NAN, - _ => self.ask_px as f64 / FIXED_PRICE_SCALE as f64, - } + self.ask_px_f64() } #[getter] fn get_pretty_bid_px(&self) -> f64 { - match self.bid_px { - UNDEF_PRICE => f64::NAN, - _ => self.bid_px as f64 / FIXED_PRICE_SCALE as f64, - } + self.bid_px_f64() } #[getter] fn get_pretty_ask_pb(&self) -> Option { - Publisher::try_from(self.ask_pb) - .map(|pb| pb.as_str().to_owned()) - .ok() + self.ask_pb().map(|pb| pb.to_string()).ok() } #[getter] fn get_pretty_bid_pb(&self) -> Option { - Publisher::try_from(self.bid_pb) - .map(|pb| pb.as_str().to_owned()) - .ok() + self.bid_pb().map(|pb| pb.to_string()).ok() } fn __richcmp__(&self, other: &Self, op: CompareOp, py: Python<'_>) -> Py { @@ -866,17 +850,17 @@ impl TradeMsg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -1031,17 +1015,17 @@ impl Mbp1Msg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -1208,17 +1192,17 @@ impl Mbp10Msg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -1349,27 +1333,27 @@ impl OhlcvMsg { #[getter] fn get_pretty_open(&self) -> f64 { - self.open as f64 / FIXED_PRICE_SCALE as f64 + self.open_f64() } #[getter] fn get_pretty_high(&self) -> f64 { - self.high as f64 / FIXED_PRICE_SCALE as f64 + self.high_f64() } #[getter] fn get_pretty_low(&self) -> f64 { - self.low as f64 / FIXED_PRICE_SCALE as f64 + self.low_f64() } #[getter] fn get_pretty_close(&self) -> f64 { - self.close as f64 / FIXED_PRICE_SCALE as f64 + self.close_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[pyo3(name = "record_size")] @@ -1496,12 +1480,12 @@ impl StatusMsg { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[pyo3(name = "record_size")] @@ -1807,83 +1791,62 @@ impl InstrumentDefMsg { #[getter] fn get_pretty_min_price_increment(&self) -> f64 { - self.min_price_increment as f64 / FIXED_PRICE_SCALE as f64 + px_to_f64(self.min_price_increment) } #[getter] fn get_pretty_high_limit_price(&self) -> f64 { - match self.high_limit_price { - UNDEF_PRICE => f64::NAN, - _ => self.high_limit_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.high_limit_price) } #[getter] fn get_pretty_low_limit_price(&self) -> f64 { - match self.low_limit_price { - UNDEF_PRICE => f64::NAN, - _ => self.low_limit_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.low_limit_price) } #[getter] fn get_pretty_max_price_variation(&self) -> f64 { - match self.max_price_variation { - UNDEF_PRICE => f64::NAN, - _ => self.max_price_variation as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.max_price_variation) } #[getter] fn get_pretty_trading_reference_price(&self) -> f64 { - match self.trading_reference_price { - UNDEF_PRICE => f64::NAN, - _ => self.trading_reference_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.trading_reference_price) } #[getter] fn get_pretty_min_price_increment_amount(&self) -> f64 { - match self.min_price_increment_amount { - UNDEF_PRICE => f64::NAN, - _ => self.min_price_increment_amount as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.min_price_increment_amount) } #[getter] fn get_pretty_price_ratio(&self) -> f64 { - match self.price_ratio { - UNDEF_PRICE => f64::NAN, - _ => self.price_ratio as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.price_ratio) } #[getter] fn get_pretty_strike_price(&self) -> f64 { - match self.strike_price { - UNDEF_PRICE => f64::NAN, - _ => self.strike_price as f64 / FIXED_PRICE_SCALE as f64, - } + self.strike_price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[getter] fn get_pretty_activation(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.expiration) + new_py_timestamp_or_datetime(py, self.activation) } #[getter] fn get_pretty_expiration(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.expiration) + new_py_timestamp_or_datetime(py, self.expiration) } #[pyo3(name = "record_size")] @@ -2273,83 +2236,62 @@ impl InstrumentDefMsgV1 { #[getter] fn get_pretty_min_price_increment(&self) -> f64 { - self.min_price_increment as f64 / FIXED_PRICE_SCALE as f64 + px_to_f64(self.min_price_increment) } #[getter] fn get_pretty_high_limit_price(&self) -> f64 { - match self.high_limit_price { - UNDEF_PRICE => f64::NAN, - _ => self.high_limit_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.high_limit_price) } #[getter] fn get_pretty_low_limit_price(&self) -> f64 { - match self.low_limit_price { - UNDEF_PRICE => f64::NAN, - _ => self.low_limit_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.low_limit_price) } #[getter] fn get_pretty_max_price_variation(&self) -> f64 { - match self.max_price_variation { - UNDEF_PRICE => f64::NAN, - _ => self.max_price_variation as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.max_price_variation) } #[getter] fn get_pretty_trading_reference_price(&self) -> f64 { - match self.trading_reference_price { - UNDEF_PRICE => f64::NAN, - _ => self.trading_reference_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.trading_reference_price) } #[getter] fn get_pretty_min_price_increment_amount(&self) -> f64 { - match self.min_price_increment_amount { - UNDEF_PRICE => f64::NAN, - _ => self.min_price_increment_amount as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.min_price_increment_amount) } #[getter] fn get_pretty_price_ratio(&self) -> f64 { - match self.price_ratio { - UNDEF_PRICE => f64::NAN, - _ => self.price_ratio as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.price_ratio) } #[getter] fn get_pretty_strike_price(&self) -> f64 { - match self.strike_price { - UNDEF_PRICE => f64::NAN, - _ => self.strike_price as f64 / FIXED_PRICE_SCALE as f64, - } + px_to_f64(self.strike_price) } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[getter] fn get_pretty_activation(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.expiration) + new_py_timestamp_or_datetime(py, self.activation) } #[getter] fn get_pretty_expiration(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.expiration) + new_py_timestamp_or_datetime(py, self.expiration) } #[pyo3(name = "record_size")] @@ -2569,17 +2511,17 @@ impl ImbalanceMsg { #[getter] fn get_pretty_auct_interest_clr_price(&self) -> f64 { - self.auct_interest_clr_price as f64 / FIXED_PRICE_SCALE as f64 + self.auct_interest_clr_price_f64() } #[getter] fn get_pretty_cont_book_clear_price(&self) -> f64 { - self.cont_book_clr_price as f64 / FIXED_PRICE_SCALE as f64 + self.cont_book_clr_price_f64() } #[getter] fn get_pretty_ref_price(&self) -> f64 { - self.ref_price as f64 / FIXED_PRICE_SCALE as f64 + self.ref_price_f64() } #[pyo3(name = "record_size")] @@ -2589,12 +2531,12 @@ impl ImbalanceMsg { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[classattr] @@ -2764,22 +2706,22 @@ impl StatMsg { #[getter] fn get_pretty_price(&self) -> f64 { - self.price as f64 / FIXED_PRICE_SCALE as f64 + self.price_f64() } #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_ts_recv(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_recv) + new_py_timestamp_or_datetime(py, self.ts_recv) } #[getter] fn get_pretty_ts_ref(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_ref) + new_py_timestamp_or_datetime(py, self.ts_ref) } #[pyo3(name = "record_size")] @@ -2874,7 +2816,7 @@ impl ErrorMsg { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[pyo3(name = "record_size")] @@ -2973,7 +2915,7 @@ impl ErrorMsgV1 { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[pyo3(name = "record_size")] @@ -3095,17 +3037,17 @@ impl SymbolMappingMsg { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_end_ts(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.end_ts) + new_py_timestamp_or_datetime(py, self.end_ts) } #[getter] fn get_pretty_start_ts(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.start_ts) + new_py_timestamp_or_datetime(py, self.start_ts) } #[pyo3(name = "record_size")] @@ -3239,17 +3181,17 @@ impl SymbolMappingMsgV1 { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[getter] fn get_pretty_end_ts(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.end_ts) + new_py_timestamp_or_datetime(py, self.end_ts) } #[getter] fn get_pretty_start_ts(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.start_ts) + new_py_timestamp_or_datetime(py, self.start_ts) } #[pyo3(name = "record_size")] @@ -3353,7 +3295,7 @@ impl SystemMsg { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[pyo3(name = "record_size")] @@ -3457,7 +3399,7 @@ impl SystemMsgV1 { #[getter] fn get_pretty_ts_event(&self, py: Python<'_>) -> PyResult { - get_utc_nanosecond_timestamp(py, self.ts_event()) + new_py_timestamp_or_datetime(py, self.ts_event()) } #[pyo3(name = "record_size")] @@ -3610,7 +3552,7 @@ impl>> IntoPy for WithTsOut { } } -fn get_utc_nanosecond_timestamp(py: Python<'_>, timestamp: u64) -> PyResult { +fn new_py_timestamp_or_datetime(py: Python<'_>, timestamp: u64) -> PyResult { if let Ok(pandas) = PyModule::import_bound(py, intern!(py, "pandas")) { let kwargs = PyDict::new_bound(py); if kwargs.set_item(intern!(py, "utc"), true).is_ok() diff --git a/rust/dbn/src/record/methods.rs b/rust/dbn/src/record/methods.rs index 410ab43..a8707a2 100644 --- a/rust/dbn/src/record/methods.rs +++ b/rust/dbn/src/record/methods.rs @@ -5,6 +5,7 @@ use num_enum::TryFromPrimitive; use crate::{ compat::{ErrorMsgV1, InstrumentDefMsgV1, SymbolMappingMsgV1, SystemMsgV1}, enums::{StatusAction, StatusReason}, + pretty::px_to_f64, SType, TradingEvent, TriState, }; @@ -89,6 +90,13 @@ impl Debug for RecordHeader { } impl MboMsg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw order side to an enum. /// /// # Errors @@ -121,7 +129,30 @@ impl MboMsg { } } +impl BidAskPair { + /// Returns the bid price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn bid_px_f64(&self) -> f64 { + px_to_f64(self.bid_px) + } + + /// Returns the ask price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn ask_px_f64(&self) -> f64 { + px_to_f64(self.ask_px) + } +} + impl TradeMsg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw order side to an enum. /// /// # Errors @@ -155,6 +186,13 @@ impl TradeMsg { } impl BboMsg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw `side` to an enum. /// /// # Errors @@ -173,6 +211,13 @@ impl BboMsg { } impl Cmbp1Msg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw `side` to an enum. /// /// # Errors @@ -206,6 +251,13 @@ impl Cmbp1Msg { } impl CbboMsg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw `side` to an enum. /// /// # Errors @@ -224,6 +276,20 @@ impl CbboMsg { } impl ConsolidatedBidAskPair { + /// Returns the bid price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn bid_px_f64(&self) -> f64 { + px_to_f64(self.bid_px) + } + + /// Returns the ask price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn ask_px_f64(&self) -> f64 { + px_to_f64(self.ask_px) + } + /// Tries to convert the raw `bid_pb` into an enum which is useful for /// exhaustive pattern matching. /// @@ -248,6 +314,13 @@ impl ConsolidatedBidAskPair { } impl Mbp1Msg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw `side` to an enum. /// /// # Errors @@ -281,6 +354,13 @@ impl Mbp1Msg { } impl Mbp10Msg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Tries to convert the raw `side` to an enum. /// /// # Errors @@ -313,6 +393,36 @@ impl Mbp10Msg { } } +impl OhlcvMsg { + /// Returns the open price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn open_f64(&self) -> f64 { + px_to_f64(self.open) + } + + /// Returns the high price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn high_f64(&self) -> f64 { + px_to_f64(self.high) + } + + /// Returns the low price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn low_f64(&self) -> f64 { + px_to_f64(self.low) + } + + /// Returns the close price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn close_f64(&self) -> f64 { + px_to_f64(self.close) + } +} + impl StatusMsg { /// Tries to convert the raw status action to an enum. /// @@ -376,6 +486,20 @@ impl InstrumentDefMsg { ts_to_dt(self.ts_recv) } + /// Returns the unit of measure quantity as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn unit_of_measure_qty_f64(&self) -> f64 { + px_to_f64(self.unit_of_measure_qty) + } + + /// Returns the strike price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn strike_price_f64(&self) -> f64 { + px_to_f64(self.strike_price) + } + /// Parses the raw last eligible trade time into a datetime. Returns `None` if /// `expiration` contains the sentinel for a null timestamp. pub fn expiration(&self) -> Option { @@ -670,9 +794,39 @@ impl ImbalanceMsg { pub fn ts_recv(&self) -> Option { ts_to_dt(self.ts_recv) } + + /// Returns the reference price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn ref_price_f64(&self) -> f64 { + px_to_f64(self.ref_price) + } + + /// Returns the hypothetical auction-clearing price for cross and continuous orders + /// as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn cont_book_clr_price_f64(&self) -> f64 { + px_to_f64(self.cont_book_clr_price) + } + + /// Returns the hypothetical auction-clearing price for cross orders only as a + /// floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn auct_interest_clr_price_f64(&self) -> f64 { + px_to_f64(self.auct_interest_clr_price) + } } impl StatMsg { + /// Returns the price as a floating point. + /// + /// `UNDEF_PRICE` will be converted to NaN. + pub fn price_f64(&self) -> f64 { + px_to_f64(self.price) + } + /// Parses the raw capture-server-received timestamp into a datetime. Returns `None` /// if `ts_recv` contains the sentinel for a null timestamp. pub fn ts_recv(&self) -> Option { From 095d052c536fc0fd60e4e4520786366797105f81 Mon Sep 17 00:00:00 2001 From: Carter Green Date: Fri, 8 Nov 2024 09:27:41 -0600 Subject: [PATCH 4/6] FIX: Fix and silence clippy lints in tests --- rust/dbn-cli/src/lib.rs | 2 ++ rust/dbn-cli/tests/integration_tests.rs | 4 ++-- rust/dbn/src/decode/dbn/async.rs | 2 ++ rust/dbn/src/decode/dbn/sync.rs | 2 ++ rust/dbn/src/encode/csv/sync.rs | 2 ++ rust/dbn/src/encode/json/sync.rs | 2 ++ rust/dbn/src/macros.rs | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rust/dbn-cli/src/lib.rs b/rust/dbn-cli/src/lib.rs index 4662f7f..80a9395 100644 --- a/rust/dbn-cli/src/lib.rs +++ b/rust/dbn-cli/src/lib.rs @@ -289,6 +289,8 @@ fn open_output_file(path: &PathBuf, force: bool) -> anyhow::Result { #[cfg(test)] mod tests { + #![allow(clippy::too_many_arguments)] + use rstest::*; use super::*; diff --git a/rust/dbn-cli/tests/integration_tests.rs b/rust/dbn-cli/tests/integration_tests.rs index cff1326..97b7b43 100644 --- a/rust/dbn-cli/tests/integration_tests.rs +++ b/rust/dbn-cli/tests/integration_tests.rs @@ -712,7 +712,7 @@ fn omit_csv_header(#[case] output_enc: &str, #[case] sep: char) { .stdout( contains('\n') .count(2) - .and(contains(&format!("ts_event{sep}")).not()), + .and(contains(format!("ts_event{sep}")).not()), ) .stderr(is_empty()); } @@ -733,7 +733,7 @@ fn omit_csv_header_fragment(#[case] output_enc: &str, #[case] sep: char) { .stdout( contains('\n') .count(2) - .and(contains(&format!("ts_event{sep}")).not()), + .and(contains(format!("ts_event{sep}")).not()), ) .stderr(is_empty()); } diff --git a/rust/dbn/src/decode/dbn/async.rs b/rust/dbn/src/decode/dbn/async.rs index 1f93d30..d3d0219 100644 --- a/rust/dbn/src/decode/dbn/async.rs +++ b/rust/dbn/src/decode/dbn/async.rs @@ -645,6 +645,8 @@ impl Buffer for Cursor> { #[cfg(test)] mod tests { + #![allow(clippy::clone_on_copy)] + use rstest::rstest; use tokio::io::AsyncWriteExt; diff --git a/rust/dbn/src/decode/dbn/sync.rs b/rust/dbn/src/decode/dbn/sync.rs index 397312d..4de65e5 100644 --- a/rust/dbn/src/decode/dbn/sync.rs +++ b/rust/dbn/src/decode/dbn/sync.rs @@ -672,6 +672,8 @@ pub(crate) fn decode_iso8601(raw: u32) -> Result { #[cfg(test)] mod tests { + #![allow(clippy::clone_on_copy)] + use std::fs::File; use rstest::rstest; diff --git a/rust/dbn/src/encode/csv/sync.rs b/rust/dbn/src/encode/csv/sync.rs index 7a1f252..30f38a0 100644 --- a/rust/dbn/src/encode/csv/sync.rs +++ b/rust/dbn/src/encode/csv/sync.rs @@ -381,6 +381,8 @@ where #[cfg(test)] mod tests { + #![allow(clippy::clone_on_copy)] + use std::{array, io::BufWriter, os::raw::c_char}; use rstest::*; diff --git a/rust/dbn/src/encode/json/sync.rs b/rust/dbn/src/encode/json/sync.rs index 1786900..e30b27e 100644 --- a/rust/dbn/src/encode/json/sync.rs +++ b/rust/dbn/src/encode/json/sync.rs @@ -200,6 +200,8 @@ where #[cfg(test)] mod tests { + #![allow(clippy::clone_on_copy)] + use std::{array, io::BufWriter, num::NonZeroU64, os::raw::c_char}; use super::*; diff --git a/rust/dbn/src/macros.rs b/rust/dbn/src/macros.rs index 62f2939..9d2c854 100644 --- a/rust/dbn/src/macros.rs +++ b/rust/dbn/src/macros.rs @@ -337,6 +337,7 @@ mod tests { T::has_rtype(0xFF) } + #[allow(clippy::extra_unused_type_parameters)] fn on_rtype_2(&self, x: u64, y: u64) -> u64 { x + y } From 641fbdbf1116b95191b07d56f262b0ac55c48f0e Mon Sep 17 00:00:00 2001 From: Jack Culhane Date: Mon, 11 Nov 2024 16:53:56 -0600 Subject: [PATCH 5/6] ADD: Add three IntelligentCross MICs to Venue list --- CHANGELOG.md | 1 + rust/dbn/src/publishers.rs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc54721..9ce63c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Enhancements - Added floating-point getters for price fields +- Added new IntelligentCross venues `ASPN`, `ASMT`, and `ASPI` ### Bug fixes - Fixed `pretty_activation` getter in `databento_dbn` returning `expiration` instead diff --git a/rust/dbn/src/publishers.rs b/rust/dbn/src/publishers.rs index 2a1e0ed..8288bdc 100644 --- a/rust/dbn/src/publishers.rs +++ b/rust/dbn/src/publishers.rs @@ -97,10 +97,16 @@ pub enum Venue { Ltse = 42, /// Off-Exchange Transactions - Listed Instruments Xoff = 43, + /// IntelligentCross ASPEN Intelligent Bid/Offer + Aspn = 44, + /// IntelligentCross ASPEN Maker/Taker + Asmt = 45, + /// IntelligentCross ASPEN Inverted + Aspi = 46, } /// The number of Venue variants. -pub const VENUE_COUNT: usize = 43; +pub const VENUE_COUNT: usize = 46; impl Venue { /// Convert a Venue to its `str` representation. @@ -149,6 +155,9 @@ impl Venue { Self::Sphr => "SPHR", Self::Ltse => "LTSE", Self::Xoff => "XOFF", + Self::Aspn => "ASPN", + Self::Asmt => "ASMT", + Self::Aspi => "ASPI", } } } @@ -213,6 +222,9 @@ impl std::str::FromStr for Venue { "SPHR" => Ok(Self::Sphr), "LTSE" => Ok(Self::Ltse), "XOFF" => Ok(Self::Xoff), + "ASPN" => Ok(Self::Aspn), + "ASMT" => Ok(Self::Asmt), + "ASPI" => Ok(Self::Aspi), _ => Err(Error::conversion::(s)), } } From 1ad19825cb0b8ecec06e8c737ac68132eb27931c Mon Sep 17 00:00:00 2001 From: Carter Green Date: Mon, 11 Nov 2024 12:00:08 -0600 Subject: [PATCH 6/6] VER: Release 0.23.1 --- CHANGELOG.md | 4 +- Cargo.lock | 82 +++++++++++++++++++------------------- Cargo.toml | 8 ++-- c/Cargo.toml | 2 +- python/pyproject.toml | 4 +- rust/dbn-cli/Cargo.toml | 4 +- rust/dbn-macros/Cargo.toml | 2 +- rust/dbn/Cargo.toml | 4 +- rust/dbn/src/record.rs | 14 ++++--- 9 files changed, 65 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce63c2..28ac3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # Changelog -## 0.23.1 - TBD +## 0.23.1 - 2024-11-12 ### Enhancements - Added floating-point getters for price fields - Added new IntelligentCross venues `ASPN`, `ASMT`, and `ASPI` +- Upgraded `thiserror` version to 2.0 +- Upgraded `pyo3` version to 0.22.6 ### Bug fixes - Fixed `pretty_activation` getter in `databento_dbn` returning `expiration` instead diff --git a/Cargo.lock b/Cargo.lock index 885d561..35297f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "assert_cmd" @@ -168,7 +168,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.83", + "syn 2.0.87", "tempfile", "toml", ] @@ -222,7 +222,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "databento-dbn" -version = "0.23.0" +version = "0.23.1" dependencies = [ "dbn", "pyo3", @@ -271,7 +271,7 @@ dependencies = [ [[package]] name = "dbn" -version = "0.23.0" +version = "0.23.1" dependencies = [ "async-compression", "csv", @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "dbn-c" -version = "0.23.0" +version = "0.23.1" dependencies = [ "anyhow", "cbindgen", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "dbn-cli" -version = "0.23.0" +version = "0.23.1" dependencies = [ "anyhow", "assert_cmd", @@ -318,14 +318,14 @@ dependencies = [ [[package]] name = "dbn-macros" -version = "0.23.0" +version = "0.23.1" dependencies = [ "csv", "dbn", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", "trybuild", ] @@ -444,7 +444,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -562,9 +562,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.161" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "linux-raw-sys" @@ -650,7 +650,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -748,9 +748,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d922163ba1f79c04bc49073ba7b32fd5a8d3b76a87c955921234b8e77333c51" +checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884" dependencies = [ "cfg-if", "indoc", @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc38c5feeb496c8321091edf3d63e9a6829eab4b863b4a6a65f26f3e9cc6b179" +checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38" dependencies = [ "once_cell", "target-lexicon", @@ -776,9 +776,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94845622d88ae274d2729fcefc850e63d7a3ddff5e3ce11bd88486db9f1d357d" +checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636" dependencies = [ "libc", "pyo3-build-config", @@ -786,27 +786,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e655aad15e09b94ffdb3ce3d217acf652e26bbc37697ef012f5e5e348c716e5e" +checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] name = "pyo3-macros-backend" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1e3f09eecd94618f60a455a23def79f79eba4dc561a97324bf9ac8c6df30ce" +checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe" dependencies = [ "heck 0.5.0", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -879,7 +879,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.83", + "syn 2.0.87", "unicode-ident", ] @@ -900,9 +900,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags", "errno", @@ -946,7 +946,7 @@ checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -1010,7 +1010,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -1026,9 +1026,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.83" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01680f5d178a369f817f43f3d399650272873a8e7588a7872f7e90edc71d60a3" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -1049,9 +1049,9 @@ checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -1087,22 +1087,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] @@ -1156,7 +1156,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 55623c3..b3043fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,16 +11,16 @@ resolver = "2" [workspace.package] authors = ["Databento "] edition = "2021" -version = "0.23.0" +version = "0.23.1" documentation = "https://databento.com/docs" repository = "https://github.com/databento/dbn" license = "Apache-2.0" [workspace.dependencies] -anyhow = "1.0.91" +anyhow = "1.0.93" csv = "1.3" -pyo3 = "0.22.5" -pyo3-build-config = "0.22.5" +pyo3 = "0.22.6" +pyo3-build-config = "0.22.6" rstest = "0.23.0" serde = { version = "1.0", features = ["derive"] } time = ">=0.3.35" diff --git a/c/Cargo.toml b/c/Cargo.toml index d6f6e60..317163b 100644 --- a/c/Cargo.toml +++ b/c/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["staticlib"] [dependencies] anyhow = { workspace = true } dbn = { path = "../rust/dbn", features = [] } -libc = "0.2.161" +libc = "0.2.162" [build-dependencies] cbindgen = { version = "0.27.0", default-features = false } diff --git a/python/pyproject.toml b/python/pyproject.toml index 07416ed..da4960b 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "databento-dbn" -version = "0.23.0" +version = "0.23.1" description = "Python bindings for encoding and decoding Databento Binary Encoding (DBN)" authors = ["Databento "] license = "Apache-2.0" @@ -17,7 +17,7 @@ build-backend = "maturin" [project] name = "databento-dbn" -version = "0.23.0" +version = "0.23.1" authors = [ { name = "Databento", email = "support@databento.com" } ] diff --git a/rust/dbn-cli/Cargo.toml b/rust/dbn-cli/Cargo.toml index d4c1ca7..caf6c48 100644 --- a/rust/dbn-cli/Cargo.toml +++ b/rust/dbn-cli/Cargo.toml @@ -16,7 +16,7 @@ name = "dbn" path = "src/main.rs" [dependencies] -dbn = { path = "../dbn", version = "=0.23.0", default-features = false } +dbn = { path = "../dbn", version = "=0.23.1", default-features = false } anyhow = { workspace = true } clap = { version = "4.5", features = ["derive", "wrap_help"] } @@ -30,4 +30,4 @@ assert_cmd = "2.0.16" predicates = "3.1.2" rstest = { workspace = true } # A library for managing temporary files and directories -tempfile = "3.13.0" +tempfile = "3.14.0" diff --git a/rust/dbn-macros/Cargo.toml b/rust/dbn-macros/Cargo.toml index 81d5964..510ff7b 100644 --- a/rust/dbn-macros/Cargo.toml +++ b/rust/dbn-macros/Cargo.toml @@ -17,7 +17,7 @@ proc-macro2 = "1.0.89" # Convert code to token streams quote = "1.0.37" # Token parsing -syn = { version = "2.0.83", features = ["full"] } +syn = { version = "2.0", features = ["full"] } [dev-dependencies] csv = { workspace = true } diff --git a/rust/dbn/Cargo.toml b/rust/dbn/Cargo.toml index 6e4457e..f47fa1a 100644 --- a/rust/dbn/Cargo.toml +++ b/rust/dbn/Cargo.toml @@ -25,7 +25,7 @@ serde = ["dep:serde", "time/parsing", "time/serde"] trivial_copy = [] [dependencies] -dbn-macros = { version = "=0.23.0", path = "../dbn-macros" } +dbn-macros = { version = "=0.23.1", path = "../dbn-macros" } async-compression = { version = "0.4.17", features = ["tokio", "zstd"], optional = true } csv = { workspace = true } @@ -38,7 +38,7 @@ json-writer = "0.4" serde = { workspace = true, features = ["derive"], optional = true } # extra enum traits for Python strum = { version = "0.26", features = ["derive"], optional = true } -thiserror = "1.0" +thiserror = "2.0" time = { workspace = true, features = ["formatting", "macros"] } tokio = { version = ">=1.28", features = ["fs", "io-util"], optional = true } zstd = { workspace = true } diff --git a/rust/dbn/src/record.rs b/rust/dbn/src/record.rs index 515356d..f104230 100644 --- a/rust/dbn/src/record.rs +++ b/rust/dbn/src/record.rs @@ -1315,14 +1315,16 @@ mod tests { #[case::header(RecordHeader::default::(rtype::MBO), 16)] #[case::mbo(MboMsg::default(), 56)] #[case::ba_pair(BidAskPair::default(), 32)] + #[case::cba_pair(ConsolidatedBidAskPair::default(), mem::size_of::())] + #[case::trade(TradeMsg::default(), 48)] #[case::mbp1(Mbp1Msg::default(), mem::size_of::() + mem::size_of::())] #[case::mbp10(Mbp10Msg::default(), mem::size_of::() + mem::size_of::() * 10)] #[case::bbo(BboMsg::default_for_schema(Schema::Bbo1S), mem::size_of::())] #[case::cmbp1(Cmbp1Msg::default_for_schema(Schema::Cmbp1), mem::size_of::())] #[case::cbbo(CbboMsg::default_for_schema(Schema::Cbbo1S), mem::size_of::())] - #[case::trade(TradeMsg::default(), 48)] - #[case::definition(InstrumentDefMsg::default(), 400)] + #[case::ohlcv(OhlcvMsg::default_for_schema(Schema::Ohlcv1S), 56)] #[case::status(StatusMsg::default(), 40)] + #[case::definition(InstrumentDefMsg::default(), 400)] #[case::imbalance(ImbalanceMsg::default(), 112)] #[case::stat(StatMsg::default(), 64)] #[case::error(ErrorMsg::default(), 320)] @@ -1338,14 +1340,16 @@ mod tests { #[case::header(RecordHeader::default::(rtype::MBO))] #[case::mbo(MboMsg::default())] #[case::ba_pair(BidAskPair::default())] + #[case::cba_pair(ConsolidatedBidAskPair::default())] + #[case::trade(TradeMsg::default())] #[case::mbp1(Mbp1Msg::default())] + #[case::mbp10(Mbp10Msg::default())] #[case::bbo(BboMsg::default_for_schema(crate::Schema::Bbo1S))] #[case::cmbp1(Cmbp1Msg::default_for_schema(crate::Schema::Cmbp1))] #[case::cbbo(CbboMsg::default_for_schema(crate::Schema::Cbbo1S))] - #[case::mbp10(Mbp10Msg::default())] - #[case::trade(TradeMsg::default())] - #[case::definition(InstrumentDefMsg::default())] + #[case::ohlcv(OhlcvMsg::default_for_schema(Schema::Ohlcv1S))] #[case::status(StatusMsg::default())] + #[case::definition(InstrumentDefMsg::default())] #[case::imbalance(ImbalanceMsg::default())] #[case::stat(StatMsg::default())] #[case::error(ErrorMsg::default())]