Skip to content

Commit

Permalink
Merge branch 'v4-prep' into minihalo-bufgix
Browse files Browse the repository at this point in the history
  • Loading branch information
daviesje committed Nov 22, 2024
2 parents c423bcc + 73ae0a9 commit 125fec4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 23 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test_build_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
branches:
- 'master'
- 'production'
- 'v4-prep'


jobs:
Expand Down Expand Up @@ -60,12 +61,6 @@ jobs:
conda config --show
printenv | sort
- name: Setup GCC
if: matrix.compiler == 'gcc'
uses: Dup4/actions-setup-gcc@v1
with:
version: latest

- name: Install 21cmFAST
run: |
CC=${{ matrix.compiler }} CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" pip install .
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ jobs:
sudo apt-get install libfftw3-dev
sudo apt-get install libgsl0-dev
- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
with:
version: latest

- name: Install 21cmFAST Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test_suite_nointegration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ jobs:
sudo apt-get install libfftw3-dev
sudo apt-get install libgsl0-dev
- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
with:
version: latest

- name: Install 21cmFAST Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/py21cmfast/drivers/lightcone.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def setup_lightcone_instance(
logger.info(f"Read in LC file at z={lightcone._current_redshift}")
if start_idx < len(scrollz):
logger.info(
f"starting at z={scrollz[start_idx]}, step ({start_idx+1}/{len(scrollz)+1}"
f"starting at z={scrollz[start_idx]}, step ({start_idx + 1}/{len(scrollz) + 1}"
)
else:
lcn_cls = (
Expand Down
4 changes: 4 additions & 0 deletions src/py21cmfast/src/IonisationBox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ void find_ionised_regions(IonizedBox *box, IonizedBox *previous_ionize_box, Pert
else if (global_params.FIND_BUBBLE_ALGORITHM == 1) // sphere method
update_in_sphere(box->xH_box, user_params_global->HII_DIM, HII_D_PARA, rspec.R/(user_params_global->BOX_LEN), \
x/(user_params_global->HII_DIM+0.0), y/(user_params_global->HII_DIM+0.0), z/(HII_D_PARA+0.0));
else{
LOG_ERROR("Invalid global_params.FIND_BUBBLE_ALGORITHM, should be 1(sphere) or 2(centre)");
Throw(ValueError);
}
} // end ionized
// If not fully ionized, then assign partial ionizations
else if (rspec.R_index==0 && (box->xH_box[HII_R_INDEX(x, y, z)] > TINY)) {
Expand Down
4 changes: 3 additions & 1 deletion src/py21cmfast/wrapper/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ def use(self, **kwargs):
prev[key] = getattr(self, key)
setattr(self, key, val)

self.validate()

yield

# Restore everything back to the way it was.
Expand All @@ -326,7 +328,7 @@ def validate(self):
"""Validate the global parameters to ensure the passed values do not clash."""
if getattr(self._cobj, "FIND_BUBBLE_ALGORITHM") not in [1, 2]:
raise ValueError(
"FIND_BUBBLE_ALGORITHM MUST BE 1 (entire sphere) or 2 (central pixel)"
f"FIND_BUBBLE_ALGORITHM ({getattr(self._cobj, 'FIND_BUBBLE_ALGORITHM')}) MUST BE 1 (entire sphere) or 2 (central pixel)"
)


Expand Down
5 changes: 0 additions & 5 deletions src/py21cmfast/wrapper/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ def __setattr__(self, name, value):
with contextlib.suppress(AttributeError):
setattr(self._cobj, name, value)
object.__setattr__(self, name, value)
self.validate()

def items(self):
"""Yield (name, value) pairs for each element of the struct."""
Expand Down Expand Up @@ -1285,7 +1284,3 @@ def filtered_repr(self, filter_params):
if k not in filter_params
)
) + ")"

def validate(self):
"""Validate members of this structure against each other."""
pass

0 comments on commit 125fec4

Please sign in to comment.