From cc65e538761c497ebfece9a77d17b7b0d3ec290b Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Fri, 6 Oct 2023 17:18:38 +0200 Subject: [PATCH] [DEV] remove solar series files --- src/libs/antares/study/CMakeLists.txt | 3 - src/libs/antares/study/parts/parts.h | 1 - src/libs/antares/study/parts/solar/series.cpp | 115 ------------------ src/libs/antares/study/parts/solar/series.h | 102 ---------------- src/libs/antares/study/parts/solar/series.hxx | 42 ------- 5 files changed, 263 deletions(-) delete mode 100644 src/libs/antares/study/parts/solar/series.cpp delete mode 100644 src/libs/antares/study/parts/solar/series.h delete mode 100644 src/libs/antares/study/parts/solar/series.hxx diff --git a/src/libs/antares/study/CMakeLists.txt b/src/libs/antares/study/CMakeLists.txt index d00eed6b93..a3011dfc6a 100644 --- a/src/libs/antares/study/CMakeLists.txt +++ b/src/libs/antares/study/CMakeLists.txt @@ -206,9 +206,6 @@ set(SRC_STUDY # Solar parts/solar/container.h parts/solar/container.cpp - parts/solar/series.h - parts/solar/series.hxx - parts/solar/series.cpp parts/solar/prepro.cpp parts/solar/prepro.h parts/solar/prepro.hxx diff --git a/src/libs/antares/study/parts/parts.h b/src/libs/antares/study/parts/parts.h index 57e62fe270..fef42e95f0 100644 --- a/src/libs/antares/study/parts/parts.h +++ b/src/libs/antares/study/parts/parts.h @@ -31,7 +31,6 @@ #include "load/container.h" // Solar -#include "solar/series.h" #include "solar/prepro.h" #include "solar/container.h" diff --git a/src/libs/antares/study/parts/solar/series.cpp b/src/libs/antares/study/parts/solar/series.cpp deleted file mode 100644 index 2a4b8de360..0000000000 --- a/src/libs/antares/study/parts/solar/series.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ - -#include -#include -#include -#include "series.h" -#include "../../study.h" - -using namespace Yuni; - -#define SEP IO::Separator - -namespace Antares -{ -namespace Data -{ -int DataSeriesSolarLoadFromFolder(Study& study, - DataSeriesSolar* s, - const AreaName& areaID, - const char* folder) -{ - /* Assert */ - assert(s); - assert(folder); - assert('\0' != *folder); - - Yuni::String& buffer = study.buffer; - - int ret = 1; - /* Solar the matrix */ - buffer.clear() << folder << SEP << "solar_" << areaID << '.' << study.inputExtension; - ret = s->timeSeries.loadFromCSVFile(buffer, 1, HOURS_PER_YEAR, &study.dataBuffer) && ret; - - if (study.usedByTheSolver && study.parameters.derated) - s->timeSeries.averageTimeseries(); - - s->timeseriesNumbers.clear(); - - return ret; -} - -int DataSeriesSolarSaveToFolder(DataSeriesSolar* s, const AreaName& areaID, const char folder[]) -{ - if (!s) - return 1; - - /* Assert */ - assert(folder); - assert('\0' != *folder); - - if (IO::Directory::Create(folder)) - { - int res = 1; - - String buffer; - buffer.clear() << folder << SEP << "solar_" << areaID << ".txt"; - res = s->timeSeries.saveToCSVFile(buffer, /*decimal*/ 0) && res; - - return res; - } - return 0; -} - -double* DataSeriesSolar::getColumn(unsigned int year) const -{ - return timeSeries[getIndex(year)]; -} - -double DataSeriesSolar::getCoefficient(const unsigned int year, const unsigned int hour) const -{ - return timeSeries[getIndex(year)][hour]; -} - -unsigned int DataSeriesSolar::getIndex(unsigned int year) const -{ - return (timeSeries.width != 1) ? timeseriesNumbers[0][year] : 0; -} - -bool DataSeriesSolar::forceReload(bool reload) const -{ - return timeSeries.forceReload(reload); -} - -void DataSeriesSolar::markAsModified() const -{ - timeSeries.markAsModified(); -} - -} // namespace Data -} // namespace Antares diff --git a/src/libs/antares/study/parts/solar/series.h b/src/libs/antares/study/parts/solar/series.h deleted file mode 100644 index 1f94c24117..0000000000 --- a/src/libs/antares/study/parts/solar/series.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ -#ifndef __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_H__ -#define __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_H__ - -#include -#include "../../fwd.h" - -namespace Antares -{ -namespace Data -{ -/*! -** \brief Data series (Solar) -*/ -class DataSeriesSolar -{ -public: - - bool forceReload(bool reload = false) const; - - void markAsModified() const; - - double* getColumn(unsigned int year) const; - double getCoefficient(const unsigned int year, const unsigned int hour) const; - unsigned int getIndex(unsigned int year) const; - -public: - /*! - ** \brief Time series (MW) - ** - ** Merely a matrix of TimeSeriesCount * 8760 values - */ - Matrix timeSeries; - - /*! - ** \brief Monte-Carlo - */ - Matrix timeseriesNumbers; - -}; /* class DataSeriesSolar */ - -/*! -** \brief Solar wind data series from a file -** \ingroup windseries -** -** \param d Data series -** \param areaID The ID of the area associated to the data series -** \param folder The source folder -** \return A non-zero value if the operation succeeded, 0 otherwise -*/ -int DataSeriesSolarLoadFromFolder(Study& s, - DataSeriesSolar* d, - const AreaName& areaID, - const char folder[]); - -/*! -** \brief Save wind data series from a file -** \ingroup windseries -** -** \param d Data series -** \param areaID The ID of the area associated to the data series -** \param folder The target folder -** \return A non-zero value if the operation succeeded, 0 otherwise -*/ -int DataSeriesSolarSaveToFolder(DataSeriesSolar* d, const AreaName& areaID, const char folder[]); - -/*! -** \brief Get the size (bytes) in memory occupied by a `DataSeriesSolar` structure -*/ -uint64_t DataSeriesSolarMemoryUsage(DataSeriesSolar* w); - -} // namespace Data -} // namespace Antares - -#include "series.hxx" - -#endif /* __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_H__ */ diff --git a/src/libs/antares/study/parts/solar/series.hxx b/src/libs/antares/study/parts/solar/series.hxx deleted file mode 100644 index 3654163ae0..0000000000 --- a/src/libs/antares/study/parts/solar/series.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ -#ifndef __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_HXX__ -#define __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_HXX__ - -namespace Antares -{ -namespace Data -{ -inline uint64_t DataSeriesSolarMemoryUsage(DataSeriesSolar* l) -{ - return (l) ? l->timeSeries.memoryUsage() : 0; -} - -} // namespace Data -} // namespace Antares - -#endif // __ANTARES_LIBS_STUDY_PARTS_SOLAR_TIMESERIES_HXX__