Skip to content

Commit

Permalink
Fix Python 3.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dcf21 committed Aug 24, 2024
1 parent 60fe1f4 commit 40b1824
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
FROM ubuntu:24.04

# Install required libraries
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y apt-utils dialog file git vim python3 python3-dev \
build-essential make gcc wget gzip libgsl-dev \
Expand Down
6 changes: 3 additions & 3 deletions data/stars/starCataloguesMerge/star_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import logging

from math import hypot, pi, cos
from typing import Dict, List, Optional, Tuple
from typing import Dict, List, Optional, Tuple, Union


# Memory efficient data structure used for storing data about stars
Expand Down Expand Up @@ -154,14 +154,14 @@ def add_catalogue_name(self, new_name: str) -> None:
self.names_catalogue_ref = []
self.names_catalogue_ref.append(new_name)

def magnitude_dictionary(self) -> Dict[str, Dict[str, float | Optional[str]]]:
def magnitude_dictionary(self) -> Dict[str, Dict[str, Union[float, Optional[str]]]]:
"""
Return a dictionary of all available magnitudes for this star.
:return:
dict
"""
output: Dict[str, Dict[str, float | Optional[str]]] = {}
output: Dict[str, Dict[str, Union[float, Optional[str]]]] = {}
if self.mag_V is not None:
output['V'] = {'value': self.mag_V, 'source': self.mag_V_source}
if self.mag_BT is not None:
Expand Down
4 changes: 2 additions & 2 deletions dataFetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import sys
import logging

from typing import Dict, List
from typing import Dict, List, Union


def fetch_file(web_address: str, destination: str, force_refresh: bool = False) -> bool:
Expand Down Expand Up @@ -124,7 +124,7 @@ def fetch_required_files(refresh: bool) -> None:
None
"""
# List of the files we require
required_files: List[Dict[str, str | bool]] = [
required_files: List[Dict[str, Union[str, bool]]] = [
# Definitions of constellation boundaries
# {
# 'url': 'https://cdsarc.u-strasbg.fr/ftp/VI/49/bound_20.dat.gz',
Expand Down

0 comments on commit 40b1824

Please sign in to comment.