-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add Hamming codes #152
Comments
Hey, this seems like an old issue, but if its still relevant I would like to work on it. |
@abhishekmittal15 thanks! Yes, it's been on my plate for a while, but I would still like to add it. I am currently in a bit of a refactor of the I would recommend branching off of my |
Hi @mhostetter, I am glad to work on this. I will definitely reach out in case of any queries. For now I will setup the development environment locally and in parallel have a look at the implementation of the other codes to get an idea as to how to go about constructing the Hamming class. |
TheoryI am referring to this to gain more insights about the general version of Hamming Codes. Design Proposal for Hamming Class (Imitated the code structure from the other implementations of codes in
|
Yes, I agree with the theory you've laid out.
I agree with this approach. Your design approach is very much in line with what I was thinking too. Just a few minor comments below.
We can start with class Hamming(_LinearCode):
def __init__(
self,
n: int | None = None,
k: int | None = None,
field: Type[FieldArray] = GF2,
r: int | None = None,
extended: bool = False,
systematic: bool = True,
):
if n is not None and k is not None:
# Infer (r, extended) from (n, k, field)
elif r is not None:
# Infer (n, k) from (field, r, extended)
else:
raise ValueError So then for binary Hamming codes you could have these call signatures. galois.Hamming(7, 4) # Infers r=3 and extended=False
galois.Hamming(8, 4) # Infers r=3 and extended=True
# OR
galois.Hamming(r=3) # Infers n=7 and k=4
galois.Hamming(r=3, extended=True) # Infers n=8 and k=4 And eventually for q-ary Hamming codes, you could have these call signatures. GF = galois.GF(3) # This is GF(q)
galois.Hamming(40, 36, field=GF) # Infers r=4 and extended=False
galois.Hamming(41, 36, field=GF) # Infers r=4 and extended=True
# OR
galois.Hamming(field=GF, r=4) # Infers n=40 and k=36
galois.Hamming(field=GF, r=4, extended=True) # Infers n=41 and k=36
I basically agree with the ones you listed. I would say keep all the properties from A tip: I created a little hack to extend a parent docstring in a child method. It's kind of hacky but it's the only way I could get extended docstrings in children (without modifying the parent) and have them correctly displayed in VS Code (or other IDEs). If you have other ideas, I'm open to them. Below is an example. Inheriting from
|
Yes I think your design of the |
Hey @mhostetter. Sorry for having to leave my work unfinished, can I still continue working on it if its not taken up by somebody else? |
Yeah, sure. I have a version I worked on, but it's incomplete. If you get something working, we can merge it in. |
Ohh great, is your version pushed onto any of the branches, then maybe I can continue off of that |
No, it's not pushed anywhere. Might be best to start fresh. Use the other FEC codes as an exemplar. |
Okay, should I branch off from release/0.3x or master? |
|
No description provided.
The text was updated successfully, but these errors were encountered: