pepkit / pepspec

Documentation for PEP specification and all PEPkit software
https://pep.databio.org/
10 stars 4 forks source link

attributes with dots #26

Open fgvieira opened 8 months ago

fgvieira commented 8 months ago

Is it possible to have attribute names with dots? For example:

pep_version: 2.1.0
sample_table: "samples.csv"
sample_modifiers:
  append:
    sample_name: name
  derive:
    attributes: ["sample_name"]
    sources:
      name: "{accession}_{assembly_info.assembly_name}"

Right now I get the error:

In sample 'name' cannot correctly parse derived attribute source: {accession}_{'assembly_info.assembly_name'}. Caught exception: 'str' object has no attribute 'assembly_name''
nsheff commented 5 months ago

I believe it's not currently possible to use attributes with dots, because peppy assumes that dots are used as in Python to indicate sub-properties of an object.