Unverified Commit 6a84acfd authored by Akke Viitanen's avatar Akke Viitanen
Browse files

handle network error in get_stars

parent d3298ca0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ figures_20251024:
	# gband number counts
	python3 src/scripts/plots/plot_number_counts_gband.py fig/number_counts_lsst_gband_20251024.pdf

coverage:
cov:
	pytest \
		--ignore-glob=src/lsst_inaf_agile/convert_agile_manager.py \
		--doctest-modules \
@@ -304,8 +304,10 @@ coverage:
		src/lsst_inaf_agile \
		tests/

documentation:
_docs:
	cd docs && make html
docs: _docs
	echo "Index is: file://$(PWD)/docs/build/html/index.html"

fig/black_hole_mass_function_redshift.pdf: src/scripts/plots/plot_black_hole_mass_function_redshift.py
	python3 $< $@
+15 −5
Original line number Diff line number Diff line
@@ -129,11 +129,21 @@ class CatalogStar:
            with warnings.catch_warnings():
                warnings.simplefilter("ignore", UnitsWarning)

                from pyvo.dal.exceptions import DALFormatError

                try:
                    # Run the syncronous job
                    tap_service = vo.dal.TAPService("https://datalab.noirlab.edu/tap")
                    tap_results = tap_service.search(query)
                    table = tap_results.to_table()
                    table.write(self.filename)
                except DALFormatError:
                    logger.error(
                        "Could not connect to the TAP service. "
                        "Check your internet connection. "
                        "Returning None."
                    )
                    return None

        table = util.read_table(self.filename)
        if maglim is not None:
+2 −2
Original line number Diff line number Diff line
@@ -121,8 +121,8 @@ def get_volume(

    Examples
    --------
    The following values only illustrate the usage. The accuracy of the volume
    estimation is set by AstroPy implementation.
    >>> # Following values only illustrate the usage.
    >>> # Accuracy of the volume estimation is set by AstroPy's implementation.
    >>> get_volume(0.0, 1.0, 1.0)
    np.float64(3660715.356254536)
    >>> get_volume(1.0, 2.0, 1.0)