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

pyfprops is now only fprops #46

Merged
merged 1 commit into from
Oct 30, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pyplots/plot_err.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from CoolProp import AbstractState
from CoolProp.CoolProp import PhaseSI, PropsSI, get_global_param_string
import CoolProp.CoolProp as CoolProp
import pyfprops as fp
import fprops as fp
import math
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion docs/python/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ temperature = 280 K.

.. code::

import pyfprops as fp
import fprops as fp
n2 = fp.Nitrogen()
# p = 1MPa, T = 280 K
s = n2.p_T(1e6, 280)
Expand Down
4 changes: 2 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if (FPROPS_BUILD_TESTS)
find_program(PYTEST "pytest" REQUIRED)
enable_testing()
add_test(
NAME pyfprops-test
NAME python-tests
COMMAND ${PYTEST} ${CMAKE_CURRENT_SOURCE_DIR}
)
set_tests_properties(pyfprops-test PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/src:$ENV{PYTHONPATH}")
set_tests_properties(python-tests PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/src:$ENV{PYTHONPATH}")
endif()
4 changes: 2 additions & 2 deletions python/setup.py.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from setuptools import Extension, setup

setup(
name='pyfprops',
name='fprops',
version='${PROJECT_VERSION}',
packages=['pyfprops'],
packages=['fprops'],
package_dir={ '': '${CMAKE_CURRENT_SOURCE_DIR}/src' }
)
14 changes: 7 additions & 7 deletions python/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
cmake_minimum_required(VERSION 3.4...3.18)
project(pyfprops LANGUAGES C CXX)
project(fprops LANGUAGES C CXX)

find_package(pybind11 2.9 REQUIRED)

pybind11_add_module(${PROJECT_NAME} fprops.cpp)
pybind11_add_module(fprops fprops.cpp)

target_include_directories(
${PROJECT_NAME}
fprops
PRIVATE
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/include
${EIGEN3_INCLUDE_DIR}
)

target_link_libraries(
${PROJECT_NAME}
fprops
PUBLIC
fprops
libfprops
)

install(
TARGETS ${PROJECT_NAME}
TARGETS fprops
COMPONENT python
LIBRARY DESTINATION "lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/pyfprops"
LIBRARY DESTINATION "lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/fprops"
)
2 changes: 1 addition & 1 deletion python/src/fprops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace fprops;

namespace py = pybind11;

PYBIND11_MODULE(pyfprops, m)
PYBIND11_MODULE(fprops, m)
{
m.doc() = "pybind11 plugin for fprops";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .pyfprops import *
from .fprops import *

__all__ = [
Air,
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_air.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyfprops as fp
import fprops as fp
import pytest
import math

Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_co2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyfprops as fp
import fprops as fp
import pytest
import math

Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_helium.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyfprops as fp
import fprops as fp
import pytest
import math

Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_nitrogen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyfprops as fp
import fprops as fp
import pytest
import math

Expand Down
13 changes: 8 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_library(
${PROJECT_NAME}
libfprops
SHARED
Air.cpp
CarbonDioxide.cpp
Expand All @@ -13,20 +13,23 @@ add_library(
SinglePhaseFluidProperties.cpp
Utils.cpp
)
if(NOT MSVC)
set_target_properties(libfprops PROPERTIES OUTPUT_NAME fprops)
endif()
if(CMAKE_PROJECT_NAME STREQUAL "fprops")
target_code_coverage(${PROJECT_NAME})
target_sanitization(${PROJECT_NAME})
endif()

set_target_properties(
${PROJECT_NAME}
libfprops
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)

target_include_directories(
${PROJECT_NAME}
libfprops
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/fprops>
Expand All @@ -38,7 +41,7 @@ target_include_directories(
)

target_link_libraries(
${PROJECT_NAME}
libfprops
PUBLIC
fmt::fmt
PRIVATE
Expand All @@ -57,7 +60,7 @@ write_basic_package_version_file(fpropsConfigVersion.cmake
)

install(
TARGETS fprops
TARGETS libfprops
EXPORT fpropsTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
Expand Down
2 changes: 1 addition & 1 deletion test/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_include_directories(
target_link_libraries(
${PROJECT_NAME}
PUBLIC
fprops
libfprops
gtest_main
gmock_main
)
Loading