Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

read_gdx fails for repeated domain names

未关闭
#24 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@jd-foster 已经在做这个了。

开始于 2026年9月29日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
julia
领域
data

调研方向

Start with the read_gdx entry point and run the minimal reproducer from the issue, which creates a GDXParameter with domains COMM, REG, REG. Done means repeated domains can be represented in the record table with names such as REG and REG_2 while the GDX symbol retains the original domain metadata ["COMM", "REG", "REG"].

由索引模型根据 Issue 内容生成。

描述

read_gdx fails on a parameter with domains (COMM, REG, REG):
duplicate field name in NamedTuple: "REG" is not unique

GTAP’s GDX core-data documentation defines bilateral trade as VXSB(COMM, REG, REG): Chapter 6: The GTAP Data Base for GAMS Users.

The attached minimal reproducer creates such a GDX file:

using GDXInterface

path = tempname() * ".gdx"

try
    regions = GDXSet("REG", "", ["*"], (; dim1 = ["R1", "R2"]))
    commodities = GDXSet("COMM", "", ["*"], (; dim1 = ["G1"]))
    trade = GDXParameter(
        "VXSB",
        "",
        ["COMM", "REG", "REG"],
        (
            COMM = ["G1"],
            ORIGIN = ["R1"],
            DESTINATION = ["R2"],
            value = [1.0],
        ),
    )
    gdx = GDXFile(
        path,
        Dict{Symbol, GDXSymbol}(
            :REG => regions,
            :COMM => commodities,
            :VXSB => trade,
        ),
    )
    write_gdx(path, gdx)
    read_gdx(path)
finally
    rm(path; force = true)
end

Could read_gdx disambiguate repeated domain names when constructing record tables, such as COMM, REG, and REG_2, while preserving the original domain metadata ["COMM", "REG", "REG"] on the GDX symbol?

主要语言
Julia
星标
9
派生
4
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jump-dev/GDXInterface.jl 的其他 Issue

查看 jump-dev/GDXInterface.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。