diff --git a/.github/workflows/sonarcloud_analysis.yml b/.github/workflows/sonarcloud_analysis.yml index c649468..09bc3d9 100644 --- a/.github/workflows/sonarcloud_analysis.yml +++ b/.github/workflows/sonarcloud_analysis.yml @@ -29,7 +29,7 @@ jobs: with: name: pytest_junitxml - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarqube-scan-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 565c76f..1b48aa7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "pyelq-sdk" -version = "1.0.11" +version = "1.0.12" description = "Package for detection, localization and quantification code." authors = ["Bas van de Kerkhof", "Matthew Jones", "David Randell"] homepage = "https://sede-open.github.io/pyELQ/" diff --git a/sonar-project.properties b/sonar-project.properties index be5a7e8..dcec270 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,4 @@ sonar.python.coveragePlugin=cobertura sonar.python.xunit.reportPath=pytest_junit.xml sonar.tests=tests sonar.sourceEncoding=UTF-8 -sonar.coverage.exclusions=*/pyelq/data_access/*.*, */pyelq/plotting/*.* +sonar.coverage.exclusions=*/pyelq/data_access/*.*, */pyelq/plotting/*.*, */pyelq/support_functions/post_processing.py diff --git a/src/pyelq/component/source_model.py b/src/pyelq/component/source_model.py index ad19a97..f809872 100644 --- a/src/pyelq/component/source_model.py +++ b/src/pyelq/component/source_model.py @@ -425,6 +425,8 @@ class SourceModel(Component, SourceGrouping, SourceDistribution): reversible_jump (bool): logical indicating whether the reversible jump algorithm for estimation of the number of sources and their locations should be run. Defaults to False. + random_walk_step_size (np.ndarray): (3 x 1) array specifying the standard deviations of the distributions + from which the random walk sampler draws new source locations. Defaults to np.array([1.0, 1.0, 0.1]). site_limits (np.ndarray): (3 x 2) array specifying the lower (column 0) and upper (column 1) limits of the analysis site. Only relevant for cases where reversible_jump == True (where sources are free to move in the solution). @@ -462,6 +464,7 @@ class SourceModel(Component, SourceGrouping, SourceDistribution): gas_species: GasSpecies = field(init=False, default=None) reversible_jump: bool = False + random_walk_step_size: np.ndarray = field(default_factory=lambda: np.array([1.0, 1.0, 0.1], ndmin=2).T) site_limits: np.ndarray = None rate_num_sources: int = 5 n_sources_max: int = 20 @@ -788,7 +791,7 @@ def make_sampler_rjmcmc(self, model: Model, sampler_list: list) -> list: RandomWalkLoop( "z_src", model, - step=np.array([1.0, 1.0, 0.1], ndmin=2).T, + step=self.random_walk_step_size, max_variable_size=(3, self.n_sources_max), domain_limits=self.site_limits, state_update_function=self.move_function,