stable setup with modern dependencies#20
Open
alan-stokes wants to merge 125 commits into
Open
Conversation
… setuptools, even when installed, wasnt being detected. I persume this is a python 3.12.3 issue.
utilising ```from importlib import metadata``` and ```try: version = metadata.version("starbug2")``` allowed me to get to a setup where starbug II would at least run without arguments with a exit code 0.
tried to capture some constants. move constants from the __init__.pys and make hard coded ones into coded cones. removed a number of import * and found a number of methods which have just been commented out and so the codebase wouldnt run on those blocks.
tried to capture some constants. move constants from the __init__.pys and make hard coded ones into coded cones. removed a number of import * and found a number of methods which have just been commented out and so the codebase wouldnt run on those blocks. tried to make it more readable with SPACES and fitting 79 chars and expected documation and what not. fixed a few bugs with try excpets which could be don without them locked down the excepts so not broad issues. tagged hardcoded paths which cant work. NOTE need to figure what they should be.
…ptions, spaces etc. theres a bunch of int vs bool mismatches around and some methods off hdu which dont seem to exist. which ill need to chase down
…ptions, spaces etc. theres a bunch of int vs bool mismatches around and some methods off hdu which dont seem to exist. which ill need to chase down splitting of monster files with many classes into modules with classes as files. still not done. misc now has extra methods to deal with
caught a lot of col_names vs colnames and a issue with the 2dBackground where its being handed the numpy array back to the functon which didnt expect the numpy array but the 2Dbackground object first. at the moment the only test which fail are the following: test_ast -> test_run_basic, test_run_harsh_inputs test_matching -> TestBandMatch -> test_order_catalogue_jwst_col_names, test_order_catalogue_filter_meta, test_order_catalogue_filter_col_names. test_match. to get most of the tests to run, i had to add a hardcoded filterString to most of the function calls. And had to clean up runs mode to access the correct files and clean up after itself. Theres still random files appearing in the test folder. which i need to chase down. as well as those failing tests. those tests cover errors of the following: ValueError: All elements of input 'data' must be finite. assert [<Table length=0>\n F115W \nfloat64\n-------, <Table length=0>\n F770W \nfloat64\n-------, <Table length=0>\n F187N \nfloat64\n-------] == [<Table length=0>\n F115W \nfloat64\n-------, <Table length=0>\n F187N \nfloat64\n-------, <Table length=0>\n F770W \nfloat64\n-------] E E (pytest_assertion plugin: representation of details failed: /home/alanstokes/starbug2/star_bug_env/lib/python3.12/site-packages/_pytest/assertion/util.py:380: ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.. E Probably an object has a faulty __repr__.) ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty. TypeError: only dimensionless scalar quantities can be converted to Python scalars
…ames and added some warns. also fixed a print to not try to force a float. tried to fix the ast by using the none depcircated class. but that didnt fix the isuse.
…here. Also found a fault with colnames again.
added some more spelling noinspects. cleaned the ast tests to less noisy. added setters to base image and detections. fixed the generic match threshold issue by chekcing for a value BEFORE going to use it. fixed STAR_BUG_TEST_DAT_ENV from START_BUG_TEST_DAT_ENV wrapped a unlink in a try catch. as there seems to be a race condition here.
…ing and added an warning message about when the radius isnt detected and it defauls to 2. fixed webb import to use expected flow.
merging as local testing seems to be happy that things havent at least broken during the type adding.
… cleaned up its lookup in band match. deleted the problematic code that depended on the problemaitc paths in constants.py and mask.py and plot.py. this also cleaned up imports. pulled out jwst code from misc into "initilise_psf_data" which ill rename to initiliase jwst psf data shortly. modified filters to only contain the 3 params starbug needs, and added a nlambda which is only used by filter F150W2 to resolve the sampling issue.Note comment on the filter for f150w2 took the default FWHM of 2 and made it a named constants in constants.py renamed init_starbug to init_starbug_for_jwst as thats what i understnad its actually doing
fedbacxk from @lib-j
the error on testing gets resolved higher up. so ignoring
# Conflicts: # starbug2/constants.py
Redundant dependencies
#1 modern dependencies
#3 enum constants
told ya. passing everything now. this is a safe point for a possible simple release
…load it locally as needed
#31 ci intergration proper tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @conornally
this PR contains the most up to date version of my fork of Starbug2.
the pr will fix (or have yet to prove that this will fix) the following open issues of your repository:
#15 (suspected to fix)
#14 (fixed)
#12 (fixed)
It also includes fixes for my found issues of:
alan-stokes#32
alan-stokes#3
alan-stokes#31
alan-stokes#41
alan-stokes#19
alan-stokes#16
alan-stokes#30
alan-stokes#29 (this was the original dependency one, and has been superceded by alan-stokes#1)
alan-stokes#17
alan-stokes#1
alan-stokes#5 -> #14
alan-stokes#2 -> #12
alan-stokes#6 -> #15
I've also type hinted everything. Deleted commented out code. Reworked the command Line processing so everything is funnelled to a config class. I suspect with time, we can probabily remove a lot of the self.blah in starbugBase to just point at the config store, but thats a later task.
Its worth noting the test dat files are not longer in the repo (well ignoring they being in history) and are now automatically downloaded by the CI before running the tests, or by the tests themselves if they detect they are missing, which helps when switching branches. Those datafiles are now part of a tagged release TEST_DATA (https://github.com/alan-stokes/starbug2/releases/tag/TEST_DATA) which you will want to claim as your own to ensure everything is in the same repository.
The code now passes strict pep8 AND ensures all files have a copywrite applied. I cant promise, but Id like to think I've caught all the magic / hardcoded constants and made them named constants / enums.
enjoy. When more is done, ill send you later PR's with those works.