# Adding phonoy as a code

**URL:** <https://aiida.discourse.group/t/adding-phonoy-as-a-code/354>\
**Category:** New to AiiDA\
**Created:** [March 28, 2024, 3:33pm UTC](https://aiida.discourse.group/t/adding-phonoy-as-a-code/354 "2024-03-28T15:33:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkarkee](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@rkarkee](https://aiida.discourse.group/u/rkarkee)\
**Post date:** [March 28, 2024, 3:33pm UTC](https://aiida.discourse.group/t/adding-phonoy-as-a-code/354/1 "2024-03-28T15:33:31Z")

</div>

Hi developers,

I am trying to create a phonopy code through following code stored in phonopy\_code.py

```auto
from aiida.orm import InstalledCode
import shutil

computer = load_computer('newhpc')
code = InstalledCode(
    label='phonopy',
    computer=computer,
    filepath_executable=shutil.which('phonopy'),
    default_calc_job_plugin='phonopy.phonopy',
).store()

```

I have already created a computer as newhpc. I created through verdi computer setup --config computer.yml where computer.yml looks following:

```auto
description: lanl_hpc
hostname: localhost 
transport: core.local
scheduler: core.slurm
work_dir: "/lustre/scratch5/rkarkee/Runaiida" 
mpirun_command: "srun -n {tot_num_mpiprocs}" 
mpiprocs_per_machine: 256 

```

Finally when I run verdi run phonopy\_code.py, I got the following error.

```auto
/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/aiida/orm/nodes/data/code/legacy.py:42: AiidaDeprecationWarning: The `Code` class is deprecated. To create an instance, use the `aiida.orm.nodes.data.code.installed.InstalledCode` or `aiida.orm.nodes.data.code.portable.PortableCode` for a "remote" or "local" code, respectively. If you are using this class to compare type, e.g. in `isinstance`, use `aiida.orm.nodes.data.code.abstract.AbstractCode`. (this will be removed in v3)
  warn_deprecation(

```

How can I fix this?

Thanks a lot.

Best  
RIjan

---

<div class="post-metadata">

**Author:** ![bastonero](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/bastonero/32/32_2.png) [@bastonero](https://aiida.discourse.group/u/bastonero)\
**Post date:** [March 29, 2024, 7:14pm UTC](https://aiida.discourse.group/t/adding-phonoy-as-a-code/354/2 "2024-03-29T19:14:30Z")

</div>

Hi, it’s just a warning for the old aiida-core version. I also think it should not pop out, as you are doing it correctly. So no worries, nothing is wrong, you can proceed with your calculations.
