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

Fixup transmission fnames #7

Merged
merged 3 commits into from
Jul 26, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Release notes for version ${{ github.ref }}
Release notes for version ${{ github.ref }}. See the \
changelog.org file for more information.
draft: false
prerelease: false

Expand Down
3 changes: 3 additions & 0 deletions changelog.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* v0.4.2
- change ~examples/calc_gas_mixtures.nim~ to not use half width space
in filenames, use dot instead
* v0.4.1
- add basic CI running test / playground
- compile examples as static linux binary
Expand Down
3 changes: 2 additions & 1 deletion examples/calc_gas_mixtures.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ proc getMassFractions(gm: GasMixture): seq[(string, float)] =
let fraction = cFrac * ratio * molarMass(c) / molarMass(gm)
result.add (el, float fraction)

proc unitToFname[T: SomeUnit](s: T): string = result = $s.float & "." & unitOf(s)
proc genOutfile(gm: GasMixture, outfile, outdir: string): string =
if outfile.len > 0: result = outfile
else:
if outdir.len > 0: result = outdir & "/"
result.add "transmission"
for el, frac in gm:
result.add &"_{el}_{frac}"
result.add &"_{gm.pressure}_{gm.temperature}"
result.add &"_{unitToFname gm.pressure}_{unitToFname gm.temperature}"
result.add ".csv"

proc calcTransmission(gm: GasMixture, length: cm, energyMin, energyMax: keV, num: int, outfile: string) =
Expand Down
Loading