MahjongRepository/mahjong

Future 1.2.0 version

Nihisil opened this issue ยท 12 comments

Looking at the project architecture I'm seeing multiple places where we can improve the code structure to support future changes more easily.

Because of that, I decided to release a new version without compatibility with the old version.

Main planned features for the new version:

  • Remove support for Python 2.7. This version is not supported anymore and with Python 3+ only we can start to use type hints for better code documentation
  • Create default presets for popular rulesets
  • Various project architecture changes
  • Various optimization for project code performance. For that we need to create benchmarks first and improve code performance step by step. This is a necessary step because our bot is playing slower and slower and with improving mahjong lib we can improve performance for the bot as well
  • Improve documentation (migrate to github md as well?) and write more examples how to use lib
  • Move ukeire calculations from bot to mahjong lib

while python itself might not be supported there are other projects that use python 2 internally (such as renpy which might actually use this library for minigame for instane) or python embedded into any c application

You always can continue to use v1.1.11 version in that case.

https://www.python.org/doc/sunset-python-2/

We are volunteers who make and take care of the Python programming language. We have decided that January 1, 2020, was the day that we sunset Python 2.

It was almost one year ago. I think with time more and more old libs will migrate to Python 3.

Good to know you have ukeire calculations already. Then I will just wait for you to merge it into mahjong lib (hopefully with both tile name and numbers).

Yep, I think I will move this code in next days.

Also, since I am not fluent enough in Japanese (especially in writing), it is better to have someone proficient enough review the translations before we make a formal release.

Got it. Yep, I think we will find someone for texts review.

Hi! I'd like to ask whether the project is still active, to be specific, if a new release (v1.2.0) is around the corner, before I start writing a documentation for the current version~

@Gennadiyev Hi! Unfortunately, right now I can't spare resources to work on the project, I think I can release the current version as is, it already contains various improvements in the logic. The bad thing is that it contains a lot of changes in interfaces, which I'm afraid I can't document in release notes properly.

Will that work for you?

And if we are lucky later all planned features will be implemented.

Also, I am curious what kind of documentation are you planning to write?

OK, I'll first try to upgrade to the latest release and try to write some general documentations as I use the functionalities.

I'm currently using the following functions from v1.11, so expect documentation for these functions:

  • OptionalRules objects
  • HandConfig objects
  • Different styles of deck inputs (136-style, 34-style, one-line string, arrays, etc.)
  • Meld objects
  • estimate_hand_value function
  • calculate_shanten function

1.2.0 was released: https://pypi.org/project/mahjong/1.2.0/

It contains many bugfixes, library should handle all hands correctly now, please check release notes: https://github.com/MahjongRepository/mahjong/releases/tag/v1.2.0

Unfortunately, this release doesn't contain all the planned features, and in the next months, I most likely will not be able to work on them.

But I always welcome new PRs from the community, both with changes in code and documentation improvements.