Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected handling of duplicate column names #13

Open
4er4er4er opened this issue Nov 8, 2020 · 0 comments
Open

Unexpected handling of duplicate column names #13

4er4er4er opened this issue Nov 8, 2020 · 0 comments

Comments

@4er4er4er
Copy link

The attached example aborts with:

Error at _cmdno 152 executing "read_table" command
(file modex-hor.run, line 426, offset 11600):

	Error reading table TICenTer with table handler amplxl:
	Could not parse data

This is the table that amplxl is trying to read:

table TICenTer IN 'amplxl' (pinpxls) 'backup=false':
    sthegen <- [Unidad],
    pthetyp ~ TipoCen,
    pthebar ~ Barra,
    pthelaw ~ LeyERNC,
    pthemngro ~ PotMin,
    pthemxgro ~ PotMax,
    pthestup ~ CosPart,
    pthestdn ~ CosDete,
    ptheico ~ ConsInt,
    pthefor ~ TSFor,
    pthehea ~ ConsEsp,
    pthenfc ~ CVNC,
    pthemrk ~ Marcador,
    pthefac ~ Factor,
    pthemksm ~ SumMul;

The underlying error is that two columns of table TICenTer are labeled Unidad:

  • The 1st column, which provides a list of unique thermal generating units that are supposed to populate the set sthegen.
  • The 14th column, which specifies units of measurement.

What happens here is consistent with amplxl trying to populate sthegen from the 14th column, and -- since the entries in that column are not unique -- giving the mysterious Could not parse data error as reported in issue #12.

To use the example, put the mod and run files in the same directory as the AMPL executable, and put the two xlsx files in a subdirectory named test. As expected, the problem goes away when the 14th column is labeled something else, like Unidades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant