Skip to content

Commit 730d0af

Browse files
committed
Merge branch 'develop' into 'main'
ACEtk v1.0.4 See merge request njoy/ACEtk!34
2 parents e8e5e31 + f5e5292 commit 730d0af

File tree

225 files changed

+175
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+175
-311
lines changed

.cmake/shacl_FetchContent.cmake

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,32 @@ function(shacl_FetchContent_Declare name)
157157
if(NOT override_pkg_index EQUAL -1)
158158
message(FATAL_ERROR "shacl_FetchContent - cannot use OVERRIDE_FIND_PACKAGE in conjunction with shacl_Fetchcontent.force_find_package")
159159
endif()
160-
list(APPEND arg_subset REQUIRED)
160+
list(APPEND arg_subset REQUIRED)
161161
endif()
162+
162163
# If the dependency uses a relative path then it uses the same server as the host project.
163164
# This is useful for automated testing with gitlab CI tokens or if repos are hosted on different servers
164165
# e.g. if the project is hosted on github then pull all relative dependencies from github.
165166

166-
# Find the GIT_REPOSITORY keyword then increment index to point to associated value
167+
# Find the GIT_REPOSITORY keyword then increment index to point to associated value.
167168
list(FIND arg_subset GIT_REPOSITORY git_repository_index)
168169
math(EXPR git_repository_index "${git_repository_index}+1")
169170
list(GET arg_subset ${git_repository_index} git_repository_url)
170171

171-
# Update the git URL if it was a relative URL, otherwise return it unchanged
172+
# Update the git URL if it was a relative URL, otherwise return it unchanged.
172173
get_dependency_url(${git_repository_url} updated_url)
174+
175+
# If the .git directory does not exist, then cmake will fail to resolve a relative url and throw an error.
176+
# In that case replace the relative URL with a value to avoid the error and force the use of find_package.
177+
if( NOT IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
178+
if( "${updated_url}" MATCHES "^\\./|^\\.\\./" )
179+
message( WARNING "Could not find local .git directory to resolve a relative url, forcing the use of find_package")
180+
set( shacl_FetchContent.force_find_package ON )
181+
list(APPEND arg_subset REQUIRED)
182+
set( updated_url "unresolved_relative_url.git" )
183+
endif()
184+
endif()
185+
173186
list(REMOVE_AT arg_subset ${git_repository_index})
174187
list(INSERT arg_subset ${git_repository_index} ${updated_url})
175188

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ trigger_ci_downstream:
2323

2424
variables:
2525
MERGE_TYPE: $CI_PIPELINE_SOURCE
26+
PARENT_MR_ID: "$CI_MERGE_REQUEST_IID"
2627
PROJECT_ROOT_NAME: "ACEtk"
2728

2829
check:
2930
stage: check_ok
3031
script:
32+
- printenv
3133
- echo "Looks good..."

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if( DEFINED PROJECT_NAME )
1010
endif()
1111

1212
project( ACEtk
13-
VERSION 1.0.3
13+
VERSION 1.0.4
1414
LANGUAGES CXX
1515
)
1616

@@ -82,12 +82,12 @@ if (ACEtk.python AND NOT TARGET njoy::tools.python)
8282
set(ACEtk.python OFF)
8383
endif()
8484

85-
if (ACEtk.python)
86-
add_subdirectory(python)
85+
if ( ACEtk.python )
86+
add_subdirectory( python )
8787
endif()
8888

8989
if( ACEtk.tests )
90-
include( cmake/unit_testing.cmake )
90+
add_subdirectory( test )
9191
endif()
9292

9393
#######################################################################
@@ -145,8 +145,8 @@ endif()
145145
########################################################################
146146

147147
# enable Edit and Continue in Visual Studio (for debugging)
148-
if(MSVC)
149-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
148+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
149+
if(MSVC)
150150
target_compile_options(${PROJECT_NAME} INTERFACE "/ZI")
151151
target_link_options(${PROJECT_NAME} INTERFACE "/INCREMENTAL")
152152
endif()

ReleaseNotes.md

Lines changed: 9 additions & 0 deletions

cmake/dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include( shacl_FetchContent )
88

99
shacl_FetchContent_Declare( tools
1010
GIT_REPOSITORY ../../njoy/tools
11-
GIT_TAG 22bae7709d012914f32c99c0fb7aab06f49c5f62 # tag: v0.4.3
11+
GIT_TAG b03f7f65070d84009c1ba5ae2e095f2e8a1a6ed4 # tag: v0.4.4
1212
)
1313

1414
#######################################################################

cmake/unit_testing.cmake

Lines changed: 96 additions & 103 deletions
Large diffs are not rendered by default.

python/src/PhotoatomicTable.python.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,18 @@ void wrapPhotoatomicTable( python::module& module, python::module& ) {
419419
&Table::photoelectricCrossSectionBlock,
420420
"The photolectric cross section block for eprdata (NEPR > 0)"
421421
)
422+
.def_property_readonly(
423+
424+
"XPROB",
425+
&Table::XPROB,
426+
"The subshell transition data block for eprdata (NEPR > 0)"
427+
)
428+
.def_property_readonly(
429+
430+
"subshell_transition_data_block",
431+
&Table::subshellTransitionDataBlock,
432+
"The subshell transition data block for eprdata (NEPR > 0)"
433+
)
422434
.def_property_readonly(
423435

424436
"ESZE",

python/src/electron/ElectronSubshellBlock.python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void wrapElectronSubshellBlock( python::module& module, python::module& ) {
3939
block
4040
.def(
4141

42-
python::init< std::vector< unsigned int >, std::vector< unsigned int >,
42+
python::init< std::vector< unsigned int >, std::vector< double >,
4343
std::vector< double >, std::vector< double >,
4444
std::vector< unsigned int > >(),
4545
python::arg( "designators" ), python::arg( "electrons" ),

python/stubs/ACEtk/ACEtk.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,11 @@ class PhotoatomicTable:
13441344
The temperature of the table
13451345
"""
13461346
@property
1347+
def XPROB(self) -> electron.SubshellTransitionDataBlock | None:
1348+
"""
1349+
The subshell transition data block for eprdata (NEPR > 0)
1350+
"""
1351+
@property
13471352
def Z(self) -> int:
13481353
"""
13491354
The atom number of the target
@@ -1510,6 +1515,11 @@ class PhotoatomicTable:
15101515
The principal cross section block
15111516
"""
15121517
@property
1518+
def subshell_transition_data_block(self) -> electron.SubshellTransitionDataBlock | None:
1519+
"""
1520+
The subshell transition data block for eprdata (NEPR > 0)
1521+
"""
1522+
@property
15131523
def temperature(self) -> float:
15141524
"""
15151525
The temperature of the table

python/stubs/ACEtk/electron.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class ElectronSubshellBlock:
407407
- the number of possible transitions to fill a vacancy for each subshell
408408
The size of each (the total number of electron shells) is stored in NXS(7).
409409
"""
410-
def __init__(self, designators: list[int], electrons: list[int], energies: list[float], probabilities: list[float], transitions: list[int]) -> None:
410+
def __init__(self, designators: list[int], electrons: list[float], energies: list[float], probabilities: list[float], transitions: list[int]) -> None:
411411
"""
412412
Initialise the block
413413

0 commit comments

Comments
 (0)