Skip to content

Commit

Permalink
1.0.0rc4 (#32)
Browse files Browse the repository at this point in the history
Refactor codebase and update dependencies
  • Loading branch information
mikeqfu authored Feb 27, 2025
1 parent 2479d40 commit c17a5b7
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyrcs)](https://docs.python.org/3/)
[![License](https://img.shields.io/github/license/mikeqfu/pyrcs)](https://github.com/mikeqfu/pyrcs/blob/master/LICENSE)
[![Read the Docs - Documentation](https://img.shields.io/readthedocs/pyrcs?logo=readthedocs)](https://pyrcs.readthedocs.io/en/latest/?badge=latest)
[![GitHub Pages - Documentation](https://img.shields.io/github/actions/workflow/status/mikeqfu/pyrcs/github-pages.yml?logo=github&label=docs)](https://mikeqfu.github.io/pyrcs/)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mikeqfu/pyrcs/github-pages.yml?logo=github&branch=master)](https://github.com/mikeqfu/pyrcs/actions)
[![Codacy - Code Quality](https://app.codacy.com/project/badge/Grade/7369679225b14eaeb92ba40c12c339d5)](https://app.codacy.com/gh/mikeqfu/pyrcs/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![DOI](https://img.shields.io/badge/10.5281%2Fzenodo.4026744-blue?label=doi)](https://doi.org/10.5281/zenodo.4026744)

Expand Down
8 changes: 4 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PyRCS
#####

|PyPI - Version| |PyPI - Python Version| |Read the Docs - Documentation| |GitHub Pages - Documentation| |License| |Codacy - Code Quality| |DOI|
|PyPI - Version| |PyPI - Python Version| |Read the Docs - Documentation| |GitHub Actions Workflow Status| |License| |Codacy - Code Quality| |DOI|

.. |PyPI - Version| image:: https://img.shields.io/pypi/v/pyrcs
:alt: PyPI - Version
Expand All @@ -13,9 +13,9 @@ PyRCS
.. |Read the Docs - Documentation| image:: https://img.shields.io/readthedocs/pyrcs?logo=readthedocs
:alt: Read the Docs - Documentation
:target: https://pyrcs.readthedocs.io/en/latest/?badge=latest
.. |GitHub Pages - Documentation| image:: https://img.shields.io/github/actions/workflow/status/mikeqfu/pyrcs/github-pages.yml?logo=github&label=docs
:alt: GitHub Pages - Documentation
:target: https://mikeqfu.github.io/pyrcs/
.. |GitHub Actions Workflow Status| image:: https://img.shields.io/github/actions/workflow/status/mikeqfu/pyrcs/github-pages.yml?logo=github&branch=master
:alt: GitHub Actions Workflow Status
:target: https://github.com/mikeqfu/pyrcs/actions
.. |License| image:: https://img.shields.io/github/license/mikeqfu/pyrcs
:alt: License
:target: https://github.com/mikeqfu/pyrcs/blob/master/LICENSE
Expand Down
13 changes: 9 additions & 4 deletions pyrcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from .collector import LineData, OtherAssets
from .line_data import Bridges, ELRMileages, Electrification, LOR, LineNames, LocationIdentifiers, \
TrackDiagrams
from .other_assets import Depots, Features, SignalBoxes, Stations, Tunnels, Viaducts
from .other_assets import Buzzer, Depots, Features, HabdWild, SignalBoxes, Stations, Telegraph, \
Tunnels, Viaducts, WaterTroughs

metadata = json.loads(pkgutil.get_data(__name__, "data/.metadata").decode())

Expand Down Expand Up @@ -37,10 +38,14 @@
'LOR',
'TrackDiagrams',
'Bridges',
'Depots',
'Features',
'SignalBoxes',
'Stations',
'Tunnels',
'Viaducts',
'Stations',
'Depots',
'Features',
'HabdWild',
'WaterTroughs',
'Telegraph',
'Buzzer',
]
7 changes: 4 additions & 3 deletions pyrcs/other_assets/buzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .._base import _Base
from ..parser import _get_last_updated_date, parse_table
from ..utils import cd_data, home_page_url
from ..utils import home_page_url


class Buzzer(_Base):
Expand Down Expand Up @@ -71,7 +71,8 @@ def _collect_codes(self, source, verbose=False):
print("Done.")

self._save_data_to_file(
data=buzzer_codes, data_name=self.KEY, dump_dir=cd_data("features"), verbose=verbose)
data=buzzer_codes, data_name=self.KEY, dump_dir=self._cdd("..", "features"),
verbose=verbose)

return buzzer_codes

Expand Down Expand Up @@ -170,7 +171,7 @@ def fetch_codes(self, update=False, dump_dir=None, verbose=False, **kwargs):
args = {
'data_name': self.KEY,
'method': self.collect_codes,
'data_dir': cd_data("features"),
'data_dir': self._cdd("..", "features"),
}
kwargs.update(args)

Expand Down
6 changes: 3 additions & 3 deletions pyrcs/other_assets/habd_wild.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from .._base import _Base
from ..parser import _get_last_updated_date, parse_tr
from ..utils import cd_data, home_page_url
from ..utils import home_page_url


class HabdWild(_Base):
Expand Down Expand Up @@ -86,7 +86,7 @@ def _collect_codes(self, source, verbose=False):
print("Done.")

self._save_data_to_file(
data=habds_and_wilds_codes, data_name=self.KEY, dump_dir=cd_data("features"),
data=habds_and_wilds_codes, data_name=self.KEY, dump_dir=self._cdd("..", "features"),
verbose=verbose)

return habds_and_wilds_codes
Expand Down Expand Up @@ -223,7 +223,7 @@ def fetch_codes(self, update=False, dump_dir=None, verbose=False, **kwargs):
args = {
'data_name': self.KEY,
'method': self.collect_codes,
'data_dir': cd_data("features"),
'data_dir': self._cdd("..", "features"),
}
kwargs.update(args)

Expand Down
6 changes: 3 additions & 3 deletions pyrcs/other_assets/telegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from .._base import _Base
from ..parser import _get_last_updated_date, parse_tr
from ..utils import cd_data, home_page_url
from ..utils import home_page_url


def _parse_telegraph_in_use_term(x):
Expand Down Expand Up @@ -94,7 +94,7 @@ def _collect_codes(self, source, verbose=False):
print("Done.")

self._save_data_to_file(
data=telegraph_code_words, data_name=self.KEY, dump_dir=cd_data("features"),
data=telegraph_code_words, data_name=self.KEY, dump_dir=self._cdd("..", "features"),
verbose=verbose)

return telegraph_code_words
Expand Down Expand Up @@ -226,7 +226,7 @@ def fetch_codes(self, update=False, dump_dir=None, verbose=False, **kwargs):
args = {
'data_name': self.KEY,
'method': self.collect_codes,
'data_dir': cd_data("features"),
'data_dir': self._cdd("..", "features"),
}
kwargs.update(args)

Expand Down
6 changes: 3 additions & 3 deletions pyrcs/other_assets/trough.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .._base import _Base
from ..parser import _get_last_updated_date, parse_tr
from ..utils import cd_data, home_page_url
from ..utils import home_page_url


def _decode_vulgar_fraction(x):
Expand Down Expand Up @@ -109,7 +109,7 @@ def _collect_codes(self, source, verbose=False):
print("Done.")

self._save_data_to_file(
data=water_troughs_codes, data_name=self.KEY, dump_dir=cd_data("features"),
data=water_troughs_codes, data_name=self.KEY, dump_dir=self._cdd("..", "features"),
verbose=verbose)

return water_troughs_codes
Expand Down Expand Up @@ -211,7 +211,7 @@ def fetch_codes(self, update=False, dump_dir=None, verbose=False, **kwargs):
args = {
'data_name': self.KEY,
'method': self.collect_codes,
'data_dir': cd_data("features"),
'data_dir': self._cdd("..", "features"),
}
kwargs.update(args)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ sphinx-copybutton==0.5.2
sphinx-new-tab-link==0.6.1
sphinx-toggleprompt==0.6.0
tomli==2.0.1
twine==6.1.0
twine==6.0.1
uri-template==1.3.0
webcolors==24.8.0
10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,7 @@ license_files = LICENSE
[options]
packages = find:
include_package_data = True
python_requires = >=3.10
install_requires =
pyhelpers >= 2.1.0
beautifulsoup4
[options.package_data]
* = data/*
[options.packages.find]
exclude =
tests
*.tests
tests.*

0 comments on commit c17a5b7

Please sign in to comment.