Skip to content

Consider using match/case syntax in powder map CLI #438

@ajjackson

Description

@ajjackson

Maybe time for a match in future? (Not this PR)

        match args.weighting:
            case 'dos' if args.pdos is None:
                spectrum_1d = sample_sphere_dos(
                    fc, q, **general_kwargs, **calc_modes_kwargs
                )
            case (*_, 'dos', *_):
                spectrum_1d_col = sample_sphere_pdos(
                    fc, q,
                    weighting=_get_pdos_weighting(args.weighting),
                    **general_kwargs,
                    **calc_modes_kwargs)
                spectrum_1d = _arrange_pdos_groups(spectrum_1d_col, args.pdos)
            case 'coherent':
                spectrum_1d = sample_sphere_structure_factor(
                    fc, q,
                    dw=dw,
                    temperature=temperature,
                    **general_kwargs,

Not sure if this is what you mean by "dos" in args.weighting?

Originally posted by @oerc0122 in #437 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions