Skip to content

Commit 4034058

Browse files
authored
Merge pull request #12 from odow/od/update
Add JuliaFormatter and update the README
2 parents df5c066 + 7441001 commit 4034058

9 files changed

Lines changed: 639 additions & 198 deletions

File tree

.JuliaFormatter.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration file for JuliaFormatter.jl
2+
# For more information, see: https://domluna.github.io/JuliaFormatter.jl/stable/config/
3+
4+
always_for_in = true
5+
always_use_return = true
6+
margin = 80
7+
remove_extra_newlines = true
8+
separate_kwargs_with_semicolon = true
9+
short_to_long_function_def = true

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
- release-*
4+
branches: [main]
75
pull_request:
86
types: [opened, synchronize, reopened]
97
# needed to allow julia-actions/cache to delete old caches that it has created
@@ -17,29 +15,12 @@ jobs:
1715
strategy:
1816
fail-fast: false
1917
matrix:
20-
# Only test on a subset of possible platforms.
21-
include:
22-
- version: '1' # The latest point-release (Linux)
23-
os: ubuntu-latest
24-
arch: x64
25-
- version: '1' # The latest point-release (Windows)
26-
os: windows-latest
27-
arch: x64
28-
- version: '1.10' # 1.10 LTS (64-bit Linux)
29-
os: ubuntu-latest
30-
arch: x64
31-
- version: '1.10' # 1.10 LTS (64-bit Windows)
32-
os: windows-latest
33-
arch: x64
34-
- version: '1.10' # 1.10 LTS (64-bit Mac Intel)
35-
os: macos-15-intel
36-
arch: x64
37-
- version: '1.10' # 1.10 LTS (64-bit Mac Arm)
38-
os: macOS-latest
39-
arch: arm64
18+
version: ['1.10', '1']
19+
os: [ubuntu-latest, macOS-latest, windows-latest]
20+
arch: [default]
4021
steps:
4122
- uses: actions/checkout@v6
42-
- uses: julia-actions/setup-julia@v2
23+
- uses: julia-actions/setup-julia@v3
4324
with:
4425
version: ${{ matrix.version }}
4526
arch: ${{ matrix.arch }}

.github/workflows/format_check.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: format-check
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: julia-actions/setup-julia@latest
13+
with:
14+
version: '1'
15+
- uses: actions/checkout@v6
16+
- name: Format check
17+
shell: julia --color=yes {0}
18+
run: |
19+
using Pkg
20+
Pkg.add(PackageSpec(name="JuliaFormatter", version="2"))
21+
using JuliaFormatter
22+
format(".", verbose=true)
23+
out = String(read(Cmd(`git diff`)))
24+
if isempty(out)
25+
exit(0)
26+
end
27+
@error "Some files have not been formatted !!!"
28+
write(stdout, out)
29+
exit(1)

README.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
11
# GDXInterface.jl
22

3-
High-level Julia interface for reading and writing
4-
[GDX files](https://gams-dev.github.io/gdx/index.html)
5-
(GAMS Data Exchange).
3+
[![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)
4+
[![codecov](https://codecov.io/gh/jd-foster/GDXInterface.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jd-foster/GDXInterface.jl)
65

7-
Uses the [`gdx_jll`](https://github.com/JuliaBinaryWrappers/gdx_jll.jl.git) package to
8-
provide the GDX C library independently of GAMS.
9-
10-
**No GAMS installation required.**
6+
[GDXInterface.jl](https://github.com/jd-foster/GDXInterface.jl) is an unofficial
7+
wrapper for [gams-dev/gdx](http://github.com/gams-dev/gdx), which provides
8+
support for reading and writing [GDX (GAMS Data Exchange) files](https://gams-dev.github.io/gdx/index.html).
119

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

15-
## Installation
13+
## Affiliation
1614

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

22-
Or in the Pkg REPL:
19+
## Getting help
2320

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

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

30-
```
31-
pkg> test GDXInterface
25+
## License
26+
27+
`GDXInterface.jl` is licensed under the [MIT License](https://github.com/jd-foster/GDXInterface.jl/blob/main/LICENSE.md).
28+
29+
`GDXInterface.jl` wraps the [official GAMS GDX project](https://github.com/GAMS-dev/gdx),
30+
which is also licensed under the [MIT License](https://github.com/GAMS-dev/gdx/blob/main/LICENSE).
31+
You do not need a GAMS license to use `GDXInterface.jl`.
32+
33+
## Installation
34+
35+
Install `GDXInterface.jl` as follows:
36+
37+
```julia
38+
using Pkg
39+
Pkg.add(; url = "https://github.com/jd-foster/GDXInterface.jl.git")
3240
```
3341

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

3644
## Quick Start
3745

@@ -141,13 +149,13 @@ for (k, v) in gdx ... # iterate over symbols
141149
142150
GAMS special values are mapped to Julia equivalents when reading:
143151
144-
| GAMS | Julia | Notes |
145-
|------|-------|-------|
146-
| `UNDEF` | `NaN` | Undefined value |
147-
| `NA` | `NaN` | Not available |
148-
| `+INF` | `Inf` | Positive infinity |
149-
| `-INF` | `-Inf` | Negative infinity |
150-
| `EPS` | `-0.0` | "Explicitly zero" in sparse data |
152+
| GAMS | Julia | Notes |
153+
| :------ | :----- | :------------------------------- |
154+
| `UNDEF` | `NaN` | Undefined value |
155+
| `NA` | `NaN` | Not available |
156+
| `+INF` | `Inf` | Positive infinity |
157+
| `-INF` | `-Inf` | Negative infinity |
158+
| `EPS` | `-0.0` | "Explicitly zero" in sparse data |
151159
152160
When writing, `NaN` maps to GAMS `NA`, `Inf`/`-Inf` map to `+INF`/`-INF`,
153161
and `-0.0` maps back to GAMS `EPS`. This preserves EPS semantics through

0 commit comments

Comments
 (0)