Skip to content

Fail to import module via github url #9

Description

@jnnr

Describe the bug
As of now, grid-builder cannot be imported into another Snakemake workflow by pointing to the github url.

To Reproduce
Steps to reproduce the behavior:

  1. Import the module into a Snakemake workflow.
configfile: "config/modules/grid_builder.yaml"


module module_grid_builder:
    pathvars:
        logs="results/module_grid_builder/logs",
        resources="results/module_grid_builder/resources",
        results="results/module_grid_builder/results",
    snakefile:
        github(
            "pypsa/grid-builder",
            path="workflow/Snakefile",
            tag="6905b99",
        )
    config:
        config["grid_builder"]


use rule * from module_grid_builder as module_grid_builder_*

rule all_grid_builder:
    default_target: True
    input:
        rules.module_grid_builder_retrieve_osm_all.input,
  1. Request something from the module

pixi run snakemake -c 2 all_grid_builder

  1. See error
ImportError in file "https://raw.githubusercontent.com/pypsa/grid-builder/6905b99/workflow/Snakefile", line 8:
cannot import name 'load_region_configs' from 'scripts._schema'
  File "https://raw.githubusercontent.com/pypsa/grid-builder/6905b99/workflow/Snakefile", line 8, in <module>

Expected behavior
The reference to scripts._schema should be correctly resolved.

Desktop (please complete the following information):

  • OS: Linux Fedora 43

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions