Skip to content

Commit

Permalink
Release 0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen authored Jul 30, 2024
2 parents a5b78fa + e7e68dc commit e5be52a
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 20 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# Changelog

## 0.21.0 - 2024-07-30

### Enhancements
- Added new publisher value for `DBEQ.SUMMARY`

### Breaking changes
- Renamed `SType::Nasdaq` variant to `SType::NasdaqSymbol`
- Renamed `SType::Cms` variant to `SType::CmsSymbol`

### Bug fixes
- Added missing `ToString` and `FromString` branches for `SType::NasdaqSymbol` and
`SType::CmsSymbol`
- Removed `has_header_v` variable template that broke C++11 compatibility

## 0.20.1 - 2024-07-16

### Enhancements
- Improved installation with `CMake`: license is now installed, transitive dependencies are configured
when importing package
- Improved installation with `CMake`: license is now installed, transitive dependencies
are configured when importing package

## 0.20.0 - 2024-07-09

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
# Project details
#

project("databento" VERSION 0.20.1 LANGUAGES CXX)
project("databento" VERSION 0.21.0 LANGUAGES CXX)
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)

#
Expand Down
4 changes: 2 additions & 2 deletions include/databento/dbn_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class DbnEncoder {
template <typename R>
void EncodeRecord(const R& record) {
static_assert(
has_header_v<R>,
has_header<R>::value,
"must be a DBN record struct with an `hd` RecordHeader field");
EncodeRecord(Record{&record.hd});
}
template <typename R>
void EncodeRecord(const WithTsOut<R> record) {
static_assert(
has_header_v<R>,
has_header<R>::value,
"must be a DBN record struct with an `hd` RecordHeader field");
EncodeRecord(Record{&record.rec.hd});
}
Expand Down
6 changes: 3 additions & 3 deletions include/databento/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <iosfwd>
#include <string>

#include "databento/publishers.hpp" // Dataset, Publisher, Venue, FromString
#include "databento/publishers.hpp" // FromString

namespace databento {
// Represents a historical data center gateway location.
Expand Down Expand Up @@ -70,9 +70,9 @@ enum SType : std::uint8_t {
// "parent" symbol, e.g. ES.FUT to refer to all ES futures.
Parent = 4,
// Symbology for US equities using NASDAQ Integrated suffix conventions.
Nasdaq = 5,
NasdaqSymbol = 5,
// Symbology for US equities using CMS suffix conventions.
Cms = 6,
CmsSymbol = 6,
};
} // namespace stype
using SType = stype::SType;
Expand Down
4 changes: 4 additions & 0 deletions include/databento/publishers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ enum class Dataset : std::uint16_t {
DbeqMax = 30,
// Nasdaq Basic (NLS+QBBO)
XnasBasic = 31,
// Databento Equities Summary
DbeqSummary = 32,
};

// A specific Venue from a specific data source.
Expand Down Expand Up @@ -341,6 +343,8 @@ enum class Publisher : std::uint16_t {
XnasBasicXbos = 88,
// Nasdaq Basic - Nasdaq PSX
XnasBasicXpsx = 89,
// Databento Equities Summary
DbeqSummaryDbeq = 90,
};

// Get a Publisher's Venue.
Expand Down
2 changes: 0 additions & 2 deletions include/databento/record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct has_header : std::false_type {};
template <typename T>
struct has_header<T, detail::void_t<decltype(std::declval<T>().hd)>>
: std::is_same<decltype(std::declval<T>().hd), RecordHeader> {};
template <typename T>
constexpr bool has_header_v = has_header<T>::value;

class Record {
public:
Expand Down
6 changes: 3 additions & 3 deletions include/databento/symbol_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TsSymbolMap {
template <typename R>
Store::const_iterator Find(const R& rec) const {
static_assert(
has_header_v<R>,
has_header<R>::value,
"must be a DBN record struct with an `hd` RecordHeader field");
date::year_month_day index_date{
date::sys_days{date::floor<date::days>(rec.IndexTs())}};
Expand All @@ -50,7 +50,7 @@ class TsSymbolMap {
template <typename R>
const std::string& At(const R& rec) const {
static_assert(
has_header_v<R>,
has_header<R>::value,
"must be a DBN record struct with an `hd` RecordHeader field");
date::year_month_day index_date{
date::sys_days{date::floor<date::days>(rec.IndexTs())}};
Expand Down Expand Up @@ -88,7 +88,7 @@ class PitSymbolMap {
template <typename R>
const std::string& At(const R& rec) const {
static_assert(
has_header_v<R>,
has_header<R>::value,
"must be a DBN record struct with an `hd` RecordHeader field");
return map_.at(rec.hd.instrument_id);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Databento <[email protected]>
_pkgname=databento-cpp
pkgname=databento-cpp-git
pkgver=0.20.1
pkgver=0.21.0
pkgrel=1
pkgdesc="Official C++ client for Databento"
arch=('any')
Expand Down
45 changes: 39 additions & 6 deletions src/enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ const char* ToString(Schema schema) {
case Schema::Definition: {
return "definition";
}
case Schema::Imbalance: {
return "imbalance";
}
case Schema::Statistics: {
return "statistics";
}
case Schema::Status: {
return "status";
}
case Schema::Imbalance: {
return "imbalance";
}
case Schema::Cbbo: {
return "cbbo";
}
Expand Down Expand Up @@ -148,6 +148,12 @@ const char* ToString(SType stype) {
case SType::Parent: {
return "parent";
}
case SType::NasdaqSymbol: {
return "nasdaq_symbol";
}
case SType::CmsSymbol: {
return "cms_symbol";
}
default: {
return "unknown";
}
Expand Down Expand Up @@ -522,6 +528,9 @@ const char* ToString(StatType stat_type) {
case StatType::Delta: {
return "Delta";
}
case StatType::UncrossingPrice: {
return "UncrossingPrice";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -915,15 +924,33 @@ Schema FromString(const std::string& str) {
if (str == "definition") {
return Schema::Definition;
}
if (str == "imbalance") {
return Schema::Imbalance;
}
if (str == "statistics") {
return Schema::Statistics;
}
if (str == "status") {
return Schema::Status;
}
if (str == "imbalance") {
return Schema::Imbalance;
}
if (str == "cbbo") {
return Schema::Cbbo;
}
if (str == "cbbo-1s") {
return Schema::Cbbo1S;
}
if (str == "cbbo-1m") {
return Schema::Cbbo1M;
}
if (str == "tcbbo") {
return Schema::Tcbbo;
}
if (str == "bbo-1s") {
return Schema::Bbo1S;
}
if (str == "bbo-1m") {
return Schema::Bbo1M;
}
throw InvalidArgumentError{"FromString<Schema>", "str",
"unknown value '" + str + '\''};
}
Expand Down Expand Up @@ -984,6 +1011,12 @@ SType FromString(const std::string& str) {
if (str == "parent") {
return SType::Parent;
}
if (str == "nasdaq_symbol" || str == "nasdaq") {
return SType::NasdaqSymbol;
}
if (str == "cms_symbol" || str == "cms") {
return SType::CmsSymbol;
}
throw InvalidArgumentError{"FromString<SType>", "str",
"unknown value '" + str + '\''};
}
Expand Down
18 changes: 18 additions & 0 deletions src/publishers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ const char* ToString(Dataset dataset) {
case Dataset::XnasBasic: {
return "XNAS.BASIC";
}
case Dataset::DbeqSummary: {
return "DBEQ.SUMMARY";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -487,6 +490,9 @@ Dataset FromString(const std::string& str) {
if (str == "XNAS.BASIC") {
return Dataset::XnasBasic;
}
if (str == "DBEQ.SUMMARY") {
return Dataset::DbeqSummary;
}
throw InvalidArgumentError{"FromString<Dataset>", "str",
"unknown value '" + str + '\''};
}
Expand Down Expand Up @@ -760,6 +766,9 @@ Venue PublisherVenue(Publisher publisher) {
case Publisher::XnasBasicXpsx: {
return Venue::Xpsx;
}
case Publisher::DbeqSummaryDbeq: {
return Venue::Dbeq;
}
default: {
throw InvalidArgumentError{
"PublisherVenue", "publisher",
Expand Down Expand Up @@ -1037,6 +1046,9 @@ Dataset PublisherDataset(Publisher publisher) {
case Publisher::XnasBasicXpsx: {
return Dataset::XnasBasic;
}
case Publisher::DbeqSummaryDbeq: {
return Dataset::DbeqSummary;
}
default: {
throw InvalidArgumentError{
"PublisherDataset", "publisher",
Expand Down Expand Up @@ -1315,6 +1327,9 @@ const char* ToString(Publisher publisher) {
case Publisher::XnasBasicXpsx: {
return "XNAS.BASIC.XPSX";
}
case Publisher::DbeqSummaryDbeq: {
return "DBEQ.SUMMARY.DBEQ";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -1595,6 +1610,9 @@ Publisher FromString(const std::string& str) {
if (str == "XNAS.BASIC.XPSX") {
return Publisher::XnasBasicXpsx;
}
if (str == "DBEQ.SUMMARY.DBEQ") {
return Publisher::DbeqSummaryDbeq;
}
throw InvalidArgumentError{"FromString<Publisher>", "str",
"unknown value '" + str + '\''};
}
Expand Down

0 comments on commit e5be52a

Please sign in to comment.