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

Small fixes #756

Merged
merged 4 commits into from
Feb 22, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Changelog for version 8.1
--------------

* implemented a new algorithm for global sparse Kronecker
* significant speedup when loading needed values

* dropped support for defunct python 2
* wasn't tested before and it was partially or fully broken already

Changelog for version 8.0
--------------

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.19)

cmake_policy(VERSION 3.19)
project(Tasmanian VERSION 8.0.0 LANGUAGES CXX)
set(Tasmanian_version_comment "") # e.g., " (release candidate)", " (development)", ""
project(Tasmanian VERSION 8.1.0 LANGUAGES CXX)
set(Tasmanian_version_comment " (development)") # e.g., " (release candidate)", " (development)", ""
set(Tasmanian_license "BSD 3-Clause with UT-Battelle disclaimer") # used in some headers and python modules (only human readable)

########################################################################
Expand Down
4 changes: 2 additions & 2 deletions Config/AltBuildSystems/TasmanianConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define __TASMANIAN_CONFIG_HPP

#define TASMANIAN_VERSION_MAJOR 8
#define TASMANIAN_VERSION_MINOR 0
#define TASMANIAN_VERSION_STRING "8.0"
#define TASMANIAN_VERSION_MINOR 1
#define TASMANIAN_VERSION_STRING "8.1"
#define TASMANIAN_LICENSE "BSD 3-Clause with UT-Battelle disclaimer"

#define TASMANIAN_GIT_COMMIT_HASH "Tasmanian git hash is not available here"
Expand Down
19 changes: 5 additions & 14 deletions InterfacePython/TasmanianAddons.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,27 +360,20 @@ def constructSurplusSurrogate(callableModel, iMaxPoints, iMaxParallel, iMaxSampl
for iI in range(iNumDims):
pLevelLimits[iI] = liLevelLimits[iI]

if (sys.version_info.major == 3):
sRefinementType = bytes(sRefinementType, encoding='utf8')
if (sCheckpointFilename):
sCheckpointFilename = bytes(sCheckpointFilename, encoding='utf8')

pCPFname = None
if (sCheckpointFilename):
pCPFname = c_char_p(sCheckpointFilename)
pCPFname = bytes(sCheckpointFilename, encoding='utf8') if sCheckpointFilename else None

pErrorCode = (c_int * 1)()

if (bUseInitialGuess):
pLibCTSG.tsgConstructSurrogateWiIGSurplus(
type_icsmodel(lambda nx, nd, x, f, ny, y, tid, err : tsgIcsModelWrapper(callableModel, nx, nd, x, f, ny, y, tid, err)),
iMaxPoints, iMaxParallel, iMaxSamplesPerCall, grid.pGrid,
fTolerance, c_char_p(sRefinementType), iOutput, pLevelLimits, pCPFname, pErrorCode)
fTolerance, bytes(sRefinementType, encoding='utf8'), iOutput, pLevelLimits, pCPFname, pErrorCode)
else:
pLibCTSG.tsgConstructSurrogateNoIGSurplus(
type_scsmodel(lambda nx, nd, x, ny, y, tid, err : tsgScsModelWrapper(callableModel, nx, nd, x, ny, y, tid, err)),
iMaxPoints, iMaxParallel, iMaxSamplesPerCall, grid.pGrid,
fTolerance, c_char_p(sRefinementType), iOutput, pLevelLimits, pCPFname, pErrorCode)
fTolerance, bytes(sRefinementType, encoding='utf8'), iOutput, pLevelLimits, pCPFname, pErrorCode)

if pErrorCode[0] != 0:
raise TasmanianInputError("constructSurplusSurrogate", "An error occurred during the call to Tasmanian.")
Expand Down Expand Up @@ -423,10 +416,9 @@ def createExoticQuadratureFromGrid(level, shift, ref_grid, description, is_symme
'''
if not hasattr(ref_grid, "TasmanianSparseGridObject"):
raise TasmanianInputError("ref_grid", "ERROR: ref_grid must be an instance of TasmanianSparseGrid")
effective_description = bytes(description, encoding='utf8') if sys.version_info.major == 3 else description
ct = TasmanianSG.CustomTabulated()
pLibCTSG.tsgCreateExoticQuadratureFromGrid(c_void_p(ct.pCustomTabulated), c_int(level), c_double(shift), c_void_p(ref_grid.pGrid),
c_char_p(effective_description), c_int(is_symmetric))
bytes(description, encoding='utf8'), c_int(is_symmetric))
return ct

def createExoticQuadratureFromFunction(level, shift, weight_fn, nref, description, is_symmetric = False):
Expand All @@ -444,8 +436,7 @@ def createExoticQuadratureFromFunction(level, shift, weight_fn, nref, descriptio

output: a Python CustomTabulated object.
'''
effective_description = bytes(description, encoding='utf8') if sys.version_info.major == 3 else description
ct = TasmanianSG.CustomTabulated()
pLibCTSG.tsgCreateExoticQuadratureFromFunction(c_void_p(ct.pCustomTabulated), c_int(level), c_double(shift), type_1Dfunc(weight_fn),
c_int(nref), c_char_p(effective_description), c_int(is_symmetric))
c_int(nref), bytes(description, encoding='utf8'), c_int(is_symmetric))
return ct
Loading
Loading