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 f77ad6e7fd90f3c0eb255bd553d4666b5db40bcf authored by Matt Garthwaite on 04 August 2020, 00:12:52 UTC, committed by Matt Garthwaite on 04 August 2020, 00:12:52 UTC
update release date and authors
1 parent e326b29
  • Files
  • Changes
  • 68a425b
  • /
  • tests
  • /
  • test_process.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:f77ad6e7fd90f3c0eb255bd553d4666b5db40bcf
directory badge
swh:1:dir:26614513071865f50bbc0d9c276a84a0c8fb6f0c
content badge
swh:1:cnt:5dfde431e3f1129b6d516a886b42a0b306863ced

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
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 ...
test_process.py
from pathlib import Path
import pytest
from pyrate import process, prepifg, conv2tif
import pyrate.core.config as cf
from pyrate.core.config import ConfigException
from tests import common


def test_unsupported_process_steps_raises(gamma_params):
    gamma_params['process'] = ['orbfit2', 'something_other_step']
    with pytest.raises(ConfigException):
        process.process_ifgs(gamma_params)


def test_supported_process_steps_dont_raise(gamma_params):
    supported_stpes = ['orbfit', 'refphase', 'mst', 'apscorrect', 'maxvar', 'timeseries', 'stack']
    assert all([s in gamma_params['process'] for s in supported_stpes])
    process.__validate_process_steps(params=gamma_params)


def test_process_treats_prepif_outputs_readonly(gamma_conf, tempdir, coh_mask):
    from pyrate.configuration import Configuration
    tdir = Path(tempdir())
    params = common.manipulate_test_conf(gamma_conf, tdir)
    params[cf.COH_MASK] = coh_mask
    params[cf.PARALLEL] = 0
    output_conf = tdir.joinpath('conf.cfg')
    cf.write_config_file(params=params, output_conf_file=output_conf)
    params = Configuration(output_conf).__dict__
    conv2tif.main(params)
    tifs = list(Path(params[cf.OUT_DIR]).glob('*_unw_ifg.tif'))
    assert len(tifs) == 17

    params = Configuration(output_conf).__dict__
    prepifg.main(params)
    cropped = list(Path(params[cf.OUT_DIR]).glob('*cr.tif'))

    if coh_mask:  # 17 + 1 dem + 17 coh files
        assert len(cropped) == 35
    else:  # 17 + 1 dem
        assert len(cropped) == 18
    # check all tifs from conv2tif are still readonly
    for t in tifs:
        assert t.stat().st_mode == 33060

    # check all prepifg outputs are readonly
    for c in cropped:
        assert c.stat().st_mode == 33060

    params = Configuration(output_conf).__dict__
    process.main(params)

    # check all after process steps multilooked files are still readonly
    for c in cropped:
        assert c.stat().st_mode == 33060
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