Running the example: SpacegroupError
Closed this issue · 3 comments
I tried to run the example but can't run the cells necessary to instantiate a Projector. I suppose it's related to issues with sginfo. I downloaded the binary available on the website (the redhat binary link) and copied it to a location on the path, but I'm getting the following error trace:
---------------------------------------------------------------------------
SpaceGroupError Traceback (most recent call last)
/tmp/ipykernel_46472/153190354.py in <module>
11 dmin=dmin,
12 dmax=dmax,
---> 13 thickness=thickness)
~/Documents/Programming/PythonProjects/FORKS/problematic/problematic/projector.py in from_parameters(cls, params, spgr, name, composition, **kwargs)
208
209 See: xcore.unitcell.UnitCell"""
--> 210 return cls(UnitCell(params, spgr=spgr, name=name, composition=composition), **kwargs)
211
212 def to_dict(self):
~/Documents/Programming/PythonProjects/FORKS/problematic/problematic/unitcell.py in __init__(self, cell_params, spgr, name, composition)
44 self.__dict__.update(spgr.__dict__)
45 else:
---> 46 super(UnitCell, self).__init__(spgr)
47
48 self.name = name
~/Documents/Programming/PythonProjects/FORKS/problematic/problematic/spacegroup.py in __init__(self, symbol)
506 from parse_sginfo import parse
507
--> 508 dct = parse(symbol)
509
510 self._dct = dct
~/Documents/Programming/PythonProjects/FORKS/problematic/problematic/parse_sginfo.py in parse(spgr, verbose)
116
117 if line.startswith("sginfo: Error: Unknown Space Group Symbol"):
--> 118 raise SpaceGroupError(f"No such space group '{spgr}'")
119
120 if line.startswith("Reflection conditions"):
SpaceGroupError: No such space group 'Fm-3c'
Would you have any suggestions?
Thanks for letting me know.
I immediately tried on my own pc and I get the same problem. So I did some digging and I found that the command I used to get the space group conditions is sginfo Fm-3c -Conditions
. The -Conditions
flag is apparently an option in the version of sginfo
that I was using: https://github.com/stefsmeets/focus_package/blob/5839815c2af77fd8111a285b5e7a7f4b8a57c213/focus/src/sginfo/sginfo.c#L1810
For some reason this option is not available in the executable online (it also lacks a few other options). You could try to compile the version of focus that I used for problematic
: https://github.com/stefsmeets/focus_package/tree/master/focus/src/sginfo .
Thanks, indeed this works oddly enough! The compiled version of the official sginfo version hosted on github does not behave the same way, in fact I find no reference to the -Condition
flag in the source code.
Since this is probably the weirdest dependency requirement it might be helpful to spell out more explicitly in the README how to set this up? For others who maybe stumble on this issue: What I did is I cloned the focus_package
repo, cd'd into the sginfo
directory and ran make
. Then I copied the created sginfo binary to the bin
folder of my virtual environment (findable through echo $PATH
).
Another thing that would be really helpful is if you could put some version limits on the dependencies, perhaps even just pin the versions with which you work. I ran into some importing issues and had to iteratively downgrade packages. Don't remember exactly for which versions it didn't work, sorry.
Thanks @din14970 for the suggestions, now that I know this I will add something to the readme. Glad that it works now. And btw, I'm just as surprised as you are 😅