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

https://github.com/GeoscienceAustralia/PyRate
09 August 2023, 08:52:18 UTC
  • Code
  • Branches (23)
  • Releases (1)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/CI-patch
    • refs/heads/data
    • refs/heads/dependabot/pip/joblib-1.2.0
    • refs/heads/dependabot/pip/numpy-1.22.0
    • refs/heads/dependabot/pip/scipy-1.10.0
    • refs/heads/develop
    • refs/heads/gh-pages
    • refs/heads/master
    • refs/heads/mg/actions
    • refs/heads/sb/largetifs-enhancements
    • refs/heads/sb/orbfit-independent-method
    • refs/heads/sb/orbital-correction-experiements
    • refs/heads/sb/phase-closure-correction
    • refs/heads/sb/upgrade-ci-ubuntu
    • refs/heads/sb/use-mpi-shared
    • refs/tags/0.3.0
    • refs/tags/0.4.0
    • refs/tags/0.4.1
    • refs/tags/0.4.2
    • refs/tags/0.4.3
    • refs/tags/0.5.0
    • refs/tags/0.6.0
    • refs/tags/0.6.1
    • 0.2.0
  • 166ebcb
  • /
  • tests
  • /
  • test_system.py
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:a250a26da1e29a991fd2a4cda506c7774f6a250f
origin badgedirectory badge
swh:1:dir:7f35e4dc0c2518d4b26d94734e3cb985e30c755b
origin badgerevision badge
swh:1:rev:3fd3e706522d0f4675eb006a9e9a141931668675
origin badgesnapshot badge
swh:1:snp:e85aafb5fc900c1df2eebb773a8b8e11798084c1

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.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 3fd3e706522d0f4675eb006a9e9a141931668675 authored by Sudipta Basak on 17 June 2021, 05:56:54 UTC
WIP orbital correction tests
Tip revision: 3fd3e70
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

"""
import shutil
from subprocess import check_call
from pathlib import Path
import pytest
import numpy as np
import pyrate.constants as C
from pyrate.core.mpiops import MPI_INSTALLED
from pyrate.configuration import Configuration
from tests.common import MEXICO_CROPA_CONF, PY37GDAL302


@pytest.mark.mpi
@pytest.mark.slow
@pytest.mark.skipif(not PY37GDAL302, reason="Only run in one CI env")
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 correct -f {system_conf}", shell=True)
    check_call(f"mpirun -n 3 pyrate timeseries -f {system_conf}", shell=True)
    check_call(f"mpirun -n 3 pyrate stack -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', 'correct', 'timeseries', 'stack', 'merge']:
        log_file_name = 'pyrate.log.' + stage
        files = list(Path(params[C.OUT_DIR]).glob(log_file_name + '.*'))
        assert len(files) == 1
    shutil.rmtree(params[C.OUT_DIR])


def test_single_workflow(gamma_or_mexicoa_conf):
    if MPI_INSTALLED:
        check_call(f"mpirun -n 4 pyrate workflow -f {gamma_or_mexicoa_conf}", shell=True)
    else:
        check_call(f"pyrate workflow -f {gamma_or_mexicoa_conf}", shell=True)

    params = Configuration(gamma_or_mexicoa_conf).__dict__

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

    # ref pixel file generated
    ref_pixel_file = params[C.REF_PIXEL_FILE]
    assert Path(ref_pixel_file).exists()
    ref_pixel = np.load(ref_pixel_file)
    if gamma_or_mexicoa_conf == MEXICO_CROPA_CONF:
        np.testing.assert_array_equal(ref_pixel, [42, 2])
        for f in C.GEOMETRY_OUTPUT_TYPES:
            assert Path(params[C.GEOMETRY_DIR]).joinpath(f + '.tif').exists()
    else:
        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[C.INTERFEROGRAM_FILES]]
    ifgs = [shared.Ifg(ifg) for ifg in looked_files]
    orbfits_on_disc = [Path(params[C.OUT_DIR], C.ORB_ERROR_DIR, Path(ifg.data_path).stem + '_orbfit.npy')
                       for ifg in ifgs]
    assert all(orbfits_on_disc)
    shutil.rmtree(params[C.OUT_DIR])

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