Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration file for JuliaFormatter.jl
# For more information, see: https://domluna.github.io/JuliaFormatter.jl/stable/config/

always_for_in = true
always_use_return = true
margin = 80
remove_extra_newlines = true
separate_kwargs_with_semicolon = true
short_to_long_function_def = true
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
29 changes: 5 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: CI
on:
push:
branches:
- main
- release-*
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
# needed to allow julia-actions/cache to delete old caches that it has created
Expand All @@ -17,29 +15,12 @@ jobs:
strategy:
fail-fast: false
matrix:
# Only test on a subset of possible platforms.
include:
- version: '1' # The latest point-release (Linux)
os: ubuntu-latest
arch: x64
- version: '1' # The latest point-release (Windows)
os: windows-latest
arch: x64
- version: '1.10' # 1.10 LTS (64-bit Linux)
os: ubuntu-latest
arch: x64
- version: '1.10' # 1.10 LTS (64-bit Windows)
os: windows-latest
arch: x64
- version: '1.10' # 1.10 LTS (64-bit Mac Intel)
os: macos-15-intel
arch: x64
- version: '1.10' # 1.10 LTS (64-bit Mac Arm)
os: macOS-latest
arch: arm64
version: ['1.10', '1']
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [default]
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: format-check
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: '1'
- uses: actions/checkout@v6
- name: Format check
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="2"))
using JuliaFormatter
format(".", verbose=true)
out = String(read(Cmd(`git diff`)))
if isempty(out)
exit(0)
end
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
64 changes: 36 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
# GDXInterface.jl

High-level Julia interface for reading and writing
[GDX files](https://gams-dev.github.io/gdx/index.html)
(GAMS Data Exchange).
[![Build Status](https://github.com/jd-foster/GDXInterface.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jd-foster/GDXInterface.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/jd-foster/GDXInterface.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jd-foster/GDXInterface.jl)

Uses the [`gdx_jll`](https://github.com/JuliaBinaryWrappers/gdx_jll.jl.git) package to
provide the GDX C library independently of GAMS.

**No GAMS installation required.**
[GDXInterface.jl](https://github.com/jd-foster/GDXInterface.jl) is an unofficial
wrapper for [gams-dev/gdx](http://github.com/gams-dev/gdx), which provides
support for reading and writing [GDX (GAMS Data Exchange) files](https://gams-dev.github.io/gdx/index.html).

For more information on the GDX file format, see the blog post
['GDX source code published on GitHub'](https://www.gams.com/blog/2023/12/gdx-source-code-published-on-github/).
[GDX source code published on GitHub](https://www.gams.com/blog/2023/12/gdx-source-code-published-on-github/).

## Installation
## Affiliation

```julia
using Pkg
Pkg.add(url="https://github.com/jd-foster/GDXInterface.jl.git")
```
This package is an unofficial Julia wrapper of [gams-dev/gdx](https://github.com/gams-dev/gdx).
It is developed and maintained by the JuMP community. It is not an official
product by [GAMS](https://gams.com).

Or in the Pkg REPL:
## Getting help

```
pkg> add https://github.com/jd-foster/GDXInterface.jl.git
```
If you need help, please ask a question on the [JuMP community forum](https://jump.dev/forum).

Run tests with:
If you have a reproducible example of a bug, please [open a GitHub issue](https://github.com/jd-foster/GDXInterface.jl/issues/new).

```
pkg> test GDXInterface
## License

`GDXInterface.jl` is licensed under the [MIT License](https://github.com/jd-foster/GDXInterface.jl/blob/main/LICENSE.md).

`GDXInterface.jl` wraps the [official GAMS GDX project](https://github.com/GAMS-dev/gdx),
which is also licensed under the [MIT License](https://github.com/GAMS-dev/gdx/blob/main/LICENSE).
You do not need a GAMS license to use `GDXInterface.jl`.

## Installation

Install `GDXInterface.jl` as follows:

```julia
using Pkg
Pkg.add(; url = "https://github.com/jd-foster/GDXInterface.jl.git")
```

These instructions will be updated if/when the package is registered.
You do not need a GAMS installation to use `GDXInterface.jl`.

## Quick Start

Expand Down Expand Up @@ -141,13 +149,13 @@ for (k, v) in gdx ... # iterate over symbols

GAMS special values are mapped to Julia equivalents when reading:

| GAMS | Julia | Notes |
|------|-------|-------|
| `UNDEF` | `NaN` | Undefined value |
| `NA` | `NaN` | Not available |
| `+INF` | `Inf` | Positive infinity |
| `-INF` | `-Inf` | Negative infinity |
| `EPS` | `-0.0` | "Explicitly zero" in sparse data |
| GAMS | Julia | Notes |
| :------ | :----- | :------------------------------- |
| `UNDEF` | `NaN` | Undefined value |
| `NA` | `NaN` | Not available |
| `+INF` | `Inf` | Positive infinity |
| `-INF` | `-Inf` | Negative infinity |
| `EPS` | `-0.0` | "Explicitly zero" in sparse data |

When writing, `NaN` maps to GAMS `NA`, `Inf`/`-Inf` map to `+INF`/`-INF`,
and `-0.0` maps back to GAMS `EPS`. This preserves EPS semantics through
Expand Down
Loading
Loading