Skip to content

Commit

Permalink
Merge branch 'develop' into feature_NoThrowParms
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski authored Sep 4, 2024
2 parents 0499111 + 80d98b8 commit 06e1b8c
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 29 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CDImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
- name: Build Docker image
run: |
if [ "${{ github.event_name }}" == 'release' ]; then
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_release }} --build-arg MACH3_VERSION=develop
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.os }}v${{ github.event.release.tag_name }} --build-arg MACH3_VERSION=develop
else
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_latest }} --build-arg MACH3_VERSION=develop
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/CIValidations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Validations CI

# The events that trigger the workflow
on:
pull_request:
branches: [ develop ]

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest

name: ${{ matrix.name }}

strategy:
fail-fast: false # Prevents cancellation of remaining jobs if one fails
matrix:
include:
- name: SplineValidations
- name: CovarianceValidations
- name: FitterValidations
container:
image: ghcr.io/mach3-software/mach3:alma9latest

steps:
- uses: actions/checkout@v3


- name: Get MaCh3 Validations
run: |
cd /opt/
git clone https://github.com/mach3-software/MaCh3Validations.git MaCh3Validations
cd MaCh3Validations
mkdir build
cd build
cmake ../ -DMaCh3_Branch=${{ github.head_ref }}
- name: Build MaCh3 Validations
run: |
cd /opt/MaCh3Validations/build
make install # Build the project
- name: Validations
run: |
source /opt/MaCh3Validations/build/bin/setup.MaCh3.sh
source /opt/MaCh3Validations/build/bin/setup.MaCh3Validations.sh
cd /opt/MaCh3Validations/build
Apps/${{ matrix.name }}
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ LIST(APPEND ALL_FEATURES
DEBUG
MULTITHREAD
GPU
PYTHON
LOW_MEMORY_STRUCTS
Oscillator
Fitter
Expand Down Expand Up @@ -232,8 +233,6 @@ if( MaCh3_PYTHON_ENABLED )
endif()




#This is to export the target properties of MaCh3
#Anything that links to "MaCh3" will get all of these target properties
add_library(MaCh3 INTERFACE)
Expand Down Expand Up @@ -340,4 +339,4 @@ if(NOT TARGET uninstall)
endif()

# KS: Configure the Doxygen input file, this is to ensure whenever we update MaCh3 version Doxyfile will have same version.
configure_file(${CMAKE_SOURCE_DIR}/cmake/Templates/Doxyfile.in ${CMAKE_SOURCE_DIR}/Doc/Doxyfile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/Doc/Doxyfile @ONLY)
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Alma9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1 && make install

# KS: Need to set them here, otherwise container using this container will not be able to find MaCh3
Expand Down
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Fedora32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1
RUN make install

Expand Down
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1
RUN make install

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Markov Chain 3 flavour is a framework born in 2013 as a Bayesian MCMC fitter
The framework has also evolved to allow non MCMC modules to interrogate the likelihoods implemented.

[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://github.com/mach3-software/MaCh3/blob/develop/LICENSE.txt)
[![Release - v1.0.0](https://img.shields.io/badge/Release-v1.0.0-2ea44f)](https://github.com/mach3-software/MaCh3/releases)
[![Release - v1.1.0](https://img.shields.io/badge/Release-v1.1.0-2ea44f)](https://github.com/mach3-software/MaCh3/releases)
[![Container Image](https://img.shields.io/badge/Container-Image-brightgreen)](https://github.com/mach3-software/MaCh3/pkgs/container/mach3)
[![Code - Documented](https://img.shields.io/badge/Code-Documented-2ea44f)](https://github.com/mach3-software/MaCh3/wiki)
[![Code - Doxygen](https://img.shields.io/badge/Code-Doxygen-2ea44f)](https://mach3-software.github.io/MaCh3/index.html)
Expand All @@ -15,7 +15,7 @@ Example of plots made using MaCh3 apparent in scientific publications, for more
<img src="Doc/Plots/Jarlskog.png" alt="MaCh3" align="center" width="200"/>

## Cite
When citing MaCh3, please use [on Zenodo](https://zenodo.org/records/10949376) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10949376.svg)](https://doi.org/10.5281/zenodo.10949376).
When citing MaCh3, please use [on Zenodo](https://zenodo.org/records/7608367) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13642670.svg)](https://doi.org/10.5281/zenodo.13642670).

# How to Compile
MaCh3 follows standard cmake pattern. By default you should get most optimal build setting although below we list many configurable options:
Expand All @@ -32,18 +32,20 @@ Don't forget to:
source bin/setup.MaCh3.sh
```
## Building against MaCh3
If you compiled MaCh3 and sourced it you can simply call
```
find_package(MaCh3)
```
and cmake will find it. Alternatively, you can use CPM, for example:
To include MaCh3 in your cmake project you can use following syntax
```
CPMFindPackage(
NAME MaCh3
GIT_TAG "blarb"
GITHUB_REPOSITORY mach3-software/MaCh3
)
```
Where "blarb" is the MaCh3 version. You can find a list of releases [here](https://github.com/mach3-software/MaCh3/wiki/0.1.-History)
If you compiled MaCh3 and sourced it you can simply call
```
find_package(MaCh3)
```

Once you found MaCh3 you might want to link your library against MaCh3. You can do this as follows:
```
target_link_libraries(blarb MaCh3::All)
Expand All @@ -55,7 +57,7 @@ Some functionalities rely on setting `Env{MACH3}` which should point to path exp

MaCh3 can be compiled with a python interface by specifying the cmake option
```
cmake ../ MaCh3_PYTHON_ENABLED=ON
cmake ../ -DMaCh3_PYTHON_ENABLED=ON
make && make install
```
and then adding the path to the installed module to your `PYTHONPATH` environment variable:
Expand Down
1 change: 1 addition & 0 deletions cmake/Templates/MaCh3Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(DEBUG_LEVEL @DEBUG_LEVEL@)
set(MaCh3_DEBUG_ENABLED @MaCh3_DEBUG_ENABLED@)
set(MaCh3_MULTITHREAD_ENABLED @MaCh3_MULTITHREAD_ENABLED@)
set(MaCh3_GPU_ENABLED @MaCh3_GPU_ENABLED@)
set(MaCh3_PYTHON_ENABLED @MaCh3_PYTHON_ENABLED@)
set(MaCh3_MINUIT2_ENABLED @MaCh3_MINUIT2_ENABLED@)

get_filename_component(MaCh3_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
Expand Down
6 changes: 0 additions & 6 deletions covariance/covarianceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,6 @@ void covarianceBase::setParameters(const std::vector<double>& pars) {
}
}
}

MACH3LOG_DEBUG("Set parameters to:");
for(size_t par_i = 0 ; par_i < pars.size() ; ++par_i){
MACH3LOG_DEBUG("{} : {}", par_i, _fPropVal[par_i]);
}

// And if pca make the transfer
if (pca) {
TransferToPCA();
Expand Down
4 changes: 2 additions & 2 deletions mcmc/FitterBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ void FitterBase::PrepareOutput() {
{
// Check that we have added samples
if (!samples.size()) {
MACH3LOG_CRITICAL("No samples Found! If this is what you want find me here");
throw MaCh3Exception(__FILE__ , __LINE__ );
MACH3LOG_CRITICAL("No samples Found! Is this really what you wanted?");
//throw MaCh3Exception(__FILE__ , __LINE__ );
}

// Prepare the output trees
Expand Down
2 changes: 1 addition & 1 deletion mcmc/MinuitFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void MinuitFit::runMCMC() {
//KS: add config or something
minuit->SetPrintLevel(2);
minuit->SetTolerance(0.01);
minuit->SetMaxFunctionCalls(fitMan->raw()["General.NSteps"].as<double>());
minuit->SetMaxFunctionCalls(fitMan->raw()["General"]["Minuit2"]["NSteps"].as<double>());
minuit->SetMaxIterations(10000);

MACH3LOG_INFO("Preparing Minuit");
Expand Down
4 changes: 1 addition & 3 deletions plotting/plottingUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ target_link_libraries( Plotting ${ROOT_LIBRARIES} MaCh3::Manager )

## to be compiled into python module needs to be compiled as position independent library
if( MaCh3_PYTHON_ENABLED )

set_property( TARGET Plotting PROPERTY POSITION_INDEPENDENT_CODE ON )

endif()

install(TARGETS Plotting
Expand All @@ -32,4 +30,4 @@ install(TARGETS Plotting
PUBLIC_HEADER DESTINATION include/plotting
)

add_library(MaCh3::Plotting ALIAS Plotting)
add_library(MaCh3::Plotting ALIAS Plotting)
4 changes: 2 additions & 2 deletions plotting/plottingUtils/inputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ std::vector<std::string> InputManager::getTaggedValues(const std::vector<std::st
if (valTags.size() == 0) continue;

// count how many of the specified tags match the tags of the current value
int tagCount = 0;
unsigned int tagCount = 0;
for ( const std::string &tag: tags )
{
if ( std::find( valTags.begin(), valTags.end(), tag ) != valTags.end() )
Expand Down Expand Up @@ -734,4 +734,4 @@ void InputManager::fillFileData(InputFile &inputFileDef, bool printThoughts) {
}
}

} // namespace MaCh3Plotting
} // namespace MaCh3Plotting

0 comments on commit 06e1b8c

Please sign in to comment.