Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 34 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
exclude: ".*(.csv|.fits|.fts|.fit|.header|.jpg|.jpeg|.json|.png|.svg)$"
repos:
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
hooks:
- id: docformatter
args: [--in-place, --pre-summary-newline, --make-summary-multi]
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
args:
[
"--in-place",
"--remove-all-unused-imports",
"--remove-unused-variable",
]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.14.11'
rev: "v0.14.14"
hooks:
- id: ruff-check
args: ["--fix", "--unsafe-fixes", "--preview"]
- id: ruff-format
args: ["--preview"]
- repo: https://github.com/PyCQA/docformatter
rev: master
hooks:
- id: docformatter
args: ["--make-summary-multi-line", "--pre-summary-newline", "-ri"]
- repo: https://github.com/JoC0de/pre-commit-prettier
rev: v3.8.1
hooks:
- id: prettier
types_or: [css, scss, javascript, rst, json, yaml, toml, markdown]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: ruff
args: ['--fix', '--unsafe-fixes']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix=lf']
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
args: ["--write-changes"]
ci:
autofix_prs: false
autoupdate_schedule: "quarterly"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# SDO Non-nominal Timeline #
# SDO Non-nominal Timeline

## Warning ##
## Warning

This captures data from multiple sources and is not guaranteed to be accurate.
It is intended to be a rough guide to the non-nominal periods of SDO.

## Requirements ##
## Requirements

Requirements are in `requirements.txt`.

## Notes ##
## Notes

Things to note:

Expand Down
38 changes: 21 additions & 17 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from datetime import datetime
"""
Basic configuration file for SDO data scraping.
"""

from datetime import UTC, datetime

__all__ = ["CY_END", "DATASETS", "MAP_4", "TIME_FORMATS"]

CY_END = int(str(datetime.now().year + 1)[2:])
CY_END = int(str(datetime.now(tz=UTC).year + 1)[2:])
TIME_FORMATS = [
"%d-%b-%y %H:%M:%S", # 06-Apr-10 21:11:55
"%Y.%m.%d", # 2010.05.18
"%y-%j-%H:%M:%S", # YY-DOY-HH:MM:SS
"%y-%j-%H:%M:%S", # YY-DOY-HH:MM:SS, 10-096-06:26:28
"%Y.%m.%d_%H:%M:%S", # 2010.11.10_06:01:20
"%d-%b-%Y %H:%M:%S", # 9-Apr-2010 07:30:00
]
Expand All @@ -33,26 +37,14 @@
19: "Misc Tests/Special Ops",
}
DATASETS = {
"hmi_obs_cov": {
"fURL": "http://jsoc.stanford.edu/doc/data/hmi/cov2/cov{}.html",
"jsocobs_info": {
"fURL": "https://aia.lmsal.com/public/jsocobs_info{}.html",
"RANGE": range(10, CY_END),
"MONTH_RANGE": range(1, 13),
},
"spacecraft_night": {
"URL": "https://aia.lmsal.com/public/sdo_spacecraft_night.txt",
"SKIP_ROWS": [0, 1, 2, 3],
},
"jsocobs_info": {
"fURL": "https://aia.lmsal.com/public/jsocobs_info{}.html",
"RANGE": range(10, CY_END),
},
# This site has a whole range of text files and its easier to scrape the urls that way.
# Assumption is that each text file on this page has the same structure
"jsocinst_calibrations": {
"URL": "https://aia.lmsal.com/public/jsocinst_calibrations.html",
"SKIP_ROWS": [0],
"SCRAPE": True,
},
"text_block_1": {
"URL": "./data_1.txt",
},
Expand All @@ -65,4 +57,16 @@
"text_block_4": {
"URL": "./data_4.txt",
},
"hmi_obs_cov": {
"fURL": "http://jsoc.stanford.edu/doc/data/hmi/cov2/cov{}.html",
"RANGE": range(10, CY_END),
"MONTH_RANGE": range(1, 13),
},
# This site has a whole range of text files and its easier to scrape the urls that way.
# Assumption is that each text file on this page has the same structure
"jsocinst_calibrations": {
"URL": "https://aia.lmsal.com/public/jsocinst_calibrations.html",
"SKIP_ROWS": [0],
"SCRAPE": True,
},
}
92 changes: 0 additions & 92 deletions pyproject.toml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
beautifulsoup4==4.14.3
pandas==2.3.3
pandas==3.0.0
requests==2.32.5
loguru==0.7.3
28 changes: 28 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py314"
line-length = 120
extend-exclude=[
"__pycache__",
"build",
"tools/**",
]
lint.select = [
"ALL",
]
lint.ignore = [
"TD",
"FIX",
"CPY001",
]
lint.extend-ignore = [
"COM812", # The following rule may cause conflicts when used with the formatter
]

[lint.pydocstyle]
convention = "numpy"

[format]
docstring-code-format = true
indent-style = "space"
quote-style = "double"
Loading
Loading