Skip to content

no errors/warnings on alma9 #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
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
2 changes: 1 addition & 1 deletion larcv/app/Overlay/MergeStreams.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace larcv {

// Create one IOManager per input file
for (size_t i = 0; i < _num_input_files; ++i) {
for (size_t j = 0; j < multiplicity[i]; ++j) {
for (int j = 0; j < multiplicity[i]; ++j) {
IOManager io(IOManager::kREAD, "InputStream" + std::to_string(i));
io.add_in_file(input_files[i]);
_in_io.push_back(io);
Expand Down
8 changes: 4 additions & 4 deletions larcv/app/SBNDImageMod/CropNeutrino2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ bool CropNeutrino2D::process(IOManager& mgr) {
// This is looping over rows and columns of the new meta.
// Need to match this row and column to the old meta
int old_row = i_row + min_rows.at(projection_id);
if (old_row < 0 || old_row >= old_image.meta().rows()) continue;
if (old_row < 0 || old_row >= (int)old_image.meta().rows()) continue;
for (int i_col = 0; i_col < _output_rows; i_col++) {
int old_col = i_col + min_cols.at(projection_id);
if (old_col < 0 || old_col >= old_image.meta().cols()) continue;
if (old_col < 0 || old_col >= (int)old_image.meta().cols()) continue;

// Ok, this is a valid row/col pair in each meta.
// Copy the value from old to new.
Expand Down Expand Up @@ -289,8 +289,8 @@ bool CropNeutrino2D::process(IOManager& mgr) {


// If this row or column is outside the boundaries, skip it:
if (new_row < 0 || new_row >= new_metas.at(projection_id).rows()) continue;
if (new_col < 0 || new_col >= new_metas.at(projection_id).cols()) continue;
if (new_row < 0 || new_row >= (int)new_metas.at(projection_id).rows()) continue;
if (new_col < 0 || new_col >= (int)new_metas.at(projection_id).cols()) continue;

// Get the index of the voxel in the new meta:
size_t new_index = new_metas.at(projection_id).index(new_row, new_col);
Expand Down
2 changes: 1 addition & 1 deletion larcv/app/ThreadIO/BatchFillerSparseCluster2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void BatchFillerSparseCluster2D::_batch_end_() {
void BatchFillerSparseCluster2D::finalize() { _entry_data.clear(); }

void BatchFillerSparseCluster2D::assert_dimension(
const EventClusterPixel2D& cluster_data) const {
const EventClusterPixel2D& /*cluster_data*/) const {
// auto const& voxel_meta = cluster_data.as_vector().front().meta();
// if (_rows != voxel_meta.rows()) {
// LARCV_CRITICAL() << "# of Y-voxels (" << _rows << ") changed ... now "
Expand Down
4 changes: 2 additions & 2 deletions larcv/app/ThreadIO/BatchFillerSparseTensor2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void BatchFillerSparseTensor2D::_batch_end_() {
void BatchFillerSparseTensor2D::finalize() { _entry_data.clear(); }

void BatchFillerSparseTensor2D::assert_dimension(
const EventSparseTensor2D& voxel_data) const {
const EventSparseTensor2D& /*voxel_data*/) const {
// auto const& voxel_meta = voxel_data.as_vector().front().meta();
// if (_rows != voxel_meta.rows()) {
// LARCV_CRITICAL() << "# of Y-voxels (" << _rows << ") changed ... now "
Expand Down Expand Up @@ -177,7 +177,7 @@ bool BatchFillerSparseTensor2D::process(IOManager& mgr) {
if (flip_y) row = meta.rows() - (row + 1);


size_t index = count*(_max_voxels*point_dim) + i*point_dim;
//size_t index = count*(_max_voxels*point_dim) + i*point_dim;
_entry_data.at(count*(_max_voxels*point_dim) + i*point_dim) = row;
_entry_data.at(count*(_max_voxels*point_dim) + i*point_dim + 1) = col;
if (_include_values){
Expand Down
6 changes: 3 additions & 3 deletions larcv/app/ThreadIO/BatchFillerSparseTensor3D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void BatchFillerSparseTensor3D::_batch_end_() {
void BatchFillerSparseTensor3D::finalize() { _entry_data.clear(); }

void BatchFillerSparseTensor3D::assert_dimension(
const EventSparseTensor3D& voxel_data) const {
const EventSparseTensor3D& /*voxel_data*/) const {
// auto const& voxel_meta = voxel_data.as_vector().front().meta();
// if (_rows != voxel_meta.rows()) {
// LARCV_CRITICAL() << "# of Y-voxels (" << _rows << ") changed ... now "
Expand Down Expand Up @@ -119,7 +119,7 @@ bool BatchFillerSparseTensor3D::process(IOManager& mgr) {
}
// one time operation: get image dimension
if (batch_data().dim().empty()) {
auto const& voxel_meta = voxel_data.meta();
//auto const& voxel_meta = voxel_data.meta();
std::vector<int> dim;
dim.resize(3);
dim.at(0) = batch_size();
Expand All @@ -141,7 +141,7 @@ bool BatchFillerSparseTensor3D::process(IOManager& mgr) {
auto & meta = voxel_data.meta();

// Check that this projection ID is in the lists of channels:
bool found = false;
//bool found = false;
size_t i = 0;

// Get the random x/y/z flipping
Expand Down
4 changes: 2 additions & 2 deletions larcv/app/ThreadIO/ThreadProcessor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ namespace larcv {
if (_manager_thread.joinable()) _manager_thread.join();
}

void ThreadProcessor::manager_batch_process(size_t batch_size)
void ThreadProcessor::manager_batch_process(size_t /*batch_size*/)
{
_run_manager_thread = true;
auto t_start = std::chrono::high_resolution_clock::now();
auto t_end = std::chrono::high_resolution_clock::now();
while (_run_manager_thread) {
LARCV_INFO() << "Calling batch_process" << std::endl;
t_start = std::chrono::high_resolution_clock::now();
auto state = batch_process(batch_size);
//auto state = batch_process(batch_size);
t_end = std::chrono::high_resolution_clock::now();
LARCV_INFO() << "Returned from batch_process: "
<< (long long)(std::chrono::duration_cast<std::chrono::microseconds>(t_end - t_start).count())
Expand Down
2 changes: 2 additions & 0 deletions larcv/core/Base/PSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ namespace larcv {
PSet(const std::string name="",
const std::string data="");

PSet& operator=(const PSet&) = default;

/// Default destructor
virtual ~PSet(){};

Expand Down
4 changes: 3 additions & 1 deletion larcv/core/Base/larcv_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ namespace larcv {

/// Default copy constructor
larcv_base(const larcv_base &original) : _logger(original._logger) {}


larcv_base& operator=(const larcv_base&) = default;

/// Default destructor
virtual ~larcv_base(){};

Expand Down
1 change: 1 addition & 0 deletions larcv/core/CVUtil/CVUtil.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __LARCV_CVUTIL_CXX__

#include "CVUtil.h"
#include "opencv2/imgcodecs/legacy/constants_c.h" // CV_LOAD_IMAGE_COLOR

namespace larcv {

Expand Down
4 changes: 3 additions & 1 deletion larcv/core/DataFormat/EventBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ namespace larcv {
, _subrun(rhs._subrun)
, _event(rhs._event)
{}


EventBase& operator=(const EventBase&) = default;

/// Default destructor
virtual ~EventBase(){}
/// Set all run/subrun/event to kINVALID_SIZE
Expand Down
10 changes: 5 additions & 5 deletions larcv/core/DataFormat/Flash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ namespace larcv {
, _absTime (absTime)
, _frame (frame)
, _PEPerOpDet (PEPerOpDet)
, _inBeamFrame (inBeamFrame)
, _onBeamTime (onBeamTime)
, _fastToTotal (fastToTotal)
, _wireCenters (wireCenters)
, _wireWidths (wireWidths)
, _xCenter (xCenter)
, _xWidth (xWidth)
, _yCenter (yCenter)
, _yWidth (yWidth)
, _zCenter (zCenter)
, _zWidth (zWidth)
, _wireCenters (wireCenters)
, _wireWidths (wireWidths)
, _fastToTotal (fastToTotal)
, _inBeamFrame (inBeamFrame)
, _onBeamTime (onBeamTime)
{}

double Flash::TotalPE() const {
Expand Down
2 changes: 2 additions & 0 deletions larcv/core/DataFormat/IOManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ namespace larcv {
/// Configuration PSet file construction so you don't have to call setter functions
IOManager(std::string config_file, std::string name = "IOManager");

IOManager& operator=(const IOManager&) = default;

/// Default destructor
~IOManager() {}
/// IO mode accessor
Expand Down
2 changes: 2 additions & 0 deletions larcv/core/DataFormat/Image2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ namespace larcv {
/// copy ctor
Image2D(const Image2D&);

Image2D& operator=(const Image2D&) = default;

#ifndef __CINT__
/// attribute move ctor
Image2D(ImageMeta&&, std::vector<float>&&);
Expand Down
1 change: 1 addition & 0 deletions larcv/core/DataFormat/ImageMeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace larcv {
: BBox2D(box), _unit(unit)
{ update(y_row_count, x_column_count); }

ImageMeta& operator=(const ImageMeta&) = default;
/// Default destructor
~ImageMeta() {}

Expand Down
3 changes: 3 additions & 0 deletions larcv/core/DataFormat/Point.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace larcv {

Point2D(const Point2D& pt) : x(pt.x), y(pt.y) {};

Point2D& operator=(const Point2D&) = default;
double x, y;

inline bool operator== (const Point2D& rhs) const
Expand Down Expand Up @@ -74,6 +75,8 @@ namespace larcv {

Point3D(const Point3D& pt) : x(pt.x), y(pt.y), z(pt.z) {}

Point3D& operator=(const Point3D&) = default;

double x, y, z;

inline bool operator== (const Point3D& rhs) const
Expand Down
1 change: 1 addition & 0 deletions larcv/core/DataFormat/Vertex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace larcv {
LARCV_CRITICAL() << "Wrong point type (Point3D) in Vertex::as_point2d" << std::endl;
throw larbys();
}
return Point2D(_x, _y); // quiet compiler warning
}

const larcv::Point3D Vertex::as_point3d() const
Expand Down
2 changes: 1 addition & 1 deletion larcv/core/DataFormat/Voxel2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace larcv {
_meta = meta;
}

const Voxel& SparseTensor2D::close(VoxelID_t id, double distance, const larcv::ImageMeta& meta) const
const Voxel SparseTensor2D::close(VoxelID_t id, double distance, const larcv::ImageMeta& meta) const
{
const std::vector<larcv::Voxel>& voxel_v = this->as_vector();
if(voxel_v.empty())
Expand Down
2 changes: 1 addition & 1 deletion larcv/core/DataFormat/Voxel2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace larcv {
/// Access ImageMeta of specific projection
inline const larcv::ImageMeta& meta() const { return _meta; }
/// Returns a const reference to voxel closest to a voxel with specified id. if no such voxel within distance, return invalid voxel.
const Voxel& close(VoxelID_t id, double distance, const larcv::ImageMeta& meta) const;
const Voxel close(VoxelID_t id, double distance, const larcv::ImageMeta& meta) const;

//
// Write-access
Expand Down
11 changes: 5 additions & 6 deletions larcv/core/DataFormat/utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace larcv {

std::vector< std::vector<int> > sample(double ** carray, int * csamples, int npts, int num_samples, double threshold) {
std::vector< std::vector<int> > all_fragments;
for (size_t i = 0; i < num_samples; ++i)
for (int i = 0; i < num_samples; ++i)
{
double x = carray[csamples[i]][0];
double y = carray[csamples[i]][1];
double z = carray[csamples[i]][2];
std::vector<int> fragment_idx;
// Find all points in this fragment around the sample point
for (size_t j = 0; j < npts; ++j) {
for (int j = 0; j < npts; ++j) {
double distance = std::sqrt(std::pow(carray[j][0]-x, 2) + std::pow(carray[j][1]-y, 2) + std::pow(carray[j][2]-z, 2));
if (distance <= threshold) {
fragment_idx.push_back(j);
Expand All @@ -30,7 +30,7 @@ std::vector< std::vector<int> > sample(double ** carray, int * csamples, int npt

void compute_pca(double ** coords, int nfrag, double * output) {
double mean[3];
for (size_t k = 0; k < nfrag; ++k) {
for (int k = 0; k < nfrag; ++k) {
mean[0] += coords[k][0];
mean[1] += coords[k][1];
mean[2] += coords[k][2];
Expand All @@ -45,7 +45,7 @@ void compute_pca(double ** coords, int nfrag, double * output) {
for (size_t i1 = 0; i1 < 3; ++i1) {
for (size_t i2 = 0; i2 < 3; ++i2) {
M[i1][i2] = 0.;
for (size_t k = 0; k < nfrag; ++k) {
for (int k = 0; k < nfrag; ++k) {
M[i1][i2] = M[i1][i2] + (coords[k][i1]-mean[i1]) * (coords[k][i2]-mean[i2]);
}
}
Expand Down Expand Up @@ -111,10 +111,9 @@ void PCA_3D::_fit(double **coords, size_t n, bool store_spread)

// fill eigenvectors with descending eigenvalues
_components.reserve(3);
double eig_val[3];

for (size_t i = 0; i < 3; ++i){
size_t ii = idx[i];
eig_val[i] = ev[ii];
std::vector<double> vec(3);
for (size_t j = 0; j < 3; ++j)
vec[j] = vh[j][ii]; // transpose of vh sorted by eigenvalue
Expand Down
2 changes: 1 addition & 1 deletion larcv/core/Processor/ProcessBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace larcv {
, _fout ( nullptr )
{}

bool ProcessBase::is(const std::string question) const
bool ProcessBase::is(const std::string) const
{ return false; }

void ProcessBase::_configure_(const PSet& cfg)
Expand Down
5 changes: 4 additions & 1 deletion larcv/core/PyUtil/PyCluster3DMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ namespace larcv {
class PyCluster3DMakerProcessFactory : public ProcessFactoryBase {
public:
/// ctor
PyCluster3DMakerProcessFactory() { ProcessFactory::get().add_factory("PyCluster3DMaker",this); }
PyCluster3DMakerProcessFactory() {
(void)_import_array(); // quiet warning ...numpy/core/include/numpy/__multiarray_api.h ... defined but not used
ProcessFactory::get().add_factory("PyCluster3DMaker",this);
}
/// dtor
~PyCluster3DMakerProcessFactory() {}
/// creation method
Expand Down
4 changes: 3 additions & 1 deletion larcv/core/PyUtil/PyImageMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ namespace larcv {
class PyImageMakerProcessFactory : public ProcessFactoryBase {
public:
/// ctor
PyImageMakerProcessFactory() { ProcessFactory::get().add_factory("PyImageMaker",this); }
PyImageMakerProcessFactory() {
(void)_import_array(); // quiet warning ...numpy/core/include/numpy/__multiarray_api.h ... defined but not used
ProcessFactory::get().add_factory("PyImageMaker",this); }
/// dtor
~PyImageMakerProcessFactory() {}
/// creation method
Expand Down
5 changes: 4 additions & 1 deletion larcv/core/PyUtil/PyImageStitcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ namespace larcv {
class PyImageStitcherProcessFactory : public ProcessFactoryBase {
public:
/// ctor
PyImageStitcherProcessFactory() { ProcessFactory::get().add_factory("PyImageStitcher",this); }
PyImageStitcherProcessFactory() {
(void)_import_array(); // quiet warning ...numpy/core/include/numpy/__multiarray_api.h ... defined but not used
ProcessFactory::get().add_factory("PyImageStitcher",this);
}
/// dtor
~PyImageStitcherProcessFactory() {}
/// creation method
Expand Down
5 changes: 4 additions & 1 deletion larcv/core/PyUtil/PyTensor3DMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ namespace larcv {
class PyTensor3DMakerProcessFactory : public ProcessFactoryBase {
public:
/// ctor
PyTensor3DMakerProcessFactory() { ProcessFactory::get().add_factory("PyTensor3DMaker",this); }
PyTensor3DMakerProcessFactory() {
(void)_import_array(); // quiet warning ...numpy/core/include/numpy/__multiarray_api.h ... defined but not used
ProcessFactory::get().add_factory("PyTensor3DMaker",this);
}
/// dtor
~PyTensor3DMakerProcessFactory() {}
/// creation method
Expand Down
10 changes: 5 additions & 5 deletions larcv/core/PyUtil/PyUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ PyObject * fragment(PyObject * pyarray, PyObject * samples_idx, double threshold
"ERROR: cannot convert samples to 1D C-array");
throw larbys();
}
int num_samples = dim_samples[0];
size_t num_samples = dim_samples[0];

std::vector< std::vector<int> > all_fragments = sample(carray, csamples, npts, num_samples, threshold);
assert(all_fragments.size() == num_samples);
Expand All @@ -224,7 +224,7 @@ PyObject * fragment(PyObject * pyarray, PyObject * samples_idx, double threshold
int nfrag = fragment_idx.size();
//std::cout << i << " " << nfrag << std::endl;
double coords[nfrag][3];
for (size_t k = 0; k < nfrag; ++k) {
for (int k = 0; k < nfrag; ++k) {
auto j = fragment_idx[k];
coords[k][0] = carray[j][0];
coords[k][1] = carray[j][1];
Expand Down Expand Up @@ -293,7 +293,7 @@ void fill_3d_pcloud(const VoxelSet& data, const Voxel3DMeta& meta, PyObject* pya
select_ptr = (int*)(PyArray_GetPtr(select_pyptr,loc));
}

if(npts > data.size() || (dims[1] != 1 && dims[1] != 3 && dims[1] != 4) || dims[0] != data.size()) {
if(npts > data.size() || (dims[1] != 1 && dims[1] != 3 && dims[1] != 4) || (size_t)dims[0] != data.size()) {
logger::get("PyUtil").send(larcv::msg::kCRITICAL,__FUNCTION__,__LINE__,
"ERROR: dimension mismatch");
throw larbys();
Expand Down Expand Up @@ -365,7 +365,7 @@ void fill_3d_voxels(const VoxelSet& data, const Voxel3DMeta& meta, PyObject* pya
select_ptr = (int*)(PyArray_GetPtr(select_pyptr,loc));
}

if(npts > data.size() || dims[1] != 3 || dims[0] != npts) {
if(npts > data.size() || dims[1] != 3 || (size_t)dims[0] != npts) {
logger::get("PyUtil").send(larcv::msg::kCRITICAL,__FUNCTION__,__LINE__,
"ERROR: dimension mismatch");
throw larbys();
Expand Down Expand Up @@ -622,7 +622,7 @@ void as_flat_arrays(const VoxelSet& tensor, const Voxel3DMeta& meta,
};
}

void as_flat_arrays(const VoxelSet& tensor, const Voxel3DMeta& meta,
void as_flat_arrays(const VoxelSet& tensor, const Voxel3DMeta& /*meta*/,
PyObject* index, PyObject* value)
{
SetPyUtil();
Expand Down