Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Halpy-136] Add EDDB Diversion Station Loader - [merged] #273

Closed
Rixxan opened this issue May 27, 2022 · 44 comments
Closed

[Halpy-136] Add EDDB Diversion Station Loader - [merged] #273

Rixxan opened this issue May 27, 2022 · 44 comments

Comments

@Rixxan
Copy link
Member

Rixxan commented May 27, 2022

Merges feature/halpy-136 -> feature/halpy-120c

Adds a system to generate a list of all stations in the galaxy with repair functionality, and uses the new !diversion command to display the 5 closest stations in the galaxy to a client using EDSM lookup coordinates.

EDDB does not have a public API, so this tool is needed to filter down and get the closest stations, very similar to the current DSSA and Landmark systems.

Closes #136

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

added 2 commits

  • 80777fc - [Halpy-136] Add Help text
  • e2e0de2 - Merge branch 'feature/halpy-136' of...

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

I feel like there has to be a way to simplify this or put it in a loop but I just... can't remember or figure it out.

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/files/input/.gitignore line 4

reasonably sure git ignores .gitignore files not in the VCS root.

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 21

String concatenation. replace with fstrings

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 36

Consider using pathlib instead.

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 56

Once the file has been read from, you can release the resource. (exit the with stanza here.)

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 67

            if not temp_system_dict["needs_permit"]:

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 81

for i, key in enumerate(tqdm(...

Consider using a dict comprehension here instead.

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 113

Whats the issue here? cattrs can handle dicts...

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:47

Commented on CLI/EDDBFormatter/main.py line 118

like above, enumerate or dict comprehension

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

The problem isn't with cattrs, so much as how we used cattrs later in the bot it expects a list file not a dict file. Not a problem with the code, just what we are expecting and so what we need to create.

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 3 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

added 1 commit

  • 2960915 - Apply 1 suggestion(s) to 1 file(s)

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

In GitLab by @theunkn0wn1 on May 27, 2022, 24:56

Commented on CLI/EDDBFormatter/main.py line 113

Then why does the comment make it sound like you're working around a issue with cattrs? 🤣

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

Bad comment is bad. #willfix

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 4 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 4 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 4 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 4 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

added 1 commit

  • 049fae0 - [Halpy-136] Make Comment Suck Less

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 5 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

added 1 commit

  • 526c6e9 - [Halpy-136] Add Enumerate (1/2)

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

changed this line in version 6 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

added 1 commit

  • 8ba4ca6 - [Halpy-136] Replace string Interpolation

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 27, 2022

I could manage it with the second one but if I take out the first one the program begins throwing a fit. More investigation required.

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

changed this line in version 7 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 51d7bde - [Halpy-136] Drastically Simplify Diversion

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • dc3ee5e - [Halpy-136] Remove unneeded if

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

os.path does everything we need right now, but if we start working further with the filesystem in the future might be worth looking into.

At present, it just doesn't seem really worthwhile for 3 files that use os.path.

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

On further review, as the counter does not INCREASE on every loop (only loops that result in qualifying stations) I don't think we can use enumerate here. Thus must remain as is unless I'm missing something.

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

resolved all threads

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 9ef7fef - [Halpy-136] Fix an encoding error

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 96e9e5a - [Halpy-136] Improve command response

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 88b3ffc - [MINOR] Formatting Updates

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

In GitLab by @theunkn0wn1 on May 28, 2022, 24:33

Commented on CLI/EDDBFormatter/main.py line 101

            and temp_station_dict["has_repair"]
            and not temp_station_dict["is_planet"]

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

In GitLab by @theunkn0wn1 on May 28, 2022, 24:35

Commented on halpybot/commands/edsm.py line 274

(x) doubt

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

In GitLab by @theunkn0wn1 on May 28, 2022, 24:40

Commented on halpybot/commands/edsm.py line 286

shouldn't this be system = args[0].strip()?
this would catch the --new arg (unless your command system strips flags out of the message?)

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

changed this line in version 12 of the diff

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 045fe9e - Apply 1 suggestion(s) to 1 file(s)

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

added 1 commit

  • 1fbacf6 - [Halpy-136] Fix new flag for diversion, dssa, landmark

Compare with previous version

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

Fixed

@Rixxan
Copy link
Member Author

Rixxan commented May 28, 2022

resolved all threads

@Rixxan
Copy link
Member Author

Rixxan commented May 29, 2022

In GitLab by @rik079 on May 29, 2022, 14:39

approved this merge request

@Rixxan
Copy link
Member Author

Rixxan commented May 29, 2022

In GitLab by @rik079 on May 29, 2022, 14:41

mentioned in commit 1d7c194

@Rixxan Rixxan closed this as completed Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant