Skip to main content

Python frontend for ROOT data analyses written in queryosity

Project description

Queryosity

Version C++ Standard Ubuntu macOS MIT License

Queryosity is a row-wise data analysis library for (semi-)structured data.

  • Dataflow interface.
  • Arbitrary data types.
  • Lazy, multithreaded actions.
  • Sensitivity analysis.

Documentation

Hello World

#include <fstream>
#include <sstream>
#include <vector>

#include <queryosity.hpp>
#include <queryosity/boost/histogram.hpp>
#include <queryosity/nlohmann/json.hpp>

using dataflow = qty::dataflow;
namespace multithread = qty::multithread;
namespace dataset = qty::dataset;
namespace column = qty::column;
namespace query = qty::query;

using json = qty::nlohmann::json;
using h1d = qty::boost::histogram::histogram<double>;
using linax = qty::boost::histogram::axis::regular;

int main() {
  dataflow df(multithread::enable(10));

  std::ifstream data("data.json");
  auto [x, w] = df.read(
      dataset::input<json>(data), dataset::column<std::vector<double>>("x"), dataset::column<double>("w"));

  auto zero = df.define(column::constant(0));
  auto x0 = x[zero];

  auto sel =
      df.weight(w)
          .filter(column::expression(
              [](std::vector<double> const &v) { return v.size(); }))(x);

  auto h_x0_w = df.get(query::output<h1d>(linax(20, 0.0, 200.0)))
                    .fill(x0)
                    .at(sel)
                    .result();

  std::ostringstream os;
  os << *h_x0_w;
  std::cout << os.str() << std::endl;
}

Installation

Single-header

#include <queryosity.hpp>

CMake

git clone https://github.com/taehyounpark/queryosity.git

External

cd queryosity/ && mkdir build/ && cd build/
cmake -DQUERYOSITY_INSTALL=ON ../
cmake --build .
cmake --install .
find_package(queryosity 0.5.0 REQUIRED)
...
add_library(Analysis ...)
...
target_link_libraries(Analysis INTERFACE queryosity::queryosity)
#include <queryosity.hpp>

Integrated

add_subdirectory(queryosity)
...
add_library(Analysis ...)
...
target_link_libraries(Analysis INTERFACE queryosity::queryosity)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

queryosity-0.1.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

queryosity-0.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file queryosity-0.1.0.tar.gz.

File metadata

  • Download URL: queryosity-0.1.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for queryosity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af256b139b436a8dc6065b6c3a91127d4b1b9edb6c5e45f5501ae8e840f41604
MD5 4b0374cfb9fdd4ba8d2d2cb18f265b6e
BLAKE2b-256 5d33589e95d6738a81a904ad07e50d797c3f44a3454d826b8e32d2f8be840cb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for queryosity-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on taehyounpark/queryosity

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file queryosity-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: queryosity-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for queryosity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3d80928c183a029b6bf5db37074ccc2678eddce658035c6ca3d0bf1249a8b55
MD5 d33fa600107891133b20f2e76d61dbe0
BLAKE2b-256 b1115ff27fa45e13cd11f825585d7e1d02683ddc93bcd6c8126988600e862ffd

See more details on using hashes here.

Provenance

The following attestation bundles were made for queryosity-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on taehyounpark/queryosity

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page