Reference#
hamcontestanalysis#
commons#
General for all contests.
logging#
HamContestAnalysis Logging utilities module.
- hamcontestanalysis.commons.logging.config_logging()#
Config logging through app settings.
pandas#
General contest processing.
- hamcontestanalysis.commons.pandas.general.add_callsign_prefix(data)#
Adds the callsign prefix.
- Parameters:
data (DataFrame) – Data frame containing the log.
- Returns:
Data frame with the column prefix added.
- Return type:
DataFrame
- hamcontestanalysis.commons.pandas.general.add_dxcc_info(data)#
Add DXCC information to log.
- Parameters:
data (DataFrame) – Data frame containing the log
- Returns:
Log with DXCC-related information
- Return type:
DataFrame
- hamcontestanalysis.commons.pandas.general.add_previous_calls_info(data)#
Adds information about previous calls in other bands.
It adds the following columns: - minutes_from_previous_call: indicates the number of minutes since this callsign previously called. - band_transition_from_previous_call: the band that this callsign previously called.
- Parameters:
data (DataFrame) – Data frame containing the log.
- Returns:
Dataframe with the new information added.
- Return type:
DataFrame
- hamcontestanalysis.commons.pandas.general.compute_band(data)#
Compute band for each QSO based on the frequency.
- Parameters:
data (DataFrame) – Raw data frame
- Returns:
Raw data frame with the new columns
- Return type:
DataFrame
- hamcontestanalysis.commons.pandas.general.hour_of_contest(data)#
Retrieve our of contest.
It always assumes that Saturday 00 is the first hour, and Sunday 23:59 is the last.
- Parameters:
data (DataFrame) – Data frame containing the log
- Returns:
Data frame with the hour of the contest added
- Return type:
DataFrame
ARRL DX contest processing.
- hamcontestanalysis.commons.pandas.arrldx.compute_contest_score(data)#
Adds the QSO points in the ARRL DX contest.
- Parameters:
data (DataFrame) – Data frame with the DXCC info in it
- Returns:
Data frame with QSO points included
- Return type:
DataFrame
CQ WPX contest processing.
- hamcontestanalysis.commons.pandas.cqwpx.compute_contest_score(data)#
Adds the QSO points in the CQ WPX contest.
- Parameters:
data (DataFrame) – Data frame with score evolution in it
- Returns:
Data frame with QSO points included
- Return type:
DataFrame
CQ WW contest processing.
- hamcontestanalysis.commons.pandas.cqww.compute_contest_score(data)#
Adds the QSO points in the CQ WW contest.
- Parameters:
data (DataFrame) – Data frame with the DXCC info in it
- Returns:
Data frame with QSO points included
- Return type:
DataFrame
IARU HF contest processing.
- hamcontestanalysis.commons.pandas.iaru.compute_contest_score(data)#
Adds the QSO points in the IARU HF contest.
- Parameters:
data (DataFrame) – Data frame with the DXCC info in it
- Returns:
Data frame with QSO points included
- Return type:
DataFrame
config#
Config classes, following the structure of the yaml files in settings folder.
Base config class.
- class hamcontestanalysis.config.base.BaseSettings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None)#
HamContestAnalysis Base Settings class.
This abstract class defines the base settings configuration used in the application’s settings classes. Mainly, it defines an immutable Pydantic BaseSettings model which does not allow extra fields. In addition, it makes Pydantic model’s fields suscriptable, to allow getting settings with both settings.field and setttings[“field”].
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
- class Config#
Pydantic model config.
- classmethod customise_sources(init_settings, env_settings, file_secret_settings)#
Customise source priority to allow setting overwrite from env vars.
- Parameters:
init_settings (Callable[[BaseSettings], Dict[str, Any]]) –
env_settings (Callable[[BaseSettings], Dict[str, Any]]) –
file_secret_settings (Callable[[BaseSettings], Dict[str, Any]]) –
- Return type:
Tuple[Callable[[BaseSettings], Dict[str, Any]], …]
HamContestAnalysis contest dates settings class definition.
- class hamcontestanalysis.config.contest.ContestAttributes(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, name)#
Meta data attributes for each contest.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
name (str) –
- class hamcontestanalysis.config.contest.ContestData(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, attributes, modes)#
Aggregate all data for each contest.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
attributes (ContestAttributes) –
modes (ContestModes) –
- class hamcontestanalysis.config.contest.ContestDates(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, month, week)#
Contest information model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
month (int) –
week (int) –
- get_dates(year)#
Get the dates of a contest given a year.
- Parameters:
year (int) – Year of the contest
- Returns:
Dates of the contest
- Return type:
List[datetime]
- class hamcontestanalysis.config.contest.ContestModes(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, cw=None, ssb=None, mixed=None)#
Dates for each contest mode.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
cw (ContestDates | None) –
ssb (ContestDates | None) –
mixed (ContestDates | None) –
- property modes#
Property returning available modes.
- class hamcontestanalysis.config.contest.ContestSettings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, cqww=None, cqwpx=None, iaru=None, arrldx=None)#
Contest dates Settings model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
cqww (ContestData | None) –
cqwpx (ContestData | None) –
iaru (ContestData | None) –
arrldx (ContestData | None) –
- property contests#
Return available contests or contests correctly set in yaml.
Settings Info class definition.
- class hamcontestanalysis.config.info.SettingsInfo(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, environment, force_environment)#
Settings Info model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
environment (str) –
force_environment (str) –
HamContestAnalysis Logging settings class definition.
- class hamcontestanalysis.config.logging.LoggingSettings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, version, incremental, formatters, handlers, loggers)#
Logging Settings model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
version (int) –
incremental (bool) –
formatters (Dict[str, Any]) –
handlers (Dict[str, Any]) –
loggers (Dict[str, Any]) –
Settings class definition.
- class hamcontestanalysis.config.settings.Settings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, contest, info, logging, storage)#
General Settings model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
contest (ContestSettings) –
info (SettingsInfo) –
logging (LoggingSettings) –
storage (StorageSettings) –
Storage settings for HamContestAnalysis.
- class hamcontestanalysis.config.storage.StoragePathsSettings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, raw_data, raw_metadata, raw_rbn, plots, temporary)#
S3 Paths Settings model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
raw_data (str) –
raw_metadata (str) –
raw_rbn (str) –
plots (str) –
temporary (str) –
- class hamcontestanalysis.config.storage.StorageSettings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, *, partitions, prefix, partitions_rbn, prefix_plots, partitions_plots)#
Storage Settings model.
- Parameters:
_env_file (str | PathLike | List[str | PathLike] | Tuple[str | PathLike, ...] | None) –
_env_file_encoding (str | None) –
_env_nested_delimiter (str | None) –
_secrets_dir (str | PathLike | None) –
partitions (str) –
prefix (str) –
partitions_rbn (str) –
prefix_plots (str) –
partitions_plots (str) –
- class Config#
Pydantic model config.
- property paths#
Render HamContestAnalysis paths from settings.
This method renders the paths for types in ‘optimisation’, ‘performance’ and ‘temporary’ by interpolating: s3://{self.bucket}/{self.prefix}/{type}(/{self.partition}) We do this instead of using Dynaconf Jinja2 templating to allow for overrides in the prefix via environment variables. This use case is needed on the staged executions to redirect S3 output on either environment.
data#
I/O classes for the different contests/RBN data.
Contest cabrillo data source module.
- class hamcontestanalysis.data.processed_contest_source.ProcessedContestDataSource(callsign, contest, year, mode)#
Processed contest data source definition.
- Parameters:
callsign (str) –
contest (str) –
year (int) –
mode (str) –
- load()#
Load data from storage.
This method reads the data from the given storage path according to the specified file format and returns the read and processed dataframe.
- Returns:
DataFrame loaded and processed.
- Return type:
DataFrame
Contest cabrillo data source module.
- class hamcontestanalysis.data.processed_rbn_source.ProcessedReverseBeaconDataSource(contest, year, mode)#
Processed RBN data source definition.
- Parameters:
contest (str) –
year (int) –
mode (str) –
- load()#
Load data from storage.
This method reads the data from the given storage path according to the specified file format and returns the read and processed dataframe.
- Returns:
DataFrame loaded and processed.
- Return type:
DataFrame
Contest cabrillo data source module.
- class hamcontestanalysis.data.raw_contest_cabrillo.RawContestCabrilloDataSource(callsign, year, mode)#
Contest cabrillo data source definition.
- Parameters:
callsign (str) –
year (int) –
mode (str) –
- classmethod get_all_options_arrl(contest, eid=None, force=False)#
Retrieve all contest/year/callsigns from the website.
To do that, it uses _get_available_callsigns_and_links and _get_available_years functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
eid (Optional[int]) – eid to complete the website path, if needed. Defaults to None.
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- classmethod get_all_options_cq(contest, force=False)#
Retrieve all contest/year/mode/callsigns from the website.
To do that, it uses _get_available_callsigns and _get_available_year_modes functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- read(file_format, path, **kwargs)#
Read data from contest website.
- Parameters:
file_format (str) –
path (str | PathLike) –
kwargs (Any) –
- Return type:
DataFrame
HamContestAnalysis CQWW contest storage data sink module.
- class hamcontestanalysis.data.raw_contest_sink.RawCabrilloDataSink(prefix=None)#
Contest storage data sink definition.
- Parameters:
prefix (str | None) –
- class hamcontestanalysis.data.raw_contest_sink.RawCabrilloMetaDataSink(prefix=None)#
Contest storage meta data sink definition.
- Parameters:
prefix (str | None) –
- prepare_output(data)#
Prepare output to sink.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
HamContestAnalysis CQWW contest storage data sink module.
- class hamcontestanalysis.data.raw_rbn_sink.RawReverseBeaconDataSink(prefix=None)#
Reverse Beacon storage data sink definition.
- Parameters:
prefix (str | None) –
HamContestAnalysis Storage Data Sink class definition.
- class hamcontestanalysis.data.storage_sink.StorageDataSink(prefix=None)#
Storage Data Sink abstract class.
This abstract class defines a data sink which pushes data to a path in local or remote storage, and defines its main interface and options.
The class variables file_format and path determine how and where to push the data to, respectively. The file_format variable is a string which is mapped to the save method to use via the StorageDataSink.save_method_by_file_format mapping. The path is a string or path-like object to specify data sink path. This variable can be optionally prefixed as {prefix}/{path} if a prefix string is provided on instance constructor. The (prefixed) string could be a URL pointing to a local or remote storage, with valid URL schemes including http, ftp, s3, gs, and file.
On data pushing, the class takes some input data (as pandas.DataFrame) and passes it to a prepare_output method. This method can be used to prepare data output, such as fill NaNs, filter or partition rows. After the output data is prepared, it is passed to the save method, which retrieves the specific pandas.DataFrame.to_{file_format} method according to file_format, then saves the data to the sink’s path.
The save method can be provided with additional keyword arguments via the storage_options class/instance variable.
- Parameters:
prefix (str | None) –
- prepare_output(data)#
Prepare output to sink.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
- push(data)#
Push data to storage.
This method pushes the given DataFrame to the given storage path according to the specified file format.
- Parameters:
data (DataFrame) – pandas.DataFrame with data to sink to storage.
- Return type:
None
- save(data, file_format, path, **kwargs)#
Save data to sink.
This method selects a save method according to the given file format, specified in the StorageDataSink.save_method_by_file_format mapping, and saves the given data to the given storage path. Additional keyword arguments are passed down to the save method. If no save method is set for the given file format, a NotImplementedError is raised.
- Parameters:
data (DataFrame) – pandas.DataFrame with data to sink to storage.
file_format (str) – string with format of the data source to read.
path (str | PathLike) – string or os.PathLike with path of the data source to read.
kwargs (Any) – any additional keyword arguments, passed down to the read method by format.
- Return type:
None
HamContestAnalysis Storage Data Source class definition.
- class hamcontestanalysis.data.storage_source.StorageDataSource(prefix=None)#
Storage Data Source abstract class.
This abstract class defines a data source taken from local or remote storage, and defines its main interface and options.
The class variables file_format and path determine how and where to push the data to, respectively. The file_format variable is a string which is mapped to the the read method to use via the StorageDataSource.read_method_by_file_format mapping. The path is a string or path-like object to specify data source path. This variable can be optionally prefixed as {prefix}/{path} if a prefix string is provided on instance constructor. The (prefixed) string could be a URL pointing to a local or remote storage, with valid URL schemes including http, ftp, s3, gs, and file.
On data access, the class reads the desired source with format file_format from the specified path, local or remote, and passes the read data to the process_result method to perform processing operations, e.g. data type transforamtions, filtering, NaN filling, etc.
The read method can be provided with additional keyword arguments via the storage_options class/instance variable.
- Parameters:
prefix (str | None) –
- load()#
Load data from storage.
This method reads the data from the given storage path according to the specified file format and returns the read and processed dataframe.
- Returns:
DataFrame loaded and processed.
- Return type:
DataFrame
- process_result(data)#
Process result from storage read.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
- read(file_format, path, **kwargs)#
Read data from storage.
This method selects a read method according to the given file format, specified in the StorageDataSource.read_method_by_file_format mapping, and reads the source’s data from the given path. Additional keyword arguments are passed down to the read method. If no read method is set for the given file format, a NotImplementedError is raised.
- Parameters:
file_format (str) – string with format of the data source to read.
path (str | PathLike) – string or os.PathLike with path of the data source to read.
kwargs (Any) – any additional keyword arguments, passed down to the read method by format.
- Returns:
Dataframe with data from storage.
- Return type:
DataFrame
ARRL DX Contest cabrillo data source module.
- class hamcontestanalysis.data.arrldx.storage_source.CabrilloDataSource(callsign, year, mode)#
ARRL DX Contest cabrillo data source definition.
- Parameters:
callsign (str) –
year (int) –
mode (str) –
- classmethod get_all_options(force=False)#
Retrieve all contest/year/mode/callsigns from the website.
- To do that, it uses _get_available_callsigns and
_get_available_year_modes functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- process_result(data)#
Processes Performance output loaded data.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
CQ WPX Contest cabrillo data source module.
- class hamcontestanalysis.data.cqwpx.storage_source.CabrilloDataSource(callsign, year, mode)#
CQ WPX Contest cabrillo data source definition.
- Parameters:
callsign (str) –
year (int) –
mode (str) –
- classmethod get_all_options(force=False)#
Retrieve all contest/year/mode/callsigns from the website.
- To do that, it uses _get_available_callsigns and
_get_available_year_modes functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- process_result(data)#
Processes Performance output loaded data.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
CQ WW Contest cabrillo data source module.
- class hamcontestanalysis.data.cqww.storage_source.CabrilloDataSource(callsign, year, mode)#
CQ WW Contest cabrillo data source definition.
- Parameters:
callsign (str) –
year (int) –
mode (str) –
- classmethod get_all_options(force=False)#
Retrieve all contest/year/mode/callsigns from the website.
- To do that, it uses _get_available_callsigns and
_get_available_year_modes functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- process_result(data)#
Processes Performance output loaded data.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
IARU HF Contest cabrillo data source module.
- class hamcontestanalysis.data.iaru.storage_source.CabrilloDataSource(callsign, year, mode)#
IARU HF Contest cabrillo data source definition.
- Parameters:
callsign (str) –
year (int) –
mode (str) –
- classmethod get_all_options(force=False)#
Retrieve all contest/year/mode/callsigns from the website.
- To do that, it uses _get_available_callsigns and
_get_available_year_modes functions above to get all potential options from the contest website.
- Parameters:
contest (str) – contest to consider
force (bool) – force the reconstruction of the parquet file with the information. Defaults to False.
- Returns:
- Dataframe with information about the available contest,
mode and year
- Return type:
DataFrame
- process_result(data)#
Processes Performance output loaded data.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
CQ WW Contest cabrillo data source module.
- class hamcontestanalysis.data.rbn.storage_source.ReverseBeaconRawDataSource(year, mode, contest=None, dates=None)#
Reverse beacon data source definition.
- Parameters:
year (int) –
mode (str) –
contest (str | None) –
dates (List[date] | None) –
- load()#
Load data from storage.
This method reads the data from the given storage path according to the specified file format and returns the read and processed dataframe.
- Returns:
DataFrame loaded and processed.
- Return type:
DataFrame
- process_result(data)#
Processes Performance output loaded data.
- Parameters:
data (DataFrame) –
- Return type:
DataFrame
plots#
Customized Plotly plots.
HamContestAnalysis plot base class.
- class hamcontestanalysis.plots.plot_base.PlotBase(contest, mode, callsigns_years)#
Plot abstract base class.
This abstract class serves as a base interface for the different plots, It mainly defines the PlotBase.plot method as the way to create a plotly object, implemented by each plot subclass.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
- property data#
Property of attribute data.
- abstract plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Figure containing the plot
- Return type:
Optional[Figure]
HamContestAnalysis plot base class.
- class hamcontestanalysis.plots.plot_rbn_base.PlotReverseBeaconBase(contest, mode, years)#
Plot RBN abstract base class.
This abstract class serves as a base interface for the different plots, It mainly defines the PlotBase.plot method as the way to create a plotly object, implemented by each plot subclass.
- Parameters:
contest (str) –
mode (str) –
years (List[int]) –
- property data#
Property of attribute data.
- abstract plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
_description_
- Return type:
Optional[Figure]
Plot ARRL DX contest evolution.
- class hamcontestanalysis.plots.arrldx.plot_contest_evolution.PlotContestEvolution(mode, callsigns_years, feature, time_bin_size=1)#
Plot ARRL DX evolution.
- Parameters:
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
feature (str) –
time_bin_size (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_frequency.PlotFrequency(contest, mode, callsigns_years)#
Plot QSOs Hour.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_log_heatmap.PlotLogHeatmap(contest, mode, callsigns_years, time_bin_size=1, continents=None)#
Plot Contest log heatmap.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
continents (List[str] | None) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
_description_
- Return type:
Optinal[Figure]
Plot minutes until next call.
- class hamcontestanalysis.plots.common.plot_minutes_from_previous_call.PlotMinutesPreviousCall(mode, callsigns_years, time_bin_size=5, xaxis_max_value=10)#
Plot Minutes from previous call histogram.
- Parameters:
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
xaxis_max_value (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_qso_direction.PlotQsoDirection(contest, mode, callsigns_years, contest_hours)#
Plot QSO direction.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
contest_hours (List[float]) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_qsos_hour.PlotQsosHour(contest, mode, callsigns_years, continents=None, time_bin_size=60)#
Plot QSOs Hour.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
continents (List[str] | None) –
time_bin_size (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
_description_
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_rate.PlotRate(contest, mode, callsigns_years, time_bin_size=1, target='qsos')#
Plot Rate.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
target (str) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
_description_
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.common.plot_rolling_rate.PlotRollingRate(contest, mode, callsigns_years, time_bin_size=1, target='qsos')#
Plot Rate.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
target (str) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot CQ WPX contest evolution.
- class hamcontestanalysis.plots.cqwpx.plot_contest_evolution.PlotContestEvolution(mode, callsigns_years, feature, time_bin_size=1)#
Plot CQ WPX evolution.
- Parameters:
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
feature (str) –
time_bin_size (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot CQ WW contest evolution.
- class hamcontestanalysis.plots.cqww.plot_contest_evolution.PlotContestEvolution(mode, callsigns_years, feature, time_bin_size=1)#
Plot CQ WW evolution.
- Parameters:
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
feature (str) –
time_bin_size (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot IARU HF contest evolution.
- class hamcontestanalysis.plots.iaru.plot_contest_evolution.PlotContestEvolution(mode, callsigns_years, feature, time_bin_size=1)#
Plot IARU HF evolution.
- Parameters:
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
feature (str) –
time_bin_size (int) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.rbn.plot_band_conditions.PlotBandConditions(contest, mode, years, time_bin_size, reference, continents)#
Plot band conditions.
- Parameters:
contest (str) –
mode (str) –
years (List[int]) –
time_bin_size (int) –
reference (str) –
continents (List[str]) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.rbn.plot_cw_speed.PlotCwSpeed(contest, mode, callsigns_years, time_bin_size, bands=None)#
Plot CW speed from RBN.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
bands (List[int] | None) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.rbn.plot_number_rbn_spots.PlotNumberRbnSpots(contest, mode, callsigns_years, time_bin_size, rx_continents, bands=None)#
Plot SNR from RBN.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
rx_continents (List[str]) –
bands (List[int] | None) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.rbn.plot_snr.PlotSnr(contest, mode, callsigns_years, time_bin_size, rx_continents)#
Plot SNR from RBN.
- Parameters:
contest (str) –
mode (str) –
callsigns_years (List[Tuple[str, int]]) –
time_bin_size (int) –
rx_continents (List[str]) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
Plot QSO rate.
- class hamcontestanalysis.plots.rbn.plot_snr_band_continent.PlotSnrBandContinent(contest, mode, bands, callsigns, year, time_bin_size, rx_continents)#
Plot SNR from RBN in a grid of bands and continents.
- Parameters:
contest (str) –
mode (str) –
bands (List[int]) –
callsigns (List[str]) –
year (int) –
time_bin_size (int) –
rx_continents (List[str]) –
- plot(save=False)#
Create plot.
- Parameters:
save (bool) – Save file in html. Defaults to False.
- Returns:
Plotly figure
- Return type:
Optional[Figure]
tables#
Customized Dash tables.
Base class for tables in the dashboards.
- class hamcontestanalysis.tables.table_base.TableBase(columns, style_table=None, style_data=None, filter_action='native', sort_action='native')#
Table base class.
This class serves as a base interface for the different tables, It mainly defines the TableBase.show method as the way to create a plotly object, implemented by each table subclass.
- Parameters:
columns (List[Dict[str, str]]) –
style_table (Dict[Any, Any] | None) –
style_data (Dict[Any, Any] | None) –
filter_action (str) –
sort_action (str) –
- property columns#
Property of columns.
- property data#
Property of attribute data.
- property filter_action#
Property of filter_action.
- show(page_size=250)#
Create table.
- Parameters:
page_size (int) – number of rows to display. Defaults to 250.
- Returns:
DataTable containing the table
- Return type:
Optional[DataTable]
- property sort_action#
Property of sort_action.
- property style_data#
Property of style_data.
- property style_table#
Property of style_table.
Dash table containing the log of the contest.
- class hamcontestanalysis.tables.arrldx.table_contest_log.TableContestLog#
Table containing the contest log.
Dash table containing the summary of the IARU HF contest.
- class hamcontestanalysis.tables.arrldx.table_contest_summary.TableContestSummary#
Table containing the contest summary.
Dash table containing the log of the contest.
- class hamcontestanalysis.tables.cqwpx.table_contest_log.TableContestLog#
Table containing the contest log.
Dash table containing the summary of the CQ WPX contest.
- class hamcontestanalysis.tables.cqwpx.table_contest_summary.TableContestSummary#
Table containing the contest summary.
Dash table containing the log of the contest.
- class hamcontestanalysis.tables.cqww.table_contest_log.TableContestLog#
Table containing the contest log.
Dash table containing the summary of the CQ WW contest.
- class hamcontestanalysis.tables.cqww.table_contest_summary.TableContestSummary#
Table containing the contest summary.
Dash table containing the log of the contest.
- class hamcontestanalysis.tables.iaru.table_contest_log.TableContestLog#
Table containing the contest log.
Dash table containing the summary of the IARU HF contest.
- class hamcontestanalysis.tables.iaru.table_contest_summary.TableContestSummary#
Table containing the contest summary.
utils#
Other util functions and classes.
Calculation util functions related to contests.
- hamcontestanalysis.utils.calculations.contests.get_weekends_info(year)#
Return the dates for the weekends of the different weeks in a year.
- Parameters:
year (int) – Year
- Returns:
Dataframe with the dates of the saturdays and sundays of the weekends, as well as information on weekend number of the month, and whether it is a full weekend
- Return type:
DataFrame
Callback manager class definition.
- class hamcontestanalysis.utils.dashboards.callbacks_manager.Callback(func, outputs, inputs, states=<factory>, kwargs=<factory>)#
Data class for Callback.
- Parameters:
func (Callable) –
outputs (Output | List[Output]) –
inputs (Input | List[Input]) –
states (State | List[State]) –
kwargs (dict) –
- class hamcontestanalysis.utils.dashboards.callbacks_manager.CallbackManager#
CallbackManager class.
- attach_to_app(app)#
Attach callback to app.
- Parameters:
app (Dash) – Dash application
- callback(*args, **kwargs)#
Callback decorator definition.
Utils to fix dataframe types in the dashboards.
- hamcontestanalysis.utils.types.dataframe_types.fix_types_data_contest(data)#
Fix the datetime types after serializing in contest dataset.
- Parameters:
data (DataFrame) – dataframe with datetime as object
- Returns:
dataframe with types fixed
- Return type:
DataFrame
- hamcontestanalysis.utils.types.dataframe_types.fix_types_data_rbn(data)#
Fix the datetime types after serializing in RBN dataset.
- Parameters:
data (DataFrame) – dataframe with datetime as object
- Returns:
dataframe with types fixed
- Return type:
DataFrame