Pyfa icon indicating copy to clipboard operation
Pyfa copied to clipboard

Abyssal module management

Open fonsui opened this issue 6 years ago • 16 comments

I suggest an Abyssal module handling system that will enable the application to maintain a database of known modules that a user can include in their fittings, and in their compare tables.

This database can be populated with:

  1. Modules directly entered by the user, either manually created by entering values, or pasted in with a fitting or by itself

  2. Modules owned by a given toon/set of toons, either pulled from mutaplasmid.space or directly scraped from character assets via ESI, as mp.s does.

These modules can be treated like any other "quality" of item, and filtered for just like faction/deadspace/officer/tech level/etc., and a filter can be added to the compare dialog box to facilitate easy comparisons.

I do not expect this functionality to be jumped on and implemented immediately, even if you loved it, as it is a large amount of work to actually execute, even if not necessarily technically challenging. Rather, I am hoping you use this as a source of inspiration should you decide to go this route.

If you are interested in continuing the discussion regarding this concept, please post here.

fonsui avatar Jul 08 '19 23:07 fonsui

I gave it alot of thought and I think having everything in pyfa is not the best way to go.

Having abyss module management on sites like mutaplasmid.space and integrating pyfa with it makes more sense. You already can view list of your modules there, as well as compare to regular "static" modules. It is still not very convenient (e.g. there's no location of module specified), but If i wanted to improve management I'd go to https://github.com/StephenSwat/eve-abyssal-market/issues and fill some tickets or help with existing ones.

Integration with it would be easy too. It already offers a way to download data for existing modules on market and your own modules (hackish though, as you reuse json data file which the site provides for its frontend). Integrations might include features like "get me as much damage as possible for this fit, while not paying more than 200m extra".

Having it in pyfa is not viable because core functionality of any abyssal trading site - getting list of contracts and keeping it up-to-date - is too much for an offline tool which doesn't focus on it. However, this functionality is essential for some cool features.

DarkFenX avatar Jul 09 '19 05:07 DarkFenX

Any of this functionality would be welcome. Of course, this is a large category of features, and not all of them can be reasonably implemented. I would be glad to provide user-side feedback on the design process, if you are interested; more functions involving abyssal modules will be a huge boon for the application.

fonsui avatar Jul 09 '19 18:07 fonsui

I'd be more than happy to expose a more well-defined API for a user's module collection on mutaplasmid.space if that would help.

stephenswat avatar Aug 27 '19 09:08 stephenswat

@StephenSwat I am afraid that it's not mp.space API issue but rather current pyfa implementation being bottleneck. Pyfa does full recalculation of fit if anything changes, which does not allow to fetch stats of vast amount of modules and process them efficiently. I'd say it's an aim to have it in a rewrite. When it's about to be ready, I will let you know (not anytime soon though).

DarkFenX avatar Aug 27 '19 10:08 DarkFenX

@StephenSwat I would absolutely love it if you could make something that takes a copied link from ingame and turns it straight into a PyFA module paste. Even if it's not in PyFA and it's just an autohotkey script that listens for clipboard info containing a link to a module and overwrites it, it'd save me SO much time when fitting up all my idiot ships.

Asday avatar Sep 22 '20 19:09 Asday

Hi @Asday, there is a button labeled "PyFA" on the website that copies the stats in PyFA format to your clipboard directly from the website. Does that solve your problem or am I not understanding you correctly?

stephenswat avatar Sep 22 '20 19:09 stephenswat

It almost does, that's what I currently use. It's arduous and involves unnecessary work, though. I have a module in EVE that I want to drop into PyFA to check out, so I have to link it in chat and copy it to get the ID (fair enough), then go to the appraisal page, paste the chat message, send the request, mutaplasmid.space then fetches the item, converts it to PyFA notation (nice), gives each stat a rating (don't care, I'll judge), calculates derived stats (don't care, PyFA does that), uses AI to estimate a price (don't care, I'm not selling), and some other stuff which I'm sure I'm forgetting. I then click the PyFA button, and switch to PyFA to paste the item in.

I then Alt-TAB back to EVE to do the next item and god damnit that took me back to firefox. Ok, Alt-TAB twice and I'm back in EVE, copy the chat message, Alt-TAB twice to get back to firef- GOD DAMNIT.

I would like to copy the chat message in EVE, then paste in PyFA and have a module. Were you to add a nice /pyfa-from-item-id endpoint as you teased above, it would be pretty trivial to have an autohotkey script listening for chat messages containing an item ID, and send them off to the endpoint, injecting the response into the clipboard. (Not that I know offhand how to do that, but AHK is the King of these sorts of weird tasks).

Asday avatar Sep 23 '20 04:09 Asday

Thanks for the clarification, that makes a lot of sense. I should add that giving the stat ratings, derived stats, and price estimate don't really add to the time the process takes, but I understand the gist of your problem. I see multiple ways of tackling the problem, and which one I implement depends somewhat on how powerful AutoHotkey is, since I've never used that software.

One way I can approach the problem, is by having an /api/module/add endpoint, which would take an item type and an item ID. That would mean the user would need to parse the item type and item ID from the string copied to their clipboard, and I'm not sure that's something AutoHotkey can do. This endpoint would then return a link to a view endpoint for the module, which AutoHotkey would then need to query to get the PyFA string.

Alternatively, I could add a module adding endpoint which takes strings directly and parses links and item types and IDs from it automatically, meaning the user would not need to do it.

Finally, I could have a very specific endpoint like you describe, where the user submits either an item type and ID pair, or a string containing a link, and the endpoint spits out nothing but a PyFA string. This would normally be pretty bad API design in my eyes at it couples a lot of very specific ways of doing things, but I reckon a workflow like this is pretty common, so it might be worth doing.

stephenswat avatar Sep 23 '20 12:09 stephenswat

Can you guys give an example of what the EVE client give you when you copy, just for reference? While the scope of the OP is a bit out of the way for pyfa, if all you need is the module from the game copied into pyfa, that might be something we can handle pretty easily with our clipboard import logic. But I don't have a reference to what this copied text is :(

blitzmann avatar Sep 23 '20 13:09 blitzmann

I don't have an example string on me right now, perhaps @Asday can provide. This would mean PyFA would have to make a call to the EVE API. I'm not sure if that's something you're willing to do, but if so it would be extremely easy to bypass mutaplasmid.space entirely.

stephenswat avatar Sep 23 '20 14:09 stephenswat

@StephenSwat The last one appeals to me most, (or even wrap it in a regular JSON response object), just because it's the most simple. Also the /add one sounds like it's saving my module somewhere, and that might be top secret information! (Probably not, but hey).

@blitzmann I can provide an example string for you for sure, in a couple hours. I'm currently working, and turning my gaming PC on during work hours is a path that leads me into a big mess. The problem with the copied text ingame is that it has NONE of the item info - it's just an item ID. (Surrounded by some XML and chat nonsense). What mutaplasmid.space does with that is parse the item ID from it, and make an API call to EVE to get the item's stats. I don't really know much about ESI, so I dunno if you can do that without scopes or auth or whathaveyou, so adding it to PyFA, while amazing might not be as trivial as it seems.

Asday avatar Sep 23 '20 14:09 Asday

Implemented direct import from ESI (for single items only) in 9601887855ec4a77400a5222e2febce84016df54. I think for this use-case you do not need to involve mutaplasmid.space since we are not using any extra data it provides.

Also this was quite often requested feature, including from my corpmates, so here it is.

As a side-note - i did not test negative cases, when ESI returns error. But i think it should be fine since whole import thing is wrapped in catch-all try-except block. I also did not do any specific UI work for cases when networked import takes too much time (some modal window would make sense here).

DarkFenX avatar Sep 23 '20 14:09 DarkFenX

:muscle: :muscle: :muscle: :muscle: :muscle: :muscle: :muscle:

That's amazing! I'ma try it out later this evening, thank you!

Asday avatar Sep 23 '20 14:09 Asday

I think batch import also can be implemented more or less easily (e.g. when you copy multiple messages, or one message contains multiple links), is that something which would increase usability of the feature? But for it, we will probably have to show some kind of modal for sure, since it is much more likely to take more time than, say, 1 second.

ps @StephenSwat please add new mutated modules to mutaplasmid.space - various capital mods have been added quite recently.

DarkFenX avatar Sep 23 '20 14:09 DarkFenX

I think it would ask a lot of questions. If there are four mods copied and only three slots open, which should it populate? If I've been a dingus and clicked "Copy All" rather than "Copy", should PyFA really fire off 999 requests? And so on. I'm already overjoyed with single imports.

As for the network wait time, there's a little simple "Opening previous fittings" popup when opening PyFA with the right options enabled. I imagine that could be reused easily enough?

Asday avatar Sep 23 '20 14:09 Asday

Sure, we would have to limit it to some sensible value (5? 10?) to prevent that. But necessity to code some modal UI makes me feel lazy about that.

As for the network wait time, there's a little simple "Opening previous fittings" popup when opening PyFA with the right options enabled. I imagine that could be reused easily enough?

Theoretically yes, practically integrating it with fit/module import might be a bit hard.

DarkFenX avatar Sep 23 '20 14:09 DarkFenX