Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Add in close to destructor #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ repos/*
.vscode

# sphinx / readthedocs
doc/build/*
doc/build/*

# tests directories
tests/data/output*
tests/data/access*.yaml
bindings/cpp/tests/output*
5 changes: 5 additions & 0 deletions bindings/cpp/datapipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ DataPipeline::DataPipeline(const string &config_file, const string &uri, const s
api(py::module::import("data_pipeline_api.standard_api").attr("StandardAPI").attr("from_config")(
config_file, uri, git_sha)) {}

DataPipeline::~DataPipeline()
{
api.attr("file_api").attr("close")();
}

double DataPipeline::read_estimate(string data_product, const string &component)
{
// TODO: can we assume all estimate are floats? Should we check it?
Expand Down
1 change: 1 addition & 0 deletions bindings/cpp/datapipeline.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DataPipeline
{
public:
DataPipeline(const string &config_file, const string &uri, const string &git_sha);
~DataPipeline();
double read_estimate(string data_product, const string &component);
Distribution read_distribution(const string &data_product, const string &component);
vector<double> read_sample(const string &data_product, const string &component);
Expand Down