I'm Sam, just another nerd.
I really enjoy tinkering with software. You can see some discussion at my neglected blog: sambriggs.dev.
I get a real kick out of someone opening a PR on one of my projects, so don't be shy!
A lightweight website that provides stats on delayed or cancelled UK train services
License: MIT License
I'm Sam, just another nerd.
I really enjoy tinkering with software. You can see some discussion at my neglected blog: sambriggs.dev.
I get a real kick out of someone opening a PR on one of my projects, so don't be shy!
The journey info modal dialog should convert the disruption code into text using the HttpResourceService.
The bootstrap menu does not correctly expand for small screens
When attempting to access the HSP API with incorrect credentials, the HTTP status code is 503 (authorisation failed).
This causes the results process to fail and the web page appear to be loading results indefinitely.
HTTP status codes other than 200 (OK) should pass a message to the front end/terminate gracefully.
Searching for late trains over a long period means that the results SSE connection is open for a long time (many services to search). Once this connection is open for 30 seconds the following log message is observed:
[2017-01-09 22:46:44 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:10)
This leads to the thread being aborted. The connection is reopened by the client and the cycle repeats.
This bug should be resolved so that the same connection is permitted to be open for longer.
The suggested stations in the search typeahead contains duplicates. e.g. London Victoria and London Waterloo appear multiple times.
There should be an about page that bigs me up, links to this repo and credits National Rail
Currently results are displayed in the order they arrive.
As the HSP API returns results per service, this means they are ordered by time of day.
It would be more helpful for results to be ordered by date.
Certainly some sort of ordering should be implemented, so that parallelism could be introduced in the future.
Currently the search form is tightly coupled to the HSP API parameters: from/to station, from/to date, day, tolerance.
However from a user perspective, it should be sufficient to specify a date range and the app handle the rest.
The form should be updated to make three requests if necessary: WEEKDAYS, SATURDAY and SUNDAY, should the date range span these days.
Currently it is only possible to search for delayed trains in one direction.
A checkbox should be added that searches for the return journey
The reactive form on the search page currently has no error checking /validators.
The user should not be able to submit with errors in the form, and should be prompted with some hints on how to fix any issues.
When searching for journeys on the Finsbury Park - Cambridge service the initial response is returned and the following error is thrown during the handling:
Error: InvalidOperationException: The source sequence is empty.
at List.webpackJsonp.../../../../linqts/dist/linq.js.List.First (linq.js:139)
at List.webpackJsonp.../../../../linqts/dist/linq.js.List.First (linq.js:136)
at ResourceService.webpackJsonp.../../../../../src/app/national_rail/resource.service.ts.ResourceService.lookup (resource.service.ts:22)
at new ServiceAttributes (hsp-types.ts:125)
at new ServiceMetrics (hsp-types.ts:102)
at hsp-types.ts:70
at Array.map (<anonymous>)
at new MetricsCollection (hsp-types.ts:69)
at Function.<anonymous> (hsp-api.service.ts:34)
at MapSubscriber.webpackJsonp.../../../../rxjs/operator/map.js.MapSubscriber._next (map.js:77)
Somehow a station code is used in the ResourceService that is not found in the csv.
The starter theme uses ngrx/store for maintaining state across the application.
This seems to be the grown-up way for preserving data and keeping things testable.
Whilst there is less need for it here (we don't need to pass data between components) the testability argument stands. It might well be more efficient for Angular to pick up DOM changes too...
A cancelled train means that a passenger must have taken the next train service to reach their destination.
It would be good to determine a delay based upon the scheduled arrival of the cancelled service and the actual arrival of the next service.
The trains.py source code is sometimes triggering the assertion:
File "/Users/sambriggs/Code/Python/late-train-mate/late_train_mate/trains/trains.py", line 247, in _delays_in_service
"Metric/stat mismatch!")
AssertionError: Metric/stat mismatch!
This bug should be eliminated
Currently the user types the to and from locations into a StringField.
As there is a finite list of valid station 3 letter codes, these fields should instead be a SelectField.
Currently invalid values are not detected and an HTTP POST failure to the HSP API occurs.
It would also be good to use a plugin such as Chosen to make the selection nicer for the user.
When searching for delays from Dover Priory to London St. Pancras International the app fails an assertion. This is due to the assumption that each station will only appear once in the list of journey stops.
However some routes have London St. Pancras International as the first and last stop, meaning that the incorrect (first) stop is selected.
The app should be updated to handle looping route where a station may appear multiple times.
All delays are now displayed which usually results in a large number of responses that are not of much interest.
The intention was to add a slider that could be used to filter the displayed options. This should be added.
Currently the National Rail Data Feeds credentials are obtained from Heroku environment variables while running Heroku.
Further settings such as the flask secret key and debug mode etc. might be exposed here too.
If so it might make sense to refactor config.yaml so that there is a group of publicly exposed settings.
Perhaps the relevant to code to read these settings, and app.json could be generated from config.yaml
Currently the journey info modal dialog displays the to/from stations and their scheduled/actual times.
Instead the arrival? departure? times should be displayed for all the stations on the route. Furthermore the colour of the stops should be set based upon on-time/delayed/cancelled status at that particular stop.
The project should employ the use of semantic versioning. This should see config.yaml updated with individual Major, minor, patch version numbers.
Furthermore it would probably be beneficial to have a fourth, informational build number.
The SemVer 2.0 specification says this would like like:
<Major>.<minor>.<patch>+<build>
As per this answer
We would probably get the build number from git using Git Hooks
Resources such as station codes and disruption codes should be updated at regular intervals
Search form should allow for typing stations and offering suggestions
LDBSVWS reference service has methods GetReasonCode and GetReasonCodeList
http://openldbsv.nationalrail.co.uk/
This should be used to update the reference data, currently obtained manually as a .csv file separately for station codes and late/cancellation reasons.
Currently still uses MIT licence as per starter project. Consider LGPL?
The project currently has no tests ๐ฑ
The starter theme has set everything up nicely to use:
See karma vs protractor vs jasmine for an overview
Currently the results page displays a summary of the search form parameters.
This displays the to/from stations using their codes not display text.
The summary should be updated to use the human readable text.
Currently results are send from the server to the client.
These results are handled by JavaScript and pushed into the DOM.
For more complex behaviour, such as #3 or even just rearranging results as #13 some sort of MVC framework would be preferred. I.e. results being held in a JavaScript object representing the model and the view reflecting the state of the model.
The starter project nicely set up a linter...which is having a heart attack over the current state of the repo ๐ค
As historic train data is never going to chance, it makes sense to cache recent responses from the HSP API.
Currently if the user leaves the results page and return via the 'back' button the queries are run again.
However all of the information is already loaded so it would be nice if it was re-displayed
Currently the MetricsCollection/Metrics/JourneyDetails model classes all have a dependency on the ResourceService.
This is mainly in order to convert station codes to Station objects, allow handy lookup of their human readable name.
However it appears Angular's opinion is that dependency-injected objects belong in the Angular world and shouldn't be passed down into pure classes.
Consider removing this dependency, as it mainly just functions as a method to obtain human readable information from codes.
At the moment the application has a flat file structure. It also has flat imports that mirror this structure. This is getting pretty unwieldy
You should consider grouping components together, e.g. ResultsComponent and LegComponent (given one appears within the other) into separate directories using a Feature Module much like the current app.module.ts file.
Switching to using a parallel loop has broken the unit tests.
The error is due to not being able to pickel a Mock or MagicMock.
Having to make a new ServiceDetails request for every single service results in slow work.
It would be good to parallelise the requests for details to some degree.
Currently the user is required to specify a time window to search for delayed trains.
A checkbox should be added that allows a user to search over the entire day.
Travis should be set up to run the karma test suites developed in #16.
However there is no reason not to get an empty test suite passing, thereby at least checking for compilation errors.
It should also run linting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.