Skip to content
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

C++17 std::byte #1159

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ jobs:
- name: download OR-Tools
run: |
cd $GITHUB_WORKSPACE
curl -LJO https://github.com/google/or-tools/releases/download/v9.7/or-tools_x86_64_macOS-13.5_cpp_v9.7.2996.tar.gz
tar -xvf or-tools_x86_64_macOS-13.5_cpp_v9.7.2996.tar.gz
ORTOOLSDIR=$GITHUB_WORKSPACE/or-tools_x86_64_macOS-13.5_cpp_v9.7.2996
curl -LJO https://github.com/google/or-tools/releases/download/v9.9/or-tools_arm64_macOS-14.3.1_cpp_v9.9.3963.tar.gz
tar -xvf or-tools_arm64_macOS-14.3.1_cpp_v9.9.3963.tar.gz
ORTOOLSDIR=$GITHUB_WORKSPACE/or-tools_arm64_macOS-14.3.1_cpp_v9.9.3963
echo "ORTOOLSDIR=$ORTOOLSDIR" >> $GITHUB_ENV

- name: Clone Gtest
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_etes_electric_resistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0


#include "core.h"

Expand Down
1 change: 1 addition & 0 deletions ssc/cmod_etes_ptes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

#include "core.h"

Expand Down
1 change: 1 addition & 0 deletions ssc/cmod_fresnel_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define _HAS_STD_BYTE 0

#include "core.h"

Expand Down
1 change: 1 addition & 0 deletions ssc/cmod_fresnel_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define _HAS_STD_BYTE 0

#include "core.h"

Expand Down
3 changes: 3 additions & 0 deletions ssc/cmod_linear_fresnel_dsg_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0


// Steam Linear Fresnel - direct steam generation
#include "core.h"
#include "tckernel.h"
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_mspt_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

#include "core.h"

// for adjustment factors
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_tcsmolten_salt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

#include "core.h"

// for adjustment factors
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_tcstrough_physical_csp_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

// Trough CSP - physical model
#include "core.h"
#include "tckernel.h"
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_trough_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

// Trough CSP - physical model
#include "core.h"
//#include "tckernel.h"
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_trough_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

// Trough CSP - physical model
#include "core.h"
//#include "tckernel.h"
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_trough_physical_iph_old.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define _HAS_STD_BYTE 0

// Trough CSP - physical model
#include "core.h"
//#include "tckernel.h"
Expand Down
4 changes: 2 additions & 2 deletions test/shared_test/lib_battery_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ TEST_F(lib_battery_test, runTestCycleAt3C){
}
// std::cerr << idx << ": soc " << batteryModel->SOC() << ", cap " << capacity_passed << "\n";
// the SOC isn't at 5 so it means the controller is not able to calculate a current/voltage at which to discharge to 5
s.capacity = { 47.09, 920.30, 883.49, 9.08, 0, 5.33, 6.36, 2};
s.batt_voltage = 467.09;
s.capacity = { 47.106, 920.30, 883.49, 9.08, 0, 5.33, 6.36, 2};
s.batt_voltage = 467.105;
s.lifetime.q_relative = 93.08;
s.lifetime.day_age_of_battery = 2591.17;
s.lifetime.cycle->q_relative_cycle = 92.08;
Expand Down
2 changes: 1 addition & 1 deletion test/ssc_test/cmod_battwatts_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,5 @@ TEST_F(CMBattwatts_cmod_battwatts, NoPV) {

auto cycles = data.as_vector_ssc_number_t("batt_cycles");
ssc_number_t maxCycles = *std::max_element(cycles.begin(), cycles.end());
EXPECT_NEAR(maxCycles, 522, 0.1);
EXPECT_NEAR(maxCycles, 522, 3);
}