Skip to content

Commit

Permalink
xdataframe => xframe
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Sep 25, 2017
1 parent 9d4bf0b commit b933ccd
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 70 deletions.
8 changes: 4 additions & 4 deletions .appveyor.yml
Expand Up @@ -8,14 +8,14 @@ platform:

environment:
matrix:
- MINICONDA: C:\xdataframe-conda
- MINICONDA: C:\xframe-conda

init:
- "ECHO %MINICONDA%"
- C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\vcvarsall.bat %PLATFORM%
- ps: if($env:Platform -eq "x64"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe; echo "Done"}
- ps: if($env:Platform -eq "x86"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe' C:\Miniconda.exe; echo "Done"}
- cmd: C:\Miniconda.exe /S /D=C:\xdataframe-conda
- cmd: C:\Miniconda.exe /S /D=C:\xframe-conda
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%"

install:
Expand All @@ -24,8 +24,8 @@ install:
- conda info -a
- conda install gtest cmake xtl xtensor -c conda-forge
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\LIBRARY -DBUILD_TESTS=ON .
- nmake test_xdataframe
- nmake test_xframe
- cd test

build_script:
- .\test_xdataframe
- .\test_xframe
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -101,7 +101,7 @@ install:
- mkdir build
- cd build
- cmake -DBUILD_TESTS=ON ..;
- make -j2 test_xdataframe
- make -j2 test_xframe
- cd test
script:
- ./test_xdataframe
- ./test_xframe
46 changes: 23 additions & 23 deletions CMakeLists.txt
Expand Up @@ -7,23 +7,23 @@
############################################################################

cmake_minimum_required(VERSION 3.1)
project(xdataframe)
project(xframe)

set(XDATAFRAME_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(XFRAME_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

# Versionning
# ===========

file(STRINGS "${XDATAFRAME_INCLUDE_DIR}/xdataframe/xdataframe_config.hpp" xdataframe_version_defines
REGEX "#define XDATAFRAME_VERSION_(MAJOR|MINOR|PATCH)")
foreach(ver ${xdataframe_version_defines})
if(ver MATCHES "#define XDATAFRAME_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$")
set(XDATAFRAME_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
file(STRINGS "${XFRAME_INCLUDE_DIR}/xframe/xframe_config.hpp" xframe_version_defines
REGEX "#define XFRAME_VERSION_(MAJOR|MINOR|PATCH)")
foreach(ver ${xframe_version_defines})
if(ver MATCHES "#define XFRAME_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$")
set(XFRAME_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
endif()
endforeach()
set(${PROJECT_NAME}_VERSION
${XDATAFRAME_VERSION_MAJOR}.${XDATAFRAME_VERSION_MINOR}.${XDATAFRAME_VERSION_PATCH})
message(STATUS "xdataframe v${${PROJECT_NAME}_VERSION}")
${XFRAME_VERSION_MAJOR}.${XFRAME_VERSION_MINOR}.${XFRAME_VERSION_PATCH})
message(STATUS "xframe v${${PROJECT_NAME}_VERSION}")

# Dependencies
# ============
Expand All @@ -37,12 +37,12 @@ include_directories(${xtl_INCLUDE_DIRS})
# Build
# =====

set(XDATAFRAME_HEADERS
${XDATAFRAME_INCLUDE_DIR}/xdataframe/xaxis.hpp
${XDATAFRAME_INCLUDE_DIR}/xdataframe/xdataframe_config.hpp
set(XFRAME_HEADERS
${XFRAME_INCLUDE_DIR}/xframe/xaxis.hpp
${XFRAME_INCLUDE_DIR}/xframe/xframe_config.hpp
)

OPTION(BUILD_TESTS "xdataframe test suite" OFF)
OPTION(BUILD_TESTS "xframe test suite" OFF)
OPTION(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)

if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
Expand All @@ -59,25 +59,25 @@ endif()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

install(FILES ${XDATAFRAME_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xdataframe)
install(FILES ${XFRAME_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xframe)

set(XDATAFRAME_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for xdataframeConfig.cmake")
set(XFRAME_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for xframeConfig.cmake")

configure_package_config_file(${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${XDATAFRAME_CMAKECONFIG_INSTALL_DIR})
INSTALL_DESTINATION ${XFRAME_CMAKECONFIG_INSTALL_DIR})

# xdataframe is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from xdataframeConfigVersion.cmake so that an xdataframeConfig.cmake
# xframe is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from xframeConfigVersion.cmake so that an xframeConfig.cmake
# generated for a 64 bit target can be used for 32 bit targets and vice versa.
set(_XDATAFRAME_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(_XFRAME_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
unset(CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
set(CMAKE_SIZEOF_VOID_P ${_XDATAFRAME_CMAKE_SIZEOF_VOID_P})
set(CMAKE_SIZEOF_VOID_P ${_XFRAME_CMAKE_SIZEOF_VOID_P})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${XDATAFRAME_CMAKECONFIG_INSTALL_DIR})
DESTINATION ${XFRAME_CMAKECONFIG_INSTALL_DIR})
10 changes: 5 additions & 5 deletions README.md
@@ -1,10 +1,10 @@
# xdataframe
# xframe

[![Travis](https://travis-ci.org/QuantStack/xdataframe.svg?branch=master)](https://travis-ci.org/QuantStack/xdataframe)
[![Appveyor](https://ci.appveyor.com/api/projects/status/ni61vup9mjnirr3k/branch/master?svg=true)](https://ci.appveyor.com/project/QuantStack/xdataframe/branch/master)
[![Travis](https://travis-ci.org/QuantStack/xframe.svg?branch=master)](https://travis-ci.org/QuantStack/xframe)
[![Appveyor](https://ci.appveyor.com/api/projects/status/ni61vup9mjnirr3k/branch/master?svg=true)](https://ci.appveyor.com/project/QuantStack/xframe/branch/master)

## Introduction

**xtensor-blas is an early developer preview, and is not suitable for general usage yet. Features and implementation are subject to change.**
**xframe is an early developer preview, and is not suitable for general usage yet. Features and implementation are subject to change.**

`xdataframe` is a dataframe for C++, based on [xtensor](https://github.com/QuantStack/xtensor) and [xtl](https://github.com/QuantStack/xtl).
`xframe` is a dataframe for C++, based on [xtensor](https://github.com/QuantStack/xtensor) and [xtl](https://github.com/QuantStack/xtl).
6 changes: 3 additions & 3 deletions include/xdataframe/xaxis.hpp → include/xframe/xaxis.hpp
Expand Up @@ -6,15 +6,15 @@
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XDF_XAXIS_LABELS_HPP
#define XDF_XAXIS_LABELS_HPP
#ifndef XFRAME_XAXIS_LABELS_HPP
#define XFRAME_XAXIS_LABELS_HPP

#include <initializer_list>
#include <iterator>
#include <type_traits>
#include <unordered_map>

namespace xdf
namespace xf
{
template <class L, class T>
class xaxis_iterator;
Expand Down
Expand Up @@ -6,11 +6,11 @@
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XDATAFRAME_CONFIG_HPP
#define XDATAFRAME_CONFIG_HPP
#ifndef XFRAME_CONFIG_HPP
#define XFRAME_CONFIG_HPP

#define XDATAFRAME_VERSION_MAJOR 0
#define XDATAFRAME_VERSION_MINOR 0
#define XDATAFRAME_VERSION_PATCH 1
#define XFRAME_VERSION_MAJOR 0
#define XFRAME_VERSION_MINOR 0
#define XFRAME_VERSION_PATCH 1

#endif
26 changes: 13 additions & 13 deletions test/CMakeLists.txt
Expand Up @@ -9,10 +9,10 @@
cmake_minimum_required(VERSION 3.1)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
project(xdataframe-test)
project(xframe-test)

find_package(xdataframe REQUIRED CONFIG)
set(XDATAFRAME_INCLUDE_DIR ${xdataframe_INCLUDE_DIRS})
find_package(xframe REQUIRED CONFIG)
set(XFRAME_INCLUDE_DIR ${xframe_INCLUDE_DIRS})
endif ()

message(STATUS "Forcing tests build type to Release")
Expand All @@ -23,14 +23,14 @@ include(CheckCXXCompilerFlag)
string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion")
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)

if (HAS_CPP14_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else()
message(FATAL_ERROR "Unsupported compiler -- xdataframe requires C++14 support!")
message(FATAL_ERROR "Unsupported compiler -- xframe requires C++14 support!")
endif()
endif()

Expand Down Expand Up @@ -73,21 +73,21 @@ endif()

find_package(Threads)

include_directories(${XDATAFRAME_INCLUDE_DIR})
include_directories(${XFRAME_INCLUDE_DIR})
include_directories(${GTEST_INCLUDE_DIRS})

set(XDATAFRAME_TESTS
set(XFRAME_TESTS
main.cpp
test_xaxis.cpp
)

set(XDATAFRAME_TARGET test_xdataframe)
set(XFRAME_TARGET test_xframe)

add_executable(${XDATAFRAME_TARGET} ${XDATAFRAME_TESTS} ${XDATAFRAME_HEADERS})
add_executable(${XFRAME_TARGET} ${XFRAME_TESTS} ${XFRAME_HEADERS})
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
add_dependencies(${XDATAFRAME_TARGET} gtest_main)
add_dependencies(${XFRAME_TARGET} gtest_main)
endif()
target_link_libraries(${XDATAFRAME_TARGET} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${XFRAME_TARGET} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

add_custom_target(xtest COMMAND test_xdataframe DEPENDS ${XDATAFRAME_TARGET})
add_custom_target(xtest COMMAND test_xframe DEPENDS ${XFRAME_TARGET})

20 changes: 10 additions & 10 deletions test/test_xaxis.cpp
Expand Up @@ -9,10 +9,10 @@
#include <cstddef>
#include <vector>
#include "gtest/gtest.h"
#include "xdataframe/xaxis.hpp"
#include "xframe/xaxis.hpp"
#include "xtl/xbasic_fixed_string.hpp"

namespace xdf
namespace xf
{
using fstring = xtl::xfixed_string<55>;
using label_type = std::vector<fstring>;
Expand Down Expand Up @@ -51,12 +51,12 @@ namespace xdf
{
label_type l = { "a", "b", "c" };
axis_type a(l);
EXPECT_EQ(3, a.size());
EXPECT_EQ(3u, a.size());
EXPECT_FALSE(a.empty());

label_type l2;
axis_type a2(l2);
EXPECT_EQ(0, a2.size());
EXPECT_EQ(0u, a2.size());
EXPECT_TRUE(a2.empty());
}

Expand All @@ -77,19 +77,19 @@ namespace xdf
auto aa = a["a"];
auto ab = a["b"];
auto ac = a["c"];
EXPECT_EQ(0, aa);
EXPECT_EQ(1, ab);
EXPECT_EQ(2, ac);
EXPECT_EQ(0u, aa);
EXPECT_EQ(1u, ab);
EXPECT_EQ(2u, ac);
EXPECT_THROW(a["d"], std::out_of_range);
}

{
auto aa = a("a");
auto ab = a("b");
auto ac = a("c");
EXPECT_EQ(0, aa);
EXPECT_EQ(1, ab);
EXPECT_EQ(2, ac);
EXPECT_EQ(0u, aa);
EXPECT_EQ(1u, ab);
EXPECT_EQ(2u, ac);
EXPECT_THROW(a["d"], std::out_of_range);
}
}
Expand Down
10 changes: 5 additions & 5 deletions xdataframeConfig.cmake.in → xframeConfig.cmake.in
Expand Up @@ -6,16 +6,16 @@
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

# xdataframe cmake module
# xframe cmake module
# This module sets the following variables in your project:
#
# xdataframe_FOUND - true if xdataframe found on the system
# xdataframe_INCLUDE_DIRS - the directory containing xdataframe headers
# xdataframe_LIBRARY - empty
# xframe_FOUND - true if xframe found on the system
# xframe_INCLUDE_DIRS - the directory containing xframe headers
# xframe_LIBRARY - empty

@PACKAGE_INIT@

set(PN xdataframe)
set(PN xframe)
set_and_check(${PN}_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
set(${PN}_LIBRARY "")
check_required_components(${PN})

0 comments on commit b933ccd

Please sign in to comment.