Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision e326b29679d1df47e852eba76b361aed43210666 authored by Matt Garthwaite on 03 August 2020, 23:09:55 UTC, committed by GitHub on 03 August 2020, 23:09:55 UTC
Merge pull request #283 from GeoscienceAustralia/develop
Release 0.4.3
2 parent s f914bf5 + 313483f
  • Files
  • Changes
  • 4d41853
  • /
  • tests
  • /
  • test_system.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:e326b29679d1df47e852eba76b361aed43210666
directory badge
swh:1:dir:26614513071865f50bbc0d9c276a84a0c8fb6f0c
content badge
swh:1:cnt:33c896af4084b4061f39dc75679ec47cabd5caf5

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
test_system.py
# coding: utf-8
#   This Python module is part of the PyRate software package.
#
#   Copyright 2020 Geoscience Australia
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

"""
pyrate basic workflow for all supported input datasets

"""
from subprocess import check_call
from pathlib import Path
import pytest
import numpy as np
from pyrate.core import config as cf
from pyrate.configuration import Configuration


# @pytest.mark.slow
def test_workflow(system_conf):
    """check the handlers are working as expected"""
    check_call(f"mpirun -n 3 pyrate conv2tif -f {system_conf}", shell=True)
    check_call(f"mpirun -n 3 pyrate prepifg -f {system_conf}", shell=True)
    check_call(f"mpirun -n 3 pyrate process -f {system_conf}", shell=True)
    check_call(f"mpirun -n 3 pyrate merge -f {system_conf}", shell=True)

    # assert logs generated in the outdir
    params = Configuration(system_conf).__dict__
    for stage in ['conv2tif', 'prepifg', 'process', 'merge']:
        log_file_name = 'pyrate.log.' + stage
        files = list(Path(params[cf.OUT_DIR]).glob(log_file_name + '.*'))
        assert len(files) == 1


# @pytest.mark.slow
def test_single_workflow(gamma_conf):

    check_call(f"mpirun -n 4 pyrate workflow -f {gamma_conf}", shell=True)

    params = Configuration(gamma_conf).__dict__

    log_file_name = 'pyrate.log.' + 'workflow'
    files = list(Path(params[cf.OUT_DIR]).glob(log_file_name + '.*'))
    assert len(files) == 1

    # ref pixel file generated
    ref_pixel_file = Path(params[cf.OUT_DIR]).joinpath(cf.REF_PIXEL_FILE)
    assert ref_pixel_file.exists()
    ref_pixel = np.load(ref_pixel_file)
    np.testing.assert_array_equal(ref_pixel, [38, 58])

    # assert orbfit exists on disc
    from pyrate.core import shared
    looked_files = [p.sampled_path for p in params[cf.INTERFEROGRAM_FILES]]
    ifgs = [shared.Ifg(ifg) for ifg in looked_files]
    orbfits_on_disc = [Path(params[cf.OUT_DIR], cf.ORB_ERROR_DIR,
                          Path(ifg.data_path).stem + '_orbfit.npy')
                       for ifg in ifgs]
    assert all(orbfits_on_disc)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API