Skip to content

Commit

Permalink
move LightGBM-vendored json11 into a LightGBM-specific namespace (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maskedcoder1337 authored Jun 30, 2023
1 parent 8de30d7 commit 9f78cce
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/LightGBM/tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace LightGBM {

using json11::Json;
using json11_internal_lightgbm::Json;

/*! \brief forward declaration */
class Tree;
Expand Down
2 changes: 1 addition & 1 deletion include/LightGBM/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace LightGBM {

namespace Common {

using json11::Json;
using json11_internal_lightgbm::Json;

/*!
* Imbues the stream with the C locale.
Expand Down
4 changes: 2 additions & 2 deletions include/LightGBM/utils/json11.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <utility>
#include <vector>

namespace json11 {
namespace json11_internal_lightgbm {

enum JsonParse { STANDARD, COMMENTS };

Expand Down Expand Up @@ -223,4 +223,4 @@ class JsonValue {
virtual ~JsonValue() {}
};

} // namespace json11
} // namespace json11_internal_lightgbm
2 changes: 1 addition & 1 deletion src/boosting/gbdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace LightGBM {

using json11::Json;
using json11_internal_lightgbm::Json;

/*!
* \brief GBDT algorithm implementation. including Training, prediction, bagging.
Expand Down
2 changes: 1 addition & 1 deletion src/io/dataset_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace LightGBM {

using json11::Json;
using json11_internal_lightgbm::Json;

DatasetLoader::DatasetLoader(const Config& io_config, const PredictFunction& predict_fun, int num_class, const char* filename)
:config_(io_config), random_(config_.data_random_seed), predict_fun_(predict_fun), num_class_(num_class) {
Expand Down
6 changes: 3 additions & 3 deletions src/io/json11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <cstdlib>
#include <limits>

namespace json11 {
namespace json11_internal_lightgbm {

static const int max_depth = 200;

Expand Down Expand Up @@ -160,7 +160,7 @@ class Value : public JsonValue {
}

const T m_value;
void dump(string *out) const override { json11::dump(m_value, out); }
void dump(string *out) const override { json11_internal_lightgbm::dump(m_value, out); }
};

class JsonDouble final : public Value<Json::NUMBER, double> {
Expand Down Expand Up @@ -777,4 +777,4 @@ bool Json::has_shape(const shape &types, string *err) const {
return true;
}

} // namespace json11
} // namespace json11_internal_lightgbm
2 changes: 1 addition & 1 deletion src/treelearner/gpu_tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace LightGBM {

using json11::Json;
using json11_internal_lightgbm::Json;

/*!
* \brief GPU-based parallel learning algorithm.
Expand Down
2 changes: 1 addition & 1 deletion src/treelearner/serial_tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace LightGBM {

using json11::Json;
using json11_internal_lightgbm::Json;

/*! \brief forward declaration */
class CostEfficientGradientBoosting;
Expand Down

0 comments on commit 9f78cce

Please sign in to comment.