Coverage for src/galsbi/citations.py: 95%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-13 03:24 +0000

1# Copyright (C) 2024 ETH Zurich 

2# Institute for Particle Physics and Astrophysics 

3# Author: Silvan Fischbacher 

4# created: Wed Aug 07 2024 

5 

6from .models import ALL_MODELS, CITE_FISCHBACHER24, CITE_GALSBI, CITE_MOSER24, CITE_UFIG 

7 

8 

9def cite_abc_posterior(name): 

10 """ 

11 Prints the citation for the model with the given name. 

12 

13 :param name: model name for which to print the citation 

14 """ 

15 if name == "Moser+24": 

16 bib_entry = CITE_MOSER24 

17 elif name == "Fischbacher+24": 

18 bib_entry = CITE_FISCHBACHER24 

19 else: 

20 raise ValueError( 

21 f"Model {name} not found, only the following" 

22 f" models are available: [{ALL_MODELS}]" 

23 ) 

24 print("(PAPER model)") 

25 print(bib_entry) 

26 

27 

28def cite_galsbi_release(): 

29 """ 

30 Prints the citation for the galsbi release. 

31 """ 

32 print("(PAPERS GalSBI release)") 

33 print(CITE_FISCHBACHER24) 

34 

35 

36def cite_code_release(mode): 

37 """ 

38 Prints the citation for the code release. 

39 

40 :param mode: mode of the model 

41 """ 

42 print("(PAPERS code release)") 

43 print(CITE_GALSBI) 

44 if not (mode == "intrinsic" or mode == "emu"): 

45 if (mode == "config_file") or (mode is None): 

46 print("If you use ufig plugins in your configuration, please also cite:") 

47 print(CITE_UFIG)