From 91d3035ce78ac7b9f7317f747ef06199a9fe1c72 Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Wed, 4 Mar 2026 16:37:52 +0530 Subject: [PATCH 1/7] adding easy-to-find setup instructions for a local development environment --- README.rst | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 2370eb9d..ba6d48b0 100644 --- a/README.rst +++ b/README.rst @@ -24,13 +24,33 @@ To see the latest changes in ``radiospectra`` see our `changelog `__. -To install ``radiospectra`` once miniforge is installed run the following command: +The recommended way to install ``radiospectra`` is: -.. code:: bash +### Prerequisites +- Python 3.12 +- [miniforge](https://github.com/conda-forge/miniforge) (recommended) or venv + +### Conda (Recommended) +```bash +conda create -n radiospectra-dev python=3.12 +conda activate radiospectra-dev +git clone https://github.com/sunpy/radiospectra +cd radiospectra +pip install -e '.[dev,docs]' # Editable + testing/docs extras + +### venv/pip + + python3.12 -m venv .venv +source .venv/bin/activate # Linux/Mac +# .venv\Scripts\activate # Windows +pip install -e '.[dev,docs]' + +### Verify using: + +pytest tests/ # Run tests - $ conda install radiospectra For detailed installation instructions, see the `installation guide `__ in the ``sunpy`` docs. From 97d9606f36f64f4b8ce9747d4b33b7e8c76d94ec Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Mon, 9 Mar 2026 21:43:44 +0530 Subject: [PATCH 2/7] feature: add frequency_at_index method to GenericSpectrogram --- radiospectra/spectrogram/spectrogrambase.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/radiospectra/spectrogram/spectrogrambase.py b/radiospectra/spectrogram/spectrogrambase.py index f1cb2b3f..bebe7b30 100644 --- a/radiospectra/spectrogram/spectrogrambase.py +++ b/radiospectra/spectrogram/spectrogrambase.py @@ -107,3 +107,12 @@ def __repr__(self): f" {self.wavelength.min} - {self.wavelength.max}," f" {self.start_time.isot} to {self.end_time.isot}>" ) + def frequency_at_index(self, index): + """ + Returns the frequency at a specific index. + """ + freq = self.frequencies + max_freq= len(freq) + if index < 0 or index >= max_freq: + raise IndexError(f"Index {index} out of range for frequency axis with size {max_freq}.") + return freq[index] \ No newline at end of file From a7d151b2c3633566723d431e2bde9cc242c82db8 Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Mon, 9 Mar 2026 22:17:11 +0530 Subject: [PATCH 3/7] docs: add changelog for frequency at index --- changelog/172.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/172.feature.rst diff --git a/changelog/172.feature.rst b/changelog/172.feature.rst new file mode 100644 index 00000000..7c6e27e6 --- /dev/null +++ b/changelog/172.feature.rst @@ -0,0 +1 @@ +Added a frequency_at_index method to GenericSpectrogram to allow index-to-frequency mapping. \ No newline at end of file From b4055448dcd1e3b7fd8e47d9d391d75b29ceee0c Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Mon, 9 Mar 2026 22:44:07 +0530 Subject: [PATCH 4/7] docs: add changelog for frequency at index --- changelog/172.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/172.feature.rst b/changelog/172.feature.rst index 7c6e27e6..cd482540 100644 --- a/changelog/172.feature.rst +++ b/changelog/172.feature.rst @@ -1 +1 @@ -Added a frequency_at_index method to GenericSpectrogram to allow index-to-frequency mapping. \ No newline at end of file +Added ``frequency_at_index`` method to ``GenericSpectrogram`` class \ No newline at end of file From 27cd25248967b82dc221f8a37d79290912f81cf1 Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Fri, 13 Mar 2026 16:56:54 +0530 Subject: [PATCH 5/7] docs: --- changelog/172.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/172.feature.rst b/changelog/172.feature.rst index cd482540..6fece416 100644 --- a/changelog/172.feature.rst +++ b/changelog/172.feature.rst @@ -1 +1 @@ -Added ``frequency_at_index`` method to ``GenericSpectrogram`` class \ No newline at end of file +Added frequency_at_index method to GenericSpectrogram class From 47bf443f20b4c040b39bf2f0cc20ffc477070bd5 Mon Sep 17 00:00:00 2001 From: dhanushsaimudari Date: Fri, 13 Mar 2026 17:04:25 +0530 Subject: [PATCH 6/7] docs: remove accidental code changes from documentation branch --- README.rst | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index ba6d48b0..2370eb9d 100644 --- a/README.rst +++ b/README.rst @@ -24,33 +24,13 @@ To see the latest changes in ``radiospectra`` see our `changelog `__. +To install ``radiospectra`` once miniforge is installed run the following command: -### Prerequisites -- Python 3.12 -- [miniforge](https://github.com/conda-forge/miniforge) (recommended) or venv - -### Conda (Recommended) -```bash -conda create -n radiospectra-dev python=3.12 -conda activate radiospectra-dev -git clone https://github.com/sunpy/radiospectra -cd radiospectra -pip install -e '.[dev,docs]' # Editable + testing/docs extras - -### venv/pip - - python3.12 -m venv .venv -source .venv/bin/activate # Linux/Mac -# .venv\Scripts\activate # Windows -pip install -e '.[dev,docs]' - -### Verify using: - -pytest tests/ # Run tests +.. code:: bash + $ conda install radiospectra For detailed installation instructions, see the `installation guide `__ in the ``sunpy`` docs. From 2a4dad8fcfee110ba472c42a0888c5912d84e891 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 14:59:04 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- radiospectra/spectrogram/spectrogrambase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radiospectra/spectrogram/spectrogrambase.py b/radiospectra/spectrogram/spectrogrambase.py index bebe7b30..f0119625 100644 --- a/radiospectra/spectrogram/spectrogrambase.py +++ b/radiospectra/spectrogram/spectrogrambase.py @@ -107,12 +107,13 @@ def __repr__(self): f" {self.wavelength.min} - {self.wavelength.max}," f" {self.start_time.isot} to {self.end_time.isot}>" ) + def frequency_at_index(self, index): """ Returns the frequency at a specific index. """ freq = self.frequencies - max_freq= len(freq) + max_freq = len(freq) if index < 0 or index >= max_freq: raise IndexError(f"Index {index} out of range for frequency axis with size {max_freq}.") - return freq[index] \ No newline at end of file + return freq[index]