Skip to content

Conversation

@SBouchard01
Copy link
Contributor

@SBouchard01 SBouchard01 commented Oct 2, 2025

If mkdir is called in staging, it creates empty directories all over the place when running AbacusHOD on the fly (which I have to do as the amount of BGS mocks I create is too big to keep on disk)

I moved it to run_hod and added a condition on write_to_disk to ensure empty folders are not created.

Also, I added two FileNotFoundError in staging because the errors raised in those case were not really understandable ( e.g. an IndexError)

Overall behavior should in theory be unchanged 👍🏼

@SBouchard01 SBouchard01 changed the title Moving mock dir creation to run_hod AbacusHOD: Moving mock dir creation to run_hod Oct 2, 2025
@lgarrison
Copy link
Member

Thanks @SBouchard01! I agree we should fix this. Do you think we could just move the mkdir call to inside gen_gal_cat()? That way it will work if someone calls gen_gal_cat directly. I think that's the only routine that writes to mock_dir.

@SBouchard01
Copy link
Contributor Author

SBouchard01 commented Oct 2, 2025

From what I see we could even remove it, as gen_gal_cat already has a safety feature to ensure the directory is created. (and it seems the only place where mock_dir/savedir is used in that function)

@lgarrison
Copy link
Member

Good point. Thanks again!

@lgarrison lgarrison merged commit 7d1775d into abacusorg:main Oct 3, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants