Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nichollsh committed Aug 30, 2024
1 parent 896c4a9 commit f257a7a
Show file tree
Hide file tree
Showing 14 changed files with 747 additions and 748 deletions.
1 change: 0 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
run: julia docs/make.jl

16 changes: 8 additions & 8 deletions .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [main]
push:
branches: [main]

jobs:
install:
runs-on: ubuntu-latest
Expand All @@ -19,7 +19,7 @@ jobs:
# Setup system
- name: NetCDF
run: |
sudo apt update
sudo apt update
sudo apt-get install libnetcdff-dev netcdf-bin gfortran gcc
# Setup AGNI
Expand All @@ -34,16 +34,16 @@ jobs:
with:
repository: 'nichollsh/SOCRATES'
path: 'socrates'

- name: Build SOCRATES
run: |
export LD_LIBRARY_PATH=""
cd socrates
./configure
./build_code
source set_rad_env
./build_code
source set_rad_env
cd ..
- name: Build AGNI
run: |
source socrates/set_rad_env
Expand All @@ -55,5 +55,5 @@ jobs:
source socrates/set_rad_env
export LD_LIBRARY_PATH=""
./test/runtests.jl
8 changes: 4 additions & 4 deletions agni.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
# Don't show plot windows
ENV["GKSwstype"] = "100"

# Check RAD_DIR
# Check RAD_DIR
if !("RAD_DIR" in keys(ENV))
error("Cannot find SOCRATES! Have you set RAD_DIR?")
end
end

# Activate environment
import Pkg
Pkg.activate(dirname(abspath(@__FILE__)))

# Include AGNI
include("src/AGNI.jl")
import .AGNI
import .AGNI

# Run
if AGNI.main()
exit(0)
end
end
exit(1)
6 changes: 3 additions & 3 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ include(wrap)

# Build libSOCRATES
println("Build libSOCRATES")
cd(joinpath(RAD_DIR,"julia/lib/")) do
cd(joinpath(RAD_DIR,"julia/lib/")) do
run(`make`)
end
end

# Download basic data
# Download basic data
println("Get data")
get_data = joinpath(ROOT_DIR,"get_data.sh")
run(`bash $get_data basic`)
Expand Down
26 changes: 13 additions & 13 deletions get_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
# All files can be found on OSF at https://osf.io/8dumn/

# Exit script if any of the commands fail
set -e
set -e

# Check that curl is installed
# Check that curl is installed
if ! [ -x "$(command -v curl)" ]; then
echo 'ERROR: curl is not installed.' >&2
exit 1
fi

# Root and resources folders
# Root and resources folders
root=$(dirname $(realpath $0))
res="$root/res/"

# Make basic data folders
mkdir -p $res
# Make basic data folders
mkdir -p $res
mkdir -p "$res/spectral_files"
mkdir -p "$res/stellar_spectra"

Expand All @@ -32,7 +32,7 @@ Call structure:
./get_data [TARGET]
Where [TARGET] can be any of the following:
basic
basic
$help_basic
highres
$help_highres
Expand All @@ -42,21 +42,21 @@ Where [TARGET] can be any of the following:
$help_stellar
"

# Generic OSF downloader function
# Generic OSF downloader function
function osf {
# $1 = OSF identifier
# $2 = target folder
# $2 = target folder
# $3 = target filename

# target file path
tgt="$2/$3"

# exists?
if [[ -f "$tgt" ]]; then
echo " $1 > file already exists"
return 0
fi

# get data
echo " $1 > $tgt"
mkdir -p $2
Expand All @@ -65,12 +65,12 @@ function osf {
return 0
}

# Handle request for downloading a group of data
# Handle request for downloading a group of data
function handle_request {
case $1 in
"basic")
echo $help_basic

osf qmp4e $res/spectral_files/Oak/318/ Oak.sf
osf 5fxr7 $res/spectral_files/Oak/318/ Oak.sf_k

Expand Down Expand Up @@ -104,7 +104,7 @@ function handle_request {
;;

"stellar")
echo $help_stellar
echo $help_stellar
osf mabp2 $res/stellar_spectra trappist-1.txt
osf rk7mj $res/stellar_spectra eps-eri.txt
osf agsrq $res/stellar_spectra hd97658.txt
Expand Down
2 changes: 1 addition & 1 deletion get_fastchem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ git clone https://github.com/NewStrangeWorlds/FastChem.git "$fcpath"
# Compile FastChem
cd "$fcpath"
mkdir build
cd build
cd build

cmake ".."
make
Expand Down
6 changes: 3 additions & 3 deletions get_socrates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# Check SSH access to GitHub
ssh -T git@github.com
if [ $? -eq 1 ]; then
if [ $? -eq 1 ]; then
use_ssh=true
else
else
use_ssh=false
fi

Expand All @@ -16,7 +16,7 @@ if [ "$use_ssh" = true ]; then
git clone git@github.com:nichollsh/SOCRATES.git "$socpath"
else
git clone https://github.com/nichollsh/SOCRATES.git "$socpath"
fi
fi

# Compile SOCRATES
cd "$socpath"
Expand Down
Loading

0 comments on commit f257a7a

Please sign in to comment.