Skip to content

Commit

Permalink
sy - parsing NaN in json
Browse files Browse the repository at this point in the history
  • Loading branch information
yisangriB committed Jul 25, 2022
1 parent 64f2653 commit 1264701
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FEM/surrogateGpFEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ surrogateGpFEM::surrogateGpFEM(QWidget *parent)
QHBoxLayout * gpOutputLayout = new QHBoxLayout();
gpOutputComboBox= new QComboBox;
gpOutputComboBox->addItem("Median (representative) prediction");
//gpOutputComboBox->addItem("Random sample under prediction uncertainty");
gpOutputLayout->addWidget( new QLabel("GP output "));
gpOutputLayout->addWidget(gpOutputComboBox);
gpOutputComboBox->setMinimumWidth(400);
gpOutputLayout->addStretch(1);

connect(option3Button, &QRadioButton::toggled, this, [=](bool tog){
Expand Down Expand Up @@ -398,6 +400,8 @@ surrogateGpFEM::showGpOptions(QString name1) {
if (file.open(QFile::ReadOnly | QFile::Text)) {
QString val;
val=file.readAll();
val.replace(QString("NaN"),QString("null"));
val.replace(QString("Infinity"),QString("inf"));
QJsonDocument doc = QJsonDocument::fromJson(val.toUtf8());
QJsonObject jsonSur = doc.object();
file.close();
Expand Down

0 comments on commit 1264701

Please sign in to comment.