Skip to content

Commit 9d68056

Browse files
authored
Release 1.0.4 (#76)
1 parent c4a9e9b commit 9d68056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2008
-899
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Changelog / Release notes
22

33

4+
## **[1.0.4](https://github.com/mikeqfu/pyrcs/releases/tag/1.0.4)**
5+
6+
(*30 December 2025*)
7+
8+
### Notable [changes](https://github.com/mikeqfu/pyrcs/compare/1.0.3...1.0.4) since [1.0.3](https://pypi.org/project/pyrcs/1.0.3/):
9+
10+
- **Bug fixes:**
11+
- Resolved `TypeError` in `Depots.fetch_codes()` by updating stale header mappings for TOPS/GWR codes (#67).
12+
- Fixed parsing bugs in `Tunnels._parse_length` and refined connection error reporting formatting.
13+
- Standardised error-raising logic and file path generation in `_Base._make_file_pathname`.
14+
- **Test enhancements:**
15+
- Significantly expanded unit test coverage across core modules: `Stations`, `Tunnels`, `Viaducts`, `ELRMileages`, `Features`, and `SigBoxes`.
16+
- Refactored `TestLOR` and `test_get_keys_to_prefixes` to use dynamic validation instead of hardcoded values for improved robustness (#66).
17+
- **Refactoring & maintenance:**
18+
- Converted `defaultdict` outputs to standard `dict` for cleaner API returns.
19+
- Refined data update workflows for `OtherAssets` and `ELRMileages`.
20+
- Updated project metadata, affiliation in Sphinx configuration, and `quick-start.rst`.
21+
- Updated `requirements.txt` for core and documentation dependencies.
22+
23+
**For more information and detailed specifications, check out the [PyRCS 1.0.4 documentation](https://pyrcs.readthedocs.io/en/1.0.4/).**
24+
25+
426
## **[1.0.3](https://github.com/mikeqfu/pyrcs/releases/tag/1.0.3)**
527

628
(*28 November 2025*)

MANIFEST.in

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Include package data
22
include LICENSE
3+
include README.md
4+
include CHANGELOG.md
5+
include CITATION.cff
6+
7+
# Include package data in pyrcs/data
38
recursive-include pyrcs/data *
49

5-
# Exclude tests
10+
# Exclude development and build directories
611
prune tests
12+
prune docs
713
prune tutorials
14+
prune .venv
815
prune venv
916
prune dist
17+
prune *.egg-info
18+
19+
# Global exclusions (optional but good)
20+
global-exclude __pycache__

docs/source/conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ def __init__(self, **options):
251251
),
252252
]
253253

254-
affil_dept, affil_univ = __affil__.split(', ')
255-
256254
# Custom title page:
257255
latex_maketitle = r'''
258256
\newgeometry{top=1.1in,bottom=1.1in,right=1.0in,left=1.0in}
@@ -270,10 +268,9 @@ def __init__(self, **options):
270268
\vspace{5mm}
271269
\LARGE \textbf{\textit{{Release %s}}} \par
272270
273-
\vspace{45mm}
271+
\vspace{50mm}
274272
\LARGE \textbf{{%s}} \par
275273
\Large \textit{{%s}} \par
276-
\Large \textit{{%s}} \par
277274
278275
\vspace{50mm}
279276
\Large {{First release:}} \large \textbf{{%s}} \par
@@ -303,8 +300,7 @@ def __init__(self, **options):
303300
__desc__.replace('different UK', 'different \\newline UK'),
304301
__version__,
305302
__author__,
306-
affil_dept,
307-
affil_univ,
303+
__affil__,
308304
__first_release__,
309305
__copyright__)
310306

docs/source/quick-start.rst

Lines changed: 83 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ A snapshot of the data contained in ``loc_a_codes`` is demonstrated below:
9292
3 A483 Road Scheme Supervisors Closed ...
9393
4 Aachen ...
9494
... ... .. ... ... ...
95-
3319 Ayr Wagon Team ...
96-
3320 Ayr Wagon Team ...
97-
3321 Ayr Wagon Team ...
98-
3322 Ayr Welders ...
99-
3323 Aztec Travel S378 ...
100-
[3324 rows x 12 columns]
95+
3322 Ayr Wagon Team ...
96+
3323 Ayr Wagon Team ...
97+
3324 Ayr Wagon Team ...
98+
3325 Ayr Welders ...
99+
3326 Aztec Travel S378 ...
100+
[3327 rows x 12 columns]
101101
>>> print(f"Notes: {loc_a_codes['Notes']}")
102102
>>> print(f"Last updated date: {loc_a_codes['Last updated date']}")
103103
Notes: None
104-
Last updated date: 2025-06-04
104+
Last updated date: 2025-12-11
105105
106106
>>> ## Try more examples! Uncomment the lines below and run:
107107
>>> # loc_a_codes = lid.fetch_loc_id('a') # Fetch location codes starting with 'A'
@@ -153,12 +153,12 @@ Here is a snapshot of the data contained in ``loc_codes``:
153153
3 A483 Road Scheme Supervisors Closed ...
154154
4 Aachen ...
155155
... ... .. ... ... ...
156-
59949 ZZTYALS ...
157-
59950 ZZTYKKH ...
158-
59951 ZZTYLIN ...
159-
59952 ZZTYSGY ...
160-
59953 ZZWMNST ...
161-
[59954 rows x 12 columns]
156+
60023 ZZTYALS ...
157+
60024 ZZTYKKH ...
158+
60025 ZZTYLIN ...
159+
60026 ZZTYSGY ...
160+
60027 ZZWMNST ...
161+
[60028 rows x 12 columns]
162162
>>> loc_codes_dat[['Location', 'Location_Note']]
163163
Location Location_Note
164164
0 1999 Reorganisations
@@ -167,12 +167,12 @@ Here is a snapshot of the data contained in ``loc_codes``:
167167
3 A483 Road Scheme Supervisors Closed
168168
4 Aachen
169169
... ... ...
170-
59949 ZZTYALS see Alston
171-
59950 ZZTYKKH see Kirkhaugh
172-
59951 ZZTYLIN see Lintley
173-
59952 ZZTYSGY see Slaggyford
174-
59953 ZZWMNST see Westminster
175-
[59954 rows x 2 columns]
170+
60023 ZZTYALS see Alston
171+
60024 ZZTYKKH see Kirkhaugh
172+
60025 ZZTYLIN see Lintley
173+
60026 ZZTYSGY see Slaggyford
174+
60027 ZZWMNST see Westminster
175+
[60028 rows x 2 columns]
176176
177177
To access codes from other systems, such as Crossrail or the Tyne & Wear Metro:
178178

@@ -182,7 +182,7 @@ To access codes from other systems, such as Crossrail or the Tyne & Wear Metro:
182182
'Other systems'
183183
>>> os_codes_dat = loc_codes[lid.KEY_TO_OTHER_SYSTEMS]
184184
>>> type(os_codes_dat)
185-
collections.defaultdict
185+
dict
186186
>>> list(os_codes_dat.keys())
187187
['Córas Iompair Éireann (Republic of Ireland)',
188188
'Crossrail',
@@ -200,13 +200,19 @@ For example, to view the data for Crossrail:
200200
>>> type(crossrail_codes_dat)
201201
pandas.core.frame.DataFrame
202202
>>> crossrail_codes_dat.head()
203-
Location ... New operating code
204-
0 Abbey Wood ... ABW
205-
1 Abbey Wood Bolthole Berth/Crossrail Sidings ...
206-
2 Abbey Wood Sidings ...
207-
3 Bond Street ... BDS
208-
4 Canary Wharf ... CWX
209-
[5 rows x 5 columns]
203+
Location ... New operating code
204+
0 Abbey Wood ... ABW
205+
1 Abbey Wood Bolthole Berth/Crossrail Sidings ...
206+
2 Abbey Wood Sidings ...
207+
3 Bond Street ... BDS
208+
4 Canary Wharf ... CWX
209+
... ... ... ...
210+
26 Whitechapel ... ZLW
211+
27 Whitechapel Vallance Road Crossover ...
212+
28 Woolwich ... WWC
213+
29 [unknown] ...
214+
30 [unknown] ...
215+
[31 rows x 5 columns]
210216
211217
>>> ## Try more examples! Uncomment the lines below and run:
212218
>>> ## Get a dictionary for STANOX codes and location names
@@ -320,12 +326,12 @@ Here is a snapshot of the data contained in ``elrs_codes``:
320326
3 ABB ... Now AHB
321327
4 ABB ...
322328
... ... ... ...
323-
4570 ZGW1 ...
324-
4571 ZGW2 ...
325-
4572 ZZY ...
326-
4573 ZZZ ...
327-
4574 ZZZ9 ...
328-
[4575 rows x 5 columns]
329+
4573 ZGW1 ...
330+
4574 ZGW2 ...
331+
4575 ZZY ...
332+
4576 ZZZ ...
333+
4577 ZZZ9 ...
334+
[4578 rows x 5 columns]
329335
330336
>>> ## Try more examples! Uncomment the lines below and run:
331337
>>> # elrs_a_codes = em.fetch_elr(initial='a') # Fetch ELRs starting with 'A'
@@ -458,25 +464,25 @@ Here is a snapshot of the data contained in ``stn_loc_a``:
458464
>>> type(stn_loc_a_codes_dat)
459465
pandas.core.frame.DataFrame
460466
>>> stn_loc_a_codes_dat
461-
Station ... Former Operator
462-
0 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Rai...
463-
1 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Rai...
464-
2 Aber ... Keolis Amey Operations/Gwe...
465-
3 Abercynon ... Keolis Amey Operations/Gwe...
466-
4 Abercynon ... Keolis Amey Operations/Gwe...
467-
.. ... ... ...
468-
137 Aylesbury Vale Parkway ...
469-
138 Aylesford ... London & South Eastern Rai...
470-
139 Aylesham ... London & South Eastern Rai...
471-
140 Ayr ... Abellio ScotRail from 1 Ap...
472-
141 Ayr ... Abellio ScotRail from 1 Ap...
473-
[142 rows x 14 columns]
467+
Station ... Former Operator
468+
0 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
469+
1 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
470+
2 Aber ... Keolis Amey Operations/Gwei...
471+
3 Abercynon ... Keolis Amey Operations/Gwei...
472+
4 Abercynon ... Keolis Amey Operations/Gwei...
473+
.. ... ... ...
474+
138 Aylesbury Vale Parkway ...
475+
139 Aylesford ... London & South Eastern Rail...
476+
140 Aylesham ... London & South Eastern Rail...
477+
141 Ayr ... Abellio ScotRail from 1 Apr...
478+
142 Ayr ... Abellio ScotRail from 1 Apr...
479+
[143 rows x 14 columns]
474480
>>> stn_loc_a_codes_dat.columns.to_list()
475481
['Station',
476482
'Station Note',
477483
'ELR',
478484
'Mileage',
479-
'Status',
485+
'Note',
480486
'Degrees Longitude',
481487
'Degrees Latitude',
482488
'Grid Reference',
@@ -494,14 +500,14 @@ Here is a snapshot of the data contained in ``stn_loc_a``:
494500
3 Abercynon CAM 16m 28ch
495501
4 Abercynon ABD 16m 28ch
496502
.. ... ... ...
497-
137 Aylesbury Vale Parkway MCJ2 40m 38ch
498-
138 Aylesford PWS2 38m 74ch
499-
139 Aylesham FDM 68m 66ch
500-
140 Ayr AYR6 40m 49ch
501-
141 Ayr STR1 40m 49ch
502-
[142 rows x 3 columns]
503+
138 Aylesbury Vale Parkway MCJ2 40m 38ch
504+
139 Aylesford PWS2 38m 74ch
505+
140 Aylesham FDM 68m 66ch
506+
141 Ayr AYR6 40m 49ch
507+
142 Ayr STR1 40m 49ch
508+
[143 rows x 3 columns]
503509
>>> print(f"Last updated date: {stn_loc_a_codes['Last updated date']}")
504-
Last updated date: 2025-06-16
510+
Last updated date: 2025-12-17
505511
506512
.. _quickstart-all-available-railway-stations:
507513

@@ -538,29 +544,30 @@ Here is a snapshot of the data contained in ``stn_loc_codes``:
538544
>>> type(stn_loc_codes_dat)
539545
pandas.core.frame.DataFrame
540546
>>> stn_loc_codes_dat
541-
Station ... Former Operator
542-
0 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Ra...
543-
1 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Ra...
544-
2 Aber ... Keolis Amey Operations/Gw...
545-
3 Abercynon ... Keolis Amey Operations/Gw...
546-
4 Abercynon ... Keolis Amey Operations/Gw...
547-
... ... ... ...
548-
2901 York ... East Coast Main Line Comp...
549-
2902 York ... East Coast Main Line Comp...
550-
2903 Yorton ... Keolis Amey Operations/Gw...
551-
2904 Ystrad Mynach ... Keolis Amey Operations/Gw...
552-
2905 Ystrad Rhondda ... Keolis Amey Operations/Gw...
553-
[2906 rows x 14 columns]
554-
>>> sel_cols = ['Station', 'ELR', 'Mileage', 'Degrees Longitude', 'Degrees Latitude']
555-
>>> stn_loc_codes_dat[sel_cols].tail()
556-
Station ELR Mileage Degrees Longitude Degrees Latitude
557-
2901 York ECM5 0m 00ch -1.0920 53.9584
558-
2902 York ECM4 188m 40ch -1.0920 53.9584
559-
2903 Yorton SYC 25m 14ch -2.7360 52.8083
560-
2904 Ystrad Mynach CAR 13m 60ch -3.2414 51.6414
561-
2905 Ystrad Rhondda THT 20m 05ch -3.4666 51.6436
547+
Station ... Former Operator
548+
0 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
549+
1 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
550+
2 Aber ... Keolis Amey Operations/Gwei...
551+
3 Abercynon ... Keolis Amey Operations/Gwei...
552+
4 Abercynon ... Keolis Amey Operations/Gwei...
553+
... ... ... ...
554+
2912 York ... East Coast Main Line Compa...
555+
2913 York ... East Coast Main Line Compa...
556+
2914 Yorton ... Keolis Amey Operations/Gwe...
557+
2915 Ystrad Mynach ... Keolis Amey Operations/Gwe...
558+
2916 Ystrad Rhondda ... Keolis Amey Operations/Gwe...
559+
[2917 rows x 14 columns]
560+
>>> loc_cols = ['Station', 'ELR', 'Mileage', 'Degrees Longitude', 'Degrees Latitude']
561+
>>> stn_loc_codes_dat[loc_cols].head()
562+
Station ELR ... Degrees Longitude Degrees Latitude
563+
0 Abbey Wood Abbey Wood / ABBEY WOOD NKL ... 0.1204 51.4908
564+
1 Abbey Wood Abbey Wood / ABBEY WOOD XRS ... 0.1204 51.4908
565+
2 Aber CAR ... -3.2305 51.5755
566+
3 Abercynon CAM ... -3.3294 51.6434
567+
4 Abercynon ABD ... -3.3294 51.6434
568+
[5 rows x 5 columns]
562569
>>> print(f"Last updated date: {stn_loc_codes['Last updated date']}")
563-
Last updated date: 2025-07-03
570+
Last updated date: 2025-12-23
564571
565572
>>> ## Try more examples! Uncomment the lines below and run:
566573
>>> # stn_loc_a_codes = em.fetch_locations('a') # railway stations starting with 'A'

docs/source/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
furo==2025.9.25
2-
pyhelpers==2.3.1
1+
furo==2025.12.19
2+
pyhelpers==2.3.2
33
sphinx-copybutton==0.5.2
44
sphinx-new-tab-link==0.8.1
55
sphinx-toggleprompt==0.6.0

docs/source/utils.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Validate inputs
1616
:toctree: _generated/
1717
:template: function.rst
1818

19-
is_home_connectable
19+
is_homepage_connectable
2020
is_str_float
2121
validate_initial
2222
validate_page_name
23-
collect_in_fetch_verbose
24-
fetch_all_verbose
23+
get_collect_verbosity_for_fetch
24+
get_batch_fetch_verbosity
2525

2626
Print messages
2727
~~~~~~~~~~~~~~
@@ -31,10 +31,10 @@ Print messages
3131
:template: function.rst
3232

3333
format_confirmation_prompt
34-
print_collect_msg
35-
print_conn_err
36-
print_inst_conn_err
37-
print_void_msg
34+
print_collection_message
35+
print_connection_warning
36+
print_instance_connection_error
37+
print_void_collection_message
3838

3939
Save and retrieve pre-packed data
4040
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ keywords = [
4444
]
4545
requires-python = ">=3.12"
4646
dependencies = [
47-
"pyhelpers >= 2.3.1",
47+
"pyhelpers >= 2.3.2",
4848
"beautifulsoup4"
4949
]
5050
classifiers = [

0 commit comments

Comments
 (0)