Mihai Cara

Results 153 comments of Mihai Cara

Another alternative to the alternative code: ```python def countExtn(fimg, extname='SCI'): if isinstance(fimg, str): with pf.open(fimg, lazy_load_hdus=False) as fimg: pass return sum(1 for e in fimg if e.header.get('extname') == extname) ```

While reviewing https://github.com/spacetelescope/drizzlepac/pull/348 I looked at `alignimages.py`. It still does not have many of the previous code review comments implemented. In addition, now I noticed something else: the [`perform_align()`](https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L167) and...

By the way, [`run_align`](https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L222) would crash if run with default values because by default `result=None` and https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L664 would crash because with the default value it would be `None.meta`.

Other observations: - https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L287-L288 is not really necessary. Also, next line https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L289 would crash if previous code leaves `repo_path=None`. - [`if` here](https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L484) is not necessary because the loop would not...

Maybe the first issue mentioned in the previous comment, could be addressed by rewriting the whole block https://github.com/spacetelescope/drizzlepac/blob/c67ac4d049394565231739553f4598fab050e9b1/drizzlepac/alignimages.py#L282-L293 as: ```python if "drizzlepac/drizzlepac" in full_path: repo_path = full_path.split("drizzlepac/drizzlepac")[0] + "drizzlepac" elif...

Not sure what this is referring to but, with a soon to be released 2.0, this issue is no longer valid: the caller can use any method to create a...

Why there is still usage for the `ModelContainer`? Is `ModelLibrary` not completely replacing `ModelContainer`? Is it only for backward compatibility to support `ModelContainer` inputs?

Also, fundamentally, don't we want to have warnings when FITS headers are not formatted as expected? I think we should.

CC: @stsci-hack I think this would be down your alley...