pepkit / peppy

Project metadata manager for PEPs in Python
https://pep.databio.org/peppy
BSD 2-Clause "Simplified" License
37 stars 13 forks source link

import precedence #352

Closed nsheff closed 4 years ago

nsheff commented 4 years ago

when importing a pep, which takes precedence, the imported or the importing PEP?

I believe the importing PEP should take precedence. But I believe currently it's implemented in the other way.

nsheff commented 4 years ago

In fact the paper says:

The values in the imported files will be overridden by the corresponding entries in the current configuration file.

stolarczyk commented 4 years ago

I believe the importing PEP should take precedence. But I believe currently it's implemented in the other way.

In my hands the implementation reflects what's in the paper:

In [21]: cat project_config.yaml                                                                                                                                                                          
pep_version: "2.0.0"
sample_table: sample_table.csv
attr: 1
project_modifiers:
  import:
    - project_config1.yaml
In [22]: cat project_config1.yaml                                                                                                                                                                         
pep_version: "2.0.0"
attr: imported
In [23]: p=Project("project_config.yaml")                                                                                                                                                                 

In [24]: p.config.attr                                                                                                                                                                                    
Out[24]: 1

the imported attr did not overwrite the original one.

nsheff commented 4 years ago

perfect.